remote control mac on mac os 10.10

OS X Mavericks: Share your screen using Back to My Mac

Follow these steps for each computer whose screen you want to share.

  1. Choose Apple menu > System Preferences, then click Sharing.
  2. Select Screen Sharing.
    If Remote Management is selected, you must deselect it before you can select Screen Sharing.
  3. Next to “Allow access for,” choose all users, or only listed users. If you permit only listed users to have access to the screen, click Add (+) and Remove (-) to edit the list.
  4. In System Preferences, click Show All, then open iCloud preferences.
  5. If you aren’t already signed in to iCloud, enter the Apple ID you use with iCloud, then click Sign In.
  6. Select Back to My Mac.
    To stop sharing your screen using Back to My Mac, open iCloud preferences, then deselect Back to My Mac.

open application in terminal

I found solution of open sublime in terminal, but how can I open others app in terminal ?

##Copy following lines into ~/.bashrc or ~/.zshrc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -------
# Function
# -------
function google() { open "https://www.google.com/search?q=$*&gws_rd=ssl"; }
function baidu() { open "https://www.baidu.com/s?ie=UTF-8&wd=$*"; }
function github() { open "https://github.com/search?utf8=%E2%9C%93&q=$*"; }
# -------
# Aliases
# -------
alias chrome='open -a /Applications/Google\ Chrome.app'
alias sublime='open -a /Applications/Sublime\ Text\ 3.app'
alias xcode='open -a /Applications/Xcode.app'
alias mou='open -a /Applications/Mou.app'
...and so on

##Make sure ~/bash_profile contains following line

1
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi

#Usage

1
2
3
$ github bumaociyuan
$ chrome http://bumaociyuan.github.io/terminal/2015/08/17/open-application-in-terminal.html

oh my zsh update failed

Error message like :

1
2
blabla https://...... certificate .... fail
:D

##Solution

1
2
3
4
$ vim $ZSH/.git/config
#replace origin url with 'git@github.com:robbyrussell/oh-my-zsh.git'
$ upgrade_oh_my_zsh

using shadowsocks in terminal

Using Shadowsocks with Command Line Tools

1
2
3
4
5
#1
$ brew install proxychains-ng
#2
$ mkdir ~/.proxychains;touch ~/.proxychains/proxychains.conf

then copy

1
2
3
4
5
6
7
8
9
10
strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
localnet 127.0.0.0/255.0.0.0
quiet_mode
[ProxyList]
socks5 127.0.0.1 1080

into ~/.proxychains/proxychains.conf

##usage

1
2
$ proxychains4 youtube-dl -o funny_video.flv https://www.youtube.com/funny_video
##youtube-dl supported site https://github.com/rg3/youtube-dl/blob/master/docs/supportedsites.md :D

share internet connection from mac to mobile device

Reverse Tether - Share OSX Yosemite Wifi Connection Over Bluetooth

In order to do this in Yosemite, you’ll need to go back to the main screen of System Preferences and click on the Sharing preference pane. In the sidebar, there will be an Internet Sharing option. Click on this to view its settings.

Now set the “Share your connection from” drop down to Wi-Fi and then check the Bluetooth PAN checkbox in the menu below. Next just make sure to check the box next Internet Sharing in the sidebar.

Once this is done your Mac should be sharing its Wi-Fi connection to devices in your Bluetooth PAN.

self signed certificates in iOS

Five Tips for Using Self Signed SSL Certificates with iOS
Create a HTTPS Server to install ipa locally

1
2
3
4
5
6
# example
# openssl genrsa -out myselfsigned.key 2048
# openssl req -new -x509 -key myselfsigned.key -out myselfsigned.cer -days 365 -subj /CN=www.mysite.com
# openssl pkcs12 -export -out myselfsigned.pfx -inkey myselfsigned.key -in myselfsigned.cer
1
2
3
4
5
6
7
8
9
10
openssl genrsa -out myCA.key 2048
openssl req -x509 -new -key myCA.key -out myCA.cer -days 730 -subj /CN="My Custom CA"
openssl genrsa -out mycert1.key 2048
openssl req -new -out mycert1.req -key mycert1.key -subj /CN=www2.mysite.com
openssl x509 -req -in mycert1.req -out mycert1.cer -CAkey myCA.key -CA myCA.cer -days 365 -CAcreateserial -CAserial serial

www.mysite.com 可以是ip

  • 服务器使用mycert1.cer mycert1.key 创建https服务
  • 手机端下载安装myCA.cer