I’m building a NAS and decided to use FreeNAS to deploy it (rather than buy a hardware solution). The installation instructions were easy enough though they didn’t include instructions on how to install FreeNAS onto a flash drive while running a Mac. I found a 512MB flash drive that was perfectly suitable for the install.
Note: The instructions below include terminal commands. The command is presented with an example of expected output.
- Download the latest release of FreeNAS from the downloads page. The version I downloaded was titled ‘FreeNAS-amd64-embedded-0.7.2.5543.img’. Make sure you get the .img file, not the .iso.
- Plug your flash drive into your computer and open a new terminal window.
- Using diskutil, find the device node for your flash drive:
mac:~ alex$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 499.8 GB disk0s2
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: CDROM *512.5 MB disk1
- The flash drive’s device node in the above output is /dev/disk1. Now, unmount the drive:
mac:~ alex$ diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
- Next, we’ll extract the image’s contents onto the flash drive. Warning: This will delete all of the data off of the drive.
mac:~ alex$ sudo dd if=~/Downloads/FreeNAS-amd64-embedded-0.7.2.5543.img of=/dev/disk1
203632+0 records in
203632+0 records out
104259584 bytes transferred in 66.608632 secs (1565256 bytes/sec)
- Lastly, eject the drive.
$ diskutil eject /dev/disk1
Disk /dev/disk1 ejected
Now you can use the flash drive to boot off of and run your FreeNAS instance from. Good times!
So I was looking for web servers to run on my MBP. I came across MAMP which looks like a pretty good piece of software. While downloading I became curious if the MAMP team actually used MAMP servers.
Checking the HTTP headers revealed the following:
Server: Apache/2.2.4 (Linux/SUSE)
I’ll take that as a No.
For the record, I use the LAMP stack for my sites. I am messing around with offline development and needed an environment.
I don’t know when someone would use this little snippet, but I think it’s useful.
It will open every directory in /home and retrieve the last modified file in all subdirectories under that directory. Then it will print out the file’s modification time and path. This might be useful for a system administrator who wants to see when the last time a user modified a file in their home directory.
for i in `find /home -maxdepth 1 -mindepth 1 -type d`; do
cd $i
find `pwd` -type f -printf "%TY-%Tm-%Td %TT %p\n" | sort | tail -n 1
done
To run it, save the code as ‘directory-age-check.sh’ and run:
sudo ./directory-age-check.sh | sort

I, like many other Minecrafters, have lots of wonderful ideas to share with the Minecraft community. Frequently, we share our ideas by starting Minecraft, building our idea and taking screenshots and videos. These images and videos are uploaded to imgur or youtube and the links are shared. I found this to be a bit of a hassle.
Thus, MineDraft was born. With MineDraft, you can create your ideas in a simple to use interface, create a link to the design and share it with your friends. No more video editing or image cropping. No need to upload anything. Just draft and share.
MineDraft.net
Check it out on Reddit too!
The Diaspora Team made available the first public release of the new Diaspora open source social networking platform. I spent a couple hours tonight installing and playing around with it. So far, it looks pretty good. It’s very usable though not without its bugs. Since it’s a developer release, bugs are expected, right?
More information is here: http://www.joindiaspora.com/2010/09/15/developer-release.html
While working on a snazzy new toy for Velocity, I needed a script to transform JSON to URL parameters. I found this clever method for doing it, but sadly, it wasn’t recursive, so it would only generate URL parameters for the first level of JSON elements.
I rewrote the function to recurse over all elements in the object tree and spit them out in a URL-safe string.
var JSON = {
params : function(a1){
var u=[];
for(x in a1){
if(a1[x] instanceof Array)
u.push(x+"="+encodeURI(a1[x].join(",")));
else if(a1[x] instanceof Object)
u.push(JSON.params(a1[x]));
else
u.push(x+"="+encodeURI(a1[x]));
}
return u.join("&");
}
};
var doc = {
"env":{
"platform":"linux",
"browser":"Firefox%2F3.5.8"
},
"query":{
"project":"user-tracking",
"fetch_time":"0"
},
"user":{
"locale":"en-US",
"cluster":""
},
"last_modified":"1270872812"
};