Archive for September, 2009

Getting started with ZFS on Linux: starting the f’n thing

2009-09-27

I am running Ubuntu 08.10 (yeah, i know, waiting for 09-10) and just got a Rosewill RSV-S8 to replace my Drobo, and want to run ZFS on the disks in it, because ZFS is badass. I thought I had to run OpenSolaris or at least Nexenta (ubuntu on top of the solaris kernel, and yes, it’s real) but it turns out there’s a project called zfs-fuse which lets you run ZFS on Linux. FUSE is the “Filesystem in Userspace” project, which lets you run any filesystem as a regular system user. Fuse is necessary because ZFS licensing prohibits the GPL’d linux kernel from using its code, and normal linux filesystems need to be made a part of the kernel.

Now that the background is out of the way, I thought I’d start to pastedump the warnings I run into along the way, so that the greater googlenet may be able to search for them. (more…)

Obsessing over bike seats

2009-09-17

I think by now it’s common knowledge that bike seats can cause Erectile Dysfunction (henceforth “ED”) in men, or at least the pop-science mythology is prevalent enough. That “fact” was one of the reasons I was apprehensive about biking in the first place when I started to work in SF two years ago. My esteemed and highly bike-knowledgeable coworker Mark Palange laid my fears to rest by explaining that a seat won’t hurt you so long as you’re sitting on your ischial tuberosities and not your perineum (henceforth “sitbones” and “taint”). Otherwise you’re gonna be crushing nerves and blood vessels, doing nerve damage and greatly reducing bloodflow to your genitals (henceforth “junk”). So I got a bike and looked for seats…

(more…)

How to rename files in a directory to lowercase

2009-09-05

Ever want to take a massive tree of files and rename them all lowercase? (Ever work between case-sensitive and case-insensitive systems? :\) Here’s my first attempt:


find . -type f -and -not -type d -print0 | xargs -0 -n 1 echo | while read line; do target=$(echo $line | tr A-Z a-z); echo mv \"$line\" \"$target\"; done | less

which looks fine, until you realize that the path is made lowercase too, despite only looking at files. So I googled, and found a StackOverflow page: http://stackoverflow.com/questions/152514/how-to-rename-all-folders-and-files-to-lowercase-on-linux with this bit:


for SRC in `find my_root_dir -depth`
do
DST=`dirname "${SRC}"`/`basename "${SRC}" | tr '[A-Z]' '[a-z]'`
if [ "${SRC}" != "${DST}" ]
then
[ ! -e "${DST}" ] && mv -T "${SRC}" "${DST}" || echo "${SRC} was not renamed"
fi
done

which isn’t careful about spaces in the filename. But otherwise, it’s on to something with dirname and basename. Revisit mine!


find . -type f -and -not -type d -print0 | xargs -0 -n 1 echo | while read line; do target=$(basename "$line" | tr A-Z a-z); target=$(dirname "$line")/$target; mv "$line" "$target"; done