Sunday, August 29, 2010

Using Perl CPAN on Mac OSX

Some of my notes on CPAN usage in Snow Leopard:

  • CPAN comes preinstalled in Snow Leopard. No new install needed and in fact not recommended unless something is broken or you know what you are doing.
  • Always login into CPAN via sudo or root (sudo is the recommended option): sudo perl -MCPAN -e "shell"
  • Its recommended to set FTP into passive mode so as to avoid having any troubles due to CPAN not being able to download from repositories via ftp. Create a file ~/.bash_login and add this to it: export FTP_PASSIVE=1
  • You can install any CPAN modules like this (here I am installing XMLWriter module) from CPAN prompt:install XML::Writer

Tuesday, August 17, 2010

Adding resume support to iPhone SDK downloads

Checklist on how to enable resume in Apple downloads

1) Download and install Firefox (if it isn't already installed)

2) Download and install Firefox add-on "Cookie Exporter" 1.5 or higher from here:

3) Goto Prefernces->Privacy and clean up all cookies

4)Login to your account at iPhone developer account at (using Firefox with cookie exporter add-on already installed) and start the SDK download. Then cancel the download (yes, start the download and after it has started downloaded, cancel it). Also copy the download link.

5) Export the cookies via the installed add-on. Choose any file name for exported cookes, the default cookies.txt worked fine for me.

6)On terminal, type this (please note, I am limiting the bandwidth used to 10kBps. You can either drop the whole --limit-rate option and it will take up entire available bandwidth or choose some other bandwidth per your suitability.) :

wget --limit-rate=10k --tries=inf --server-response --continue --load-cookies cookies.txt

If it still complains about not being able to authenticate, use --no-check-certificate option as below

wget --limit-rate=10k --tries=inf --server-response --continue --load-cookies cookies.txt --no-check-certificate

If it still does not work, well its time to get a coconut or make a pilgrimage to Tirupati…. keep the Big Bro happy :)