Google analytics code

Wednesday, February 13, 2008

PHP: Code snippet

I found this on a page written in japanese. Great for streaming files through php and not reveling their source.

header('Content-Type: application/octet-stream');
header('Content-Length: '.filesize(''));
echo file_get_contents("");

This will also post the size of the file so you know how long it will take for it to download.

Friday, February 8, 2008

Apple / OSX : Updating the hosts file

I'm in the process of migrating from a PC at work to a new iMac. There are a few servers with names that don't resolve properly. These were stored in the hosts file on windows.

On OSX it's stored in

The file is read only so you'll want to open it with sudo before bringing it into vim, or however you plan to do it with a GUI editor.