Today I had a need to install a new version of python
on a Mac via ssh. Just like using graphical installers
on OS X, installing from the command line is remarkably easy.
(I think it’s even easier. I’ll be rocking the command line
even more now!)
You’ll typically pull down a dmg with the software you want to
install. In this case, I downloaded Python 2.6.4 using curl:
curl -o python2.6.4.dmg \
http://www.python.org/ftp/python/2.6.4/python-2.6.4_macosx10.3.dmg
Now, I can mount the disk image:
hdid python2.6.4.dmg
hdid can also mount disk images over http if you want to combine
those two steps:
hdid http://www.python.org/ftp/python/2.6.4/python-2.6.4_macosx10.3.dmg
With the disk image mounted, you can now rock the install using installer:
sudo installer -pkg /Volumes/Python\ 2.6.4/Python.mpkg -target /
Check out the installer man page for more information.
Rock the command line!
I get a lot of work done by living at the command line. If I can save a few mouse clicks by running something from the command line, I’m going to do it. We use quite a bit of Remote Desktop at work to jump around to various windows boxes. On the Mac, I’ve been using CoRD. I noticed that it had a neat feature for forwarding disks to the remote machine. (I later found out that other RDP clients support this as well. So, it’s not a CoRD thing — I just noticed it there first.) I’m working a lot under OpenSolaris 2008.05 now and I don’t have CoRD there. I do have the command line!!! Here’s the command to rock if you’re on a box with rdesktop and you want to forward a folder over to the remote machine for easy access:
rdesktop -xm -r disk:home=/export/home/corbin \
-g800x600 remotewindowsbox.yourdomain.com &
The -r switch is the portion of interest here. This allows you to tell rdesktop to make /export/home/corbin (or some other local folder on your machine) available for access on the remote machine under the name of ‘home.’ This can be pretty handy if you’re jumping from machine to machine and need an easy way to move files around while you’re there.