Wednesday, December 28, 2016

Mac OS X: open apps from the shell

A few example aliases I use for opening URLs in web browsers and previewing images in Preview.app.

alias chrome="open -a google\ chrome"
alias firefox="open -a firefox"
alias safari="open -a safari"
alias preview="open -a preview"

Tuesday, December 27, 2016

Mac OS X: Enable and disable wifi from the shell

Enable and disable wifi from the shell in Max OS X.

networksetup -setairportpower en0 on
networksetup -setairportpower en0 off

Consider wrapping that in an alias in your .bash_profile or .profile.

alias wifion="networksetup -setairportpower en0 on"
alias wifioff="networksetup -setairportpower en0 off"

Wednesday, August 24, 2016

Edit remote file over scp with your local vim

Love this. On a lot of customer systems I do not have access to vim or at least not the level of access I prefer. Use your local vim and open the file over scp. Writing the file will upload the new file back to the server.

vim scp://user@myserver[:port]//path/to/file.txt

Unix - Linux StackExchange