Monday, July 23, 2007

There go my nines

I'm pretty sure no one noticed, but my server was down for quite some time this weekend...

Short Version:
BeforeAfter
Linux Server
  • Pentium III 600Mgz
  • 256Meg Ram
  • Beige Dell Box on a shelf
Windows Server
  • AMD Athlon 1Ghz
  • 512 Meg ram
  • Sweet 4U rack mount case
  • Running Security Cam Software
Linux Server
  • AMD Athlon 1Ghz
  • 512 Meg ram
  • Sweet 4U rack mount case
  • Running webserver, email, Security cam Software, stuff
Long Version:
But I think it's back up for a while now and it's better than ever!
Someone at work was selling an old Motherboard, processor, 0.5Gig memory and a fancy graphics card for cheap, so I made a low offer, told them I hoped they got a more reasonable offer and then ended up 'winning' it. It was caked in some horrible brown gunk which I suspect was due to someone smoking in the house. I powered down my server (a really old dell Pentium 3 600Mhz), threw in the new motherboard and powered it up. I had heard about dell power supplies being wired weird but thought my system predated that silliness. It turns out it didn't. So now I needed a new case and power supply (of course a standard power supply wouldn't fit in a dell case!). I figured I should finally do it right and get a rack mount so the computer could actually fit in the 17" rack I have in my AV closet (where my current server just sits on a shelf like a dork). Boy those things are expensive I was looking at paying over $150 for a not particularly nice one that was likely going to be a total hassle (getting cards to fit in it) since I didn't have room for another 4U case in the rack. You see I already have a 4U server in the rack, it was my old home theater PC and has since been re purposed to run the security software than records my security cameras. This machine had been down for a little while ever since I needed a windows PC to fix the dead disk in my TiVo. A TiVo backup that was too old to update itself caused me to have to buy instant cake which I begrudgingly did, but it ended up working so well I should have done that right from the start, I did feel like a failed TiVo hacker for not being able to do it myself though. But since the machine was down and out, I plonked the new board on top, hooked up the ATX power supply and booted it up and sure enough it worked fine. Even better the fancy graphics card sent signal to the DVI connector from the start s I could set bios settings with it connected to my apple display (DVI only) in the den. Before that I'd have to lug my machine into the bedroom, balance it on a wooden stand and connect it to the LCD TV in there (the only display in the house to accept VGA input!). I emailed who I bought the motherboard from and told them it worked fine. I decided to setup my new server in parallel with my old one (minimum downtime!) and installed ubuntu on a 200 gig drive I had, I couldn't get the damn thing to boot, I tried everything, other drives, swapping master/slave, all sorts of bios jiggery pokery, nothing worked, also the bios power on cycle took a really long time which made it more frustrating. In the end I gave up, emailed the seller with the bad news and fortunately they agreed to take it back. I still had the idea of putting my linux server in a rack case, and it always bothered me that I ran a windows server at home, The only reason I ran it was because I had convinced myself no Linux drivers could possibly exist for my 4 input video capture card. A quick Google search and I was proved wrong, quickly negating the need for a windows server, I started moving the drives over to my 4U case and they kept having disk errors so I reinstalled Ubuntu on a spare 200 gig drive and got ssh working and then started copying over all the files I'd need to get my server back up and running. Finally it's all working great! I like the new security software since it's free and open source and I can tweak it if I need to. I really like that I have one less sever and a windows one at that, so my AV Closet is much tidier now!

Everything feels right about this.

Here's the Ubuntu packages I had to install to make it usable for me:

apache2 ssh libapache2-mod-python2.4 php5 libapache2-mod-perl2 bind9 mailman screen tkdiff xauth mailx screen xlogo cvs python-cheetah python-mysqldb pychecker

TODO(ark) find xv somewhere

Here's the configuration files I had to copy over, I really should make sure these are backed up:
  • /etc/apt/sources.list
  • /etc/apache2
  • /etc/bind
  • /etc/postfix
  • /etc/init.d/postfix
  • /etc/mailman
  • /var/lib/mailman
  • /usr/lib/mailman

Saturday, July 14, 2007

Public Google Bookmarks Feeds

I used to use del.icio.us for my bookmarks. There were two things I really liked about it, private bookmarks and public bookmark feeds. There were many things I didn't like about it, it was slow, foxylicious was kinda funky to show my bookmarks in my browser and adding bookmarks was really slow as the browser popped up a whole new window and it was a little too public. Plus I always, always had to pause and think really hard about where to add those damn periods when I was typing in the url. However the public feeds were great, I could subscribe to them in Google Reader and then embed them on my web pages and even do some simple jiggery pokery so they'd look just like regular lists and just like part of my template. That was the "Recent Links" you'd see on the side, go ahead and look, it's back now and that's really the point of this post....

When Google Toolbar started to integrate Google Bookmarks I decided to make the switch. I used Mihai's script to move over all my del.icio.us bookmarks. It was going great, I was easily adding bookmarks by clicking on the star in my toolbar (I really only use toolbar for that now and the very fancy 'UP' button (a feature so trivial it never seems to get mentioned on any google toolbar pages)). However I forgot all about my links feeds for my guests! They were going stale for over a year, eventually I just removed that section from my website but I missed it and wanted it back. Google Bookmarks have rss feeds, but they're protected behind some authentication. I finally worked out how to authenticate to Google Services (without sending my google password over basic auth (sheesh!)), You need to get an SID cookie value and then pass that in with future requests. The GData API provided something that was pretty close to what I wanted, and I finally hacked something together. It runs every hour and gets feeds and html for some queries. I implemented private bookmarks by having a label called _private that I remove from all results.

It also runs as a monitor every day from a crontab to make sure it's still running.

bookmarks.py and .bookmarksrc

Hope you find it useful.