Saturday, January 10, 2009

Sharing all your music with Firefly Media Server

I have a cross-platform household. My wife and daughter use Windows, I use Windows for work and Ubuntu for meaningful things ;). I have a lot of music and audiobooks, mostly in mp3 format, but a few things in ogg, flac, and mp4. Everyone likes to listen to something, but how to share all the files? There are many solutions, of course, but the most convenient one for me was the one which allowed my wife to easily access the music with iTunes. The solution was the Firefly Media Server. Installing this under Ubuntu could hardly be simpler. From a command line, as root, type:
apt-get install mt-daapd ffmpeg
This will get you the software you need. After the packages are installed, edit the /etc/mt-daapd.conf file and change the location of your media files to wherever you keep them. After saving the file, issue
/etc/init.d/mt-daapd restart
I have occasionally found cases where Ubuntu starts services immediately after installing them. Restart means it will stop the process first, if there is an active one.

Wait a couple of minutes, for Firefly to scan your media files, and they should be accessible via DAAP. iTunes will discover the new server automatically, if the computer is on the same subnet as the server. I am told that Songbird works well with Firefly as well.

Friday, January 9, 2009

The Miseducation of the Negro

Brutus weighs in on the state vs. blacks:

"There is some discussion whether Officer Mehserle shouted racial slurs before he shot Mr. Grant. The racial dimension to the Grant shooting masks the true culprit of this crime. It is almost an incontrovertible fact that blacks and police are eternal enemies, but unfortunately blacks have misunderstood the nature of Leviathan. The elimination of racism in the police department would not end the violence and abuse police officers visit upon the public. This is because the State is a territorial monopolist of ultimate decision making. It is the ultimate judge in all cases on conflict including conflicts involving itself. Thus, it has an incentive to provoke conflict and judge the matter in its own favor."

Tuesday, December 30, 2008

The Incomparable Bugatti Veyron

Jeremy Clarkson on the most amazing supercar ever made, the Bugatti Veyron. A quote:

Happily, stopping distances become irrelevant because you won’t see the obstacle in the first place. By the time you know it was there, you’ll have gone through the windscreen, through the Pearly Gates and be halfway across God’s breakfast table.
Read and enjoy.

Wednesday, December 24, 2008

Dusty Springfield

One of the all-time classics, "The Look of Love."

Monday, December 8, 2008

Ubuntu Studio missing network manager

I recently install Ubuntu Studio 8.10 64 bit on a Dell Latitude D630. The wireless would not work, even after installing the restricted drives. The Network Manager icon did not appear in the gnome panel. After a bit of Googling, I found that ¨nm-applet" might not appear if the /etc/network/interfaces file has definitions for anything other than the lo interface. So, edit that file and remove the stanzas which refer to eth0, eth1, wlan0, ath0, etc. Now I see the normal network manager icon in the panel.

Monday, July 21, 2008

Cheap solid state router using Endian Firewall

I wanted to run Endian Firewall on compact flash, something which is not explicitly supported, apparently. I had 1.5GB of RAM, and Endian runs in 512 with no problem, so I figured I could use tmpfs to do /var and /tmp, helping prevent the card wearing out. I could not get Endian to install to a USB device, but a $12 CF-IDE adapter allowed me to install it on a 2GB flash card with no problem. It will disable swap automatically. You can either pop it out after you install, or you can boot off a Knoppix CD next so that you can make some modifications to your installation. If you are using the CF card via USB (I could not get Endian to install on a USB connected CF card, but I imagine I could get it to boot and run, once I installed it over IDE. After you perfect the installation, you can just dd the boot sector and each partition so that you can clone your install to new media), mount /dev/sdb3 to /mnt to access the root directory (/). Once you mount the / partition for editing, change the etc/fstab file on the CF card to read something like this:

/dev/hdb1 /boot ext3 nodev,nosuid,noatime 1 2
/dev/hdb3 / ext3 noatime 1 1
/dev/hdb4 /varperm ext3 noatime,mand 1 1
none /var tmpfs noatime,mand 0 0
none /tmp tmpfs defaults 0 0
none /home tmpfs defaults 0 0
none /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0

Note that I moved /var to /varperm and /home to /homeperm. You can mkdir those directories under your root partition which has been mounted to /mnt.
Next, edit the etc/rc.d/rc.sysinit file. Locate the line which reads

mount -a

Add three lines immediately below it:

######copy stuff to the tmpfs filesystems
/usr/bin/rsync -a /varperm/ /var/
/usr/bin/rsync -a /homeperm/ /home/

I also added /etc/cron.d/syncflash to /etc/rc.d/rc.halt, right after the "Shutting down" line at the top of the file so that I flush to flash whenever I shut down.

This will get the necessary directories and files on boot from the flash to RAM so that scripts start correctly. That's all which is actually required! You can (and probably should) add a cron job (under /etc/cron.{minutely|hourly|daily} to periodically rsync stuff from /var to /varperm to keep historical logs. This is in /etc/cron.d/syncflash on my system:

#!/bin/sh
/usr/bin/rsync -a /var/ /varperm/
/usr/bin/rsync -a /home/ /homeperm/

I'd probably exclude the gzipped stuff, myself, but that depends on the amount of space you have. Since tmpfs allocates half your RAM by default, we effectively have a 750MB combined /tmp and /var filesystem. This is plenty, really. We can even enable the proxy and ntop, so long as we set the limits to something reasonable. I may hack it further to keep longer logs on flash and continually flush tmpfs, but what I have works for now. I think this may be a really good solution for a dedicated router box, maybe using something like a Fit PC. Addendum: Fit PC does not have enough memory for this application. But an old laptop and a PC Card CF reader might do the trick. I also had to change the options from defaults in the /var line to enable mandatory locks. Havp would not start without this setting, which kept squid from working correctly.

Wednesday, June 11, 2008

Worst. NIC. Ever.

I bought a couple of 10/100/1000 Ethernet cards from Fry's. Unpacking them, I discovered they had the Realtek 8169 chipset. My prior experiences with Realtek have been excellent. They make good, low cost 10/100 Ethernet cards. They work well, if unspectacularly. The 8169 is a horse of a different color, however. I run Linux pretty much everywhere except on my laptops, which are either for work or shared with my wife. Generally, I don't have hardware compatibility issues with Linux, and I don't think there is a compatibility issue here. I think the 8169 just stinks on ice. The actual throughput for this dog is far less than a gigabit speed rating would have you believe. I never saw more than about 75Mb/s. "Well, I thought, I didn't pay any premium, so I still have a perfectly useful 100Mb Ethernet adapter, right?" Wrong. When I put the NIC on a busy system, like a firewall, it crawls. It slows down to less than 1Mb/s of useable throughput. This happens for both cards, so I can't blame a buggy unit. I advise people to stay away from this card. It would be better to stick with the 8139 10/100 card, which works wonderfully. Broadcom makes good gigabit nics, but Realtek really needs to go back to the drawing board.