May 27, 2005

Rails

Filed under: Uncategorized — Jeff @ May 27, 2005 4:04 am

I’ve lately started playing with a web framework for Ruby called Rails. It’s not that I’m a huge fan of Ruby. I like Ruby. I learned it about 4 years ago sitting on a beach in Mexico. Ruby is a really cool language full of exciting features but I much prefer the feel of Python. Python just seems cleaner and more mature (to me).

Until recently I’ve been doing most of my web development as Python CGIs or using CherryPy. CherryPy is awesome and makes building web applications very very slick. I wouldn’t have even tried Rails except for the huge amount of press it’s been getting lately.

Installing rails on Debian took a bit of tinkering. I was able to use the Ruby Gems package management stuff but I didn’t like installing stuff without using APT. Finally I noticed rails does exist in Debian Unstable so I grabbed it from there.

I haven’t had much time to play with Rails yet but so far I am extremely impressed. It’s not as simple, fast or easy to install as CP2 but it’s very full featured. Like I read on another blog there is nothing in Rails that is revolutionary and can’t be done with Python. What makes Rails stand out is that it is a complete solution and all very consistent and well integrated. It handles the web server, business logic, layout separation very cleanly and it also includes a very slick object relational mapper that integrates nicely with everything.

So anyways I’ve been tinkering with it a bit on my Simply-Organized.org website and got a working contact manager type application up and running within a few hours of work. Rails literally generated most of the code for me. Most of the time was spent tweaking the layout files. It all just works and like the promotional material says…. No configuration files. Yay!

So far I’m really loving Rails. I can see this making a lot of the work I do on bigger applications almost trivial. I’ll still stick to my Python stuff for the little scripts because it’s easier and faster but this is very cool.

May 24, 2005

Weekend

Filed under: Uncategorized — Jeff @ May 24, 2005 8:43 pm

This weekend was pretty awesome!

On Friday evening we got together at Madison’s with Naomi, Tyson and Suman for dinner. It was all going well until Kailey pulled my nice big full glass of ice water over into my lap. Man was that cold! After dinner Naomi had to head out so Anji went home with Kailey and the guys headed over to Tyson’s to watch Blade 3. Talk about gratuitous violence!

Saturday morning we enlisted Doug’s help (and truck) to pick up a desk that Anji purchased in Cochrane. It’s particle board and REALLY heavy but it was cheap and looks OK. It’s probably something that will be relegated to the basement in the future but for now it’s better than nothing. Finally Anji has a place to do crafts and such.

Saturday afternoon we went to my parents place for tacos and a visit. We ended up having quite a nice time. Mom and Anji finished up some neck pillow dog things they were sewing and Dad and I looked around for his old slide projector. We found the projector, turned it on, and within about 5sec the bulb burned out. Luckily they still sell those 300W bulbs at London Drugs so with a 30min trip we were back to working again. Later that day I bought myself a carousel and loaded up my current slides.

Saturday evening was just a quiet evening at home. We ended up watching Bridget Jones 2 which was OK.

Sunday afternoon Mike had organized a picnic at Edworthy park with a bunch of friends from University, and some of their friends I had not met before. It was a beautiful day and great company. We mostly spent our time chasing after Kailey who wasn’t content just sitting around.

Sunday evening Pam, Ryan, Jon, Kevin, Steve and Tara came over and we had BBQ’d burgers and a caesar salad that Tara brought. After dinner we talked a bit, played some foosball, and then played some balderdash. I was having a really hard time coming up with any decent definitions so I pretty much resorted to making people laugh with definitions like “a type of laser vision common to evil sharks”. Others started making up some pretty funny definitions too (including some awesome ones by Anji). At the end of our normal game we thought it would be fun to try another game where we all come up with the funniest definitions we could and get points based on how much laughter follows. It was awesome. We totally gave up on scoring but it was hilarious watching the “basher” have to read these things. A really fun evening.

Monday (in Canada this weekend is a long weekend) we stayed around the house and cleaned up a bit. We picked some weeds, watered our grass more (and we actually have some grass now), worked on some shelving for the baby room, worked on my servers, and I built a brain massage thing copied from something my parents bought at the Stampede. The glue is still drying so maybe tonight I’ll finish it up and try it out. If it works I’ll post pictures. If it doesn’t I’ll erase all mention of this to prevent myself from looking incompetent.

Finally to top it all off we watch a Dragnet episode (The Big Trunk) before bed.

May 21, 2005

Complete Waste of Time :)

Filed under: Uncategorized — Jeff @ May 21, 2005 2:25 am

I was goofing around at lunch today and produced this python script that can take arbitrary binary data and encoded it as pixel data in a PNG file. Here is one of those images:

Anyone know what this is?

May 12, 2005

The Python Challenge

Filed under: Uncategorized — Jeff @ May 12, 2005 10:27 pm

Ok. It’s been years since I’ve really played a game but this morning I came across the Python Challenge which is a puzzle game that requires you to know a fair bit of Python. It’s really well done. The puzzles get progressively harder and are fun and let you use Python (which is also fun). I like. Much more interesting, and educational, than Doom N :) So far I’m at Level 7.

May 11, 2005

Score

Filed under: Uncategorized — Jeff @ May 11, 2005 10:17 pm

So my server “farm” is going to double in size tonight. I just picked up a P2-350 / 256M / 8G PC from the scrap-yard at work. It’s just a couple steps under my current VM server. I think this will become the new b.vm.bluesine.com. Sweet! Gotta love getting free computers.

Xen

Filed under: Uncategorized — Jeff @ May 11, 2005 8:25 pm

I’ve known about Xen for a while now and finally spent sometime yesterday playing with the demo CD at lunch and fell in love with it. Xen rocks! Xen is:

Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. Xen is Open Source software, released under the terms of the GNU General Public License.

I’ve been having problems with my lame UML admin tools (my fault) and also performance problems. Xen is supposed to be much faster (close to native performance they say) and the feature set and admin tools just look better. Some killer features include:

  • Ability run more than just Linux. It can run NetBSD, FreeBSD, Linux24, and Linux26
  • Ability to move running VMs from one machine to the other without down-time
  • Ability to juggle memory allocation on the fly (ie. shrink available memory to a VM while it’s running
  • Snapshot / Restore
  • Good admin tools and sample scripts cover things like: auto start/stop of domains on boot/halt, connecting to console of domains, …
  • Domains can by paused, destroyed, shutdown, rebooted, etc through the admin tools
  • Flexible CPU scheduling so you can ensure someone isn’t hogging all the resources

Xen itself sits up at the top layer of the system. Under Xen the first domain started (domain 0) is privledged in that it can talk to Xen and hardware. Domain 0 is essentially the user interface to Xen and is responsible for starting /stopping / creating other domains.

The package you get when you download Xen is awesome. It includes currentish 2.4 and 2.6 kernels all setup to be used by both domain-0 and the other domains. It also includes a bunch of CLI admin tools and even a fancy web based tool. The setup looks extremely simple especially if you can install the prereq’s using your package management tool and you don’t mind using binaries.

Anyways. To make a long story short I changed from using UML to XEN on a.vm.bluesine.com (my primary vm server) and it’s incredible! Way faster. Way more free memory. And way easier to setup. A really nice thing was that XEN and UML both can operate off single file disk images so I didn’t have to change much of anything in my virtual machines.

I brought the machine down last night for what I hoped would be maybe a couple hours of work. Unfortunately it dragged out to be much longer due to (1) old Debian installer CD and libtls, and (2) my stupid wireless router was failing. In the end it looks like I’ve got it up and running and it sure seems a lot faster. Yay!

I’ve got some of my own documentation on Xen including how I setup a Xen server on Debian.