If you ever got an error like „Error: -3924 Invalid PMK Failed to join network“ on OS X try to enclose the Wi-Fi Password in single quotes.
I use this script in a DeployStudio workflow for connecting to a default Wi-Fi Network without revealing the password to the user.
# Activate Wi-Fi on en1 and join SSID with password
networksetup -setairportpower en1 on
networksetup -setairportnetwork en1 SSID 'Password'
If you work behind a proxy and want to download software from the command line on OS X you will run into troubles. Fortunately there are options for proxy configuration
(Follow up to my article Installing PEAR on OS X Lion)
Curl has its own option to set a proxy even with authentication
Excerpt from man page:
curl -x, --proxy <[protocol://][user@password]proxyhost[:port]>
Example for non-authenticated proxy:
curl --proxy 192.168.1.2:8080 http://pear.php.net/go-pear.phar > go-pear.php
If you work with the fabulous InstaDMG for creating OS X images for deployment you can set an environment variable in your shell like this:
for bash, sh and related shells
for csh and related shells
setenv HTTP_PROXY 192.168.1.2:8080
or just add it to your .profile