Archive for category Geekiness

Oozy rat in a sanitary zoo

I stumbled across a website that was talking about the “magical number seven, plus or minus two“. The Wikipedia article that I link to has some great stuff. It’s really quite fascinating. I myself have found that I am able to really track 8 things at a time. If I’m stressed it seems to drop to 6. I use this quite a bit for making lists. Most lists I wish to make are short (less than 7 items) but I often wish to make them when I’m without a writing device (no PDA, pen and paper, etc.). So what I do is simply think out the list and make sure I firmly remember the number of items. Then, when I need to recall the list, I quickly think of the appropriate number (which is easy to remember) and the items tend to “fall out” of my memory quite easily. I have tried to track multiple lists and can succeed in juggling a few (although it’s unnecessary since I rarely have more than one list in my mind at a time).

Sometimes I wish I was autistic (since many of autistic people seem to have this cognitive numeric limit removed). It would be fun to track lists that contained hundreds or thousands of items.

Okay, well maybe not “fun” but useful.

Or I could just get a digital voice recorder.




So… Back on march 30th I posted an entry on my storage solution. I had built a computer and had added a basic RAID configuration to it:

I finally got my RAID solution in place. I went cheap and got two 500GB hard drives ($145 each) and a HighPoint RocketRAID 1740 RAID 0/1/5 4 channel SATA 3.0 GBps card ($110).

So… With this configuration I get 500GB of storage (430GB or so after formatting). This was great for a while. However, recently I realized I needed more. All of my personal “stuff” that’s somewhat irreplaceable doesn’t take up much room. Add my ripped CDs in and you get about 100GB. I have another 25-50GB of random things (disk images for linux installs, video rips (which I haven’t in the past kept for very long so I was okay with not backing them up)). So I wasn’t exactly out of room but I was using a fair bit. However, I also wanted to snag a relation’s (who will remain unnamed) music collection. It’s 499GB. That’s 272 days worth of music if played continuously. We follow a strict rule to ensure compliance with copyright law: we don’t tell anyone.


Anyway — I needed more storage so I picked up some hard drives from Fry’s online (why is their online store called “Outpost”? It makes no sense). They were cheap! $89 per 500GB drive. They came with free shipping and I shipped them to Virginia when I was there on travel to save on state sales tax. When I got back, I copied my existing data to a 500GB external drive, added the new drives, prayed a quick prayer that my system wouldn’t overheat and started it up. I reconfigured the RAID array from a 2 x 500GB RAID 1 array to a 4 X 500GB RAID 5 array. This gives me 1.5TB (1.4 TB or so formatted). It’s nice. I’ve loaded everything on there and since I have so much extra breathing room I’ve immediately started piling on stuff that I previously had kept on local hard drives. Here’s my usage currently:


It’s nice to have some room…

, , ,


Corolla vs. Prius

I recently did a cost comparison between the base price of a Corolla vs. the base price of Prius and trying to determine whether the gas savings alone make it worth it.

What I found is that if you assume $3.00/gallon (it obviously may go up a bit) and 15,000 miles per year, that the Corolla is still cheaper than the Prius after 10 years of use. I think there are tax advantages for the Prius, but I’m not sure of the details. Money now is worth more than money in the future so that helps justify the Corolla. Also, my guess is that Prius repair and maintenance costs more due to less standard parts and components.

Anyway, both my Dad and my Dad-in-Law have a Prius and I don’t. Can you say, “sour grapes”?


More PHP script…

I found this code useful recently to track statistically how many people are blocking javascript from executing on their system. It also acts as a basic logger for IPs and hostnames that are hitting your website…

$handling = fopen(”ips.html”, ‘a’);
$StringData = date(’Y.m.d H:i:s’).”,”.$_SERVER[’REMOTE_ADDR’].”,”.gethostbyaddr($_SERVER[’REMOTE_ADDR’]).”n”;
fwrite($handling, $StringData);

1 Comment


I have a spelling checker,
It came with my PC;
It plainly marks four my revue
Mistakes I cannot sea.
I’ve run this poem threw it,
I’m sure you’re please too no,
It’s letter perfect in it’s weight,
My checker tolled me sew.



Sunrise/sunset code?

It appears that the PHP bug has mysteriously righted itself? If so, great! If it’s still flipping between two different hours, oh well…

1 Comment

iTunes server on Gentoo?

The post says it all — I have all my music on Gentoo Linux but I would really like it if I could stream music onto the computers around the house using the iTunes interface. It’s easier than browsing files and it’s got nice built-in search features.

Lo-and-behold, you can do it! Thanks to Apple for making software that can actually be interfaced with! Also thanks for to the wonderful users of Gentoo who somehow find time to write HOWTO guides for practically everything. The details can be found here.

No Comments


So… I finally got my hard drives installed on my home server and now I just need to get my music collection into shape so I can actually play stuff. When I originally made copies of my CDs I converted them to FLAC. Why FLAC? Because I was being anal and didn’t want to “downgrade” my music to a measily 192kbps MP3 format. I know this is probably trivial, but if I retain the FLAC versions, it’s as if I have the original CD. Yes, I can’t tell the difference between 192kbps MP3 and the lossless FLAC, but the point is, if I ever want to convert all my music into AAC or (heaven’s forbid!) WMA format, I can do it fairly easily if I’m starting from a lossless format. If I start from the 192kbps MP3 I’ll start getting really degraded sounding stuff pretty quickly. So that’s my excuse.

How to accomplish this? In the past I’d used mpg321 to do the conversion but this time I used ffmpeg. I have all my CD collection in a directory on my system.

find "/var/mirror/Data/Audio/My CD Archive/" -name *.flac -exec /var/scripts/ {} \;

And /var/scripts/ contains:

ffmpeg -y -i "$1" -ab 192 "`echo "$1" | sed -e 's/.flac/.mp3/g'`"

This seems too much mess, but it appears to be working. The drawback? ffmpeg doesn’t seem to parse the “tag” information for each file so I’m ending up with “naked” MP3s (no ID3 tag). Not the end of the world. I’ll clean them up when I’m done.

The process is still chugging away — it’s completed about half of my collection.

Edit: I went ahead and figured out what I need to do to get the tags across. I installed the flac and id3 ebuilds and can now run the following script (using the same find command) to get the tags to match up from the flac files to the mp3 files.

OUTF=`echo "$1" | sed s/\.flac/.mp3/g`
ARTIST=`metaflac "$1" --show-tag=ARTIST | sed s/.*=//g`
TITLE=`metaflac "$1" --show-tag=TITLE | sed s/.*=//g`
ALBUM=`metaflac "$1" --show-tag=ALBUM | sed s/.*=//g`
GENRE=`metaflac "$1" --show-tag=GENRE | sed s/.*=//g`
TRACKNUMBER=`metaflac "$1" --show-tag=TRACKNUMBER | sed s/.*=//g`
id3 -t "$TITLE" -T "$TRACKNUMBER" -a "$ARTIST" -A "$ALBUM" -g "$GENRE" "$OUTF"

Thanks to this page for the info.


Some helpful SQL

I had needed this before and I had to go out and find it again so I figured I’d post it this time. Here’s a really helpful SQL script that will let you do a “search and replace” within a single column of data in a table. Very, very handy when you need to update inline links (which is what I’m doing in the example below). I had set the default location of where images are saved to a folder called “uploaded_images”. I later changed this to wp-content/images but the old posts still pointed to the old location even though the new posts pointed to the correct location. In order to make the old point to the new, I moved the files on the server and then ran the below script.

UPDATE `wp_posts`
SET post_content = REPLACE(post_content, "uploaded_images", "wp-content/images")
WHERE post_content LIKE "%uploaded_images%"

No Comments

A rather mean but funny quote

Some people are like Slinkys… Not really good for anything, but they still bring a smile to your face when you push them down a flight of stairs.

No Comments