A Bit About Me and Linux

Posted by Jason Sun, 16 Jul 2006 22:47:00 GMT

I cleaning out some old junk recently and found some of my old InfoMagic Linux CDs. It sparked some memories from my early days playing with Linux, and I figured it’d be fun to share.

My first experience with Linux was sometime in late 96 or early 97. I think I was in grade 9 at the time. My family’s main computer was a Pentium 2, our second PC. I had a friend who shared a name with someone who had developed a lot of network card drivers for Linux. This friend brought over a Walnut Creek Slackware CD set. We ran tried it out with a UMSDOS filesystem and booted it with a floppy disk. It worked, and I think we even got X running. It was totally foreign to me. ls? mv? cp? I was interested enough to buy a Walnut Creek CD set of my own…


The maple leaf is a reflection and not actually on the CD, in case you’re wondering. I wish I could remember what version my friend had me try. It could have been Slackware 96.

I caught the Linux bug when I was in high school. During computer classes, I started reading Slashdot, and that got me excited. (My Slashdot UID is 10414, BTW.) I was most interested in networking at the time. To get the learning started, I needed some reading material:

Discover Linux by Steve Oualline was my first Linux book, and I found it quite helpful. Amazon reviews do not seem to remember it fondly, but it was essential for me. Later on, Matt Welsh’s book filled in the rest of the gaps.

Dial-up networking was the first area where I had some memorable success. The first Grand Theft Auto game only had multiplayer support over TCP/IP. No modems. And our dial-up internet was not suitable for gaming. So I got my Linux machine to act as a dial-up server. It worked and it was playable, that’s all I could ask for. Did the same thing with Quake. I had the idea to make a little pseudo-BBS where local people could dial into my machine, share files, post messages, etc… Always-On broadband, among other technologies, eventually made this unnecessary though.

It definitely was more a hobby thing though. Never even thought of it as my primary desktop OS. It was all experimentation; very few installations lasted more than a couple months before being wiped out in a favour of an exciting new distribution. Whenever we travelled up to Edmonton, I’d head out to the Compusmart right near the Mayfield Inn to buy the latest InfoMagic Linux Developer’s Resource:

This was before broadband… When CD burners were more than $500. InfoMagic.com is now just placeholder.

A couple other times Linux has been the best tool for the job:
  • I bought an older computer from a friend. It had no video, so I through in a super old that I got for free. It didn’t work well with will Windows 95, but it Just Worked with Linux. I was able to run X at 640×480 with 16 colour. It was good enough to view some moon maps with Netscape. I had the binoculars setup on a tripod pointing out the window and the monitor on the other side.
  • Itwas certainly an advantage to be able to do all my assignments for my operating systems locally instead of remotely.
  • Working with vi in the console on your old 14 inch monitor is the only way to develop for the Atmel AVR… Unless you have a green screen.
  • An old Pentium running SmoothWall is infinitely better than the cheap router that previously used.

Now Linux is indispensable. It’s on my development machine at work and all of our servers. At home I use it for any of the cool stuff. (The boring stuff is best left for Mac OS X.) Couldn’t live without it.

And whaddaya know, I’m right back where I started, using Slackware.

5 comments | no trackbacks

Buildix

Posted by Jason Tue, 11 Jul 2006 03:13:00 GMT

ThoughtWorks recently unleashed Buildix. It’s a Linux distribution that gives you headstart on setting up a development server for your team. You get Subversion, Trac, and CruiseControl right out of the box.

I’m excited to try it out. It definitely scratches an itch I’ve had for a while. Last time I tried to install Trac, it was a bit of a trial in the dependency department.

Of course, the best part is these tools are integrated. Bug tracking and continuous builds are now in “easier than not doing it” territory.

4 comments | no trackbacks

"ITS NOT A JERSEY. ITS PAINTED ON WITH PERMANENT MARKER"

Posted by Jason Fri, 30 Jun 2006 14:50:00 GMT

Being a loyal fan of any sports team is not good for your heart. Every year, you’re pulling for your team to win it, and most years your team fails. Most of the time, failure is easy to live with. You can usually see it coming from miles away, even if you are supporting them the entire time. But the rewards of being a hardcore fan come when your team does something special.

If you don’t know, I am a hardcore Oilers fan. I was wearing either an Oilers jersey or an Oilers tshirt on gameday for most of the regular season and all of the playoffs. Beek is like a cartoon. homer alwys has white shirt sleeve shirt and blue pants, and beek always has oilers jersey. That’s tough for an antisocial person like me… I had to enter into some awkward conversations with strangers (because after you agree that the Oilers rule, what else do you say to some random doogs). I gave Oilers updates to my morning bus driver. I even got booed on the street once! You know I was in my basement watching all the regular season games on Sportsnet. You know if it weren’t Jay Dee’s death, the oil drop would still be my profile picture here on Xanga.

If you didn’t know, the Oilers went on an incredible Stanley Cup run this year. And like every hardcore Oiler fan, I let it consume me for the past two months. It wasn’t just the aforementioned apparel. There were superstitions. I know that superstitions amongst fans are highly illogical, but it gets me into the team that much more. It makes me think I’m contributing. Usually, I know that it’s all just worthless ritual. But I can’t lie, once the Oilers got to the Conference Finals, I started taking my superstitions very seriously. I was rocking the playoff beard. I had to have the volume of my TV set to 44 during the game. The bus stop I got off at mattered. I had to be wearing the correct jersey. If and what I ate during the game was important. I even stapled a shoelace to a bulletin board at work in the name of superstition! (NOTE: we beat Anaheim with that string stapled up there.)

Watching the series was pretty much standard fare. Yelling and groaning at the TV when something bad was happening. Feeling nervous or nauseous the whole time (especially with a two goal lead). Silently celebrating during the good times and pacing around during the bad. Laughing at Bob Cole’s and Harry Neale’s hilarious senility-induced mistakes. The only crazy thing was when I had my head in my pillow admitting defeat as the puck bounced off Roli’s blocker down to Samsonov to turn around the San Jose series.

Game Seven of the finals was different though. I had a bad feeling all day. I had some questions over which of my superstitions would yield a win, and I wasn’t sure if I was right. Non-experts weren’t expecting the Canes to bounce back, but Don Cherry predicted a Carolina win1. It just wasn’t adding up, and I could tell from the Oilers play in third that it wasn’t going to add up to a win. I kept hope up until the end, but it didn’t happen.

It was like a knife through the heart. There’s always heartbreak in sports, but this was a little different. When your team does something special, but still comes up short, it’s a million times more painful. If they had lost to Detroit, I would have been happy that we at least made it to the playoffs. If they had been swept by San Jose, then at least we beat Detroit. If we had lost Anaheim, then hey it was a good run. If we had been swept by Carolina, then it’s just some bad luck since we lost Roli – that’s hockey sometimes. But making the comeback to take it to Game Seven made us feel like a team of destiny. To lose that game and just come short of fullfilling that destiny was the most painful way to lose.

The ride was certainly fun. And in its own way, the low feeling caused by the loss is a reward of its own. The full feeling of being a hardcore fan includes the lows as the highs. But if I had the option of making the same run next year, I’d definitely say no. Coming this close to the Cup is still a failure, and I’d take a miniscule chance of winning over a guarantee of coming close.

Since failure is usually inevitable, us hardcore fans take some joy in smaller victories against our archrivals. So even though we lost it all, it was still a better Cup run than Calgary’s in 2004. Tougher odds, more comebacks, better games, better fans… You know it’s true. It’s loser talk, but we need something.

1 In a playoff game involving a Canadian team, if Don Cherry doesn’t make a prediction before the game, he’s predicting the Amercian team will win.

2007 YEAR OF THE OILERS

no comments | no trackbacks

OOPS!

Posted by Jason Fri, 16 Jun 2006 17:13:00 GMT

I fully intended on participating in Rails Day 2006, but registration closed last night. I had registered, but I didn’t register a team for myself, so I’m left out.

It sucks, but oh well. Some good did come from it… Got me to finally try out MySQL rather than my normal choice of Postgres, and it gave me some new ideas for a quick application I want to write. So this weekend, I may still participate in spirit. I just won’t be eligible for any prizes.

I don’t know how much I would have got done in that day anyway, seeing how game 6 of the Stanley Cup Finals is on anyway. LET’S GO OILERS!!!!

6 comments | no trackbacks

Don't Buy A Maxtor OneTouch II

Posted by Jason Sun, 28 May 2006 23:10:00 GMT

I bought a Maxtor OneTouch II from Yodabashi Camera in Akihabara while I was in Tokyo.

The drive worked great for more than a month. I soon made the stupid mistake of making it my only main place to store my data. Soon after, it seemed to die; it was recognized as a USB device, but not as a USB mass storage device and Firewire didn’t work at all. But whenever I turned it on, the hard drive seemed to be working fine. It made perfectly healthy hard drive noises, and it did not click at all.

Instead of screwing around with the warranty (which most likely would have resulted in the loss of my data), I decided to extract the drive and try it as an internal hard drive. And sure enough, it works. So it was just the enclosure that was defective. The moral of the story – buy the enclosure and the hard drive separately! And buy two – I was lucky that I didn’t lose any data, but next time I probably will. I plan on buying another enclosure and hard drive purely for backup.

A couple relevant links:
A review I found expressing the exact same problem I had
Taking apart a Maxtor OneTouch II

no comments | no trackbacks

AprilMay - Google Maps, Lighttpd, OILERS~!, Records

Posted by Jason Mon, 22 May 2006 21:30:00 GMT

It has been a while… But it is time for an update.

First and foremost, I have been playing the Google Maps API. This is my first real creation. My goal is to create an application for the creation/editing/viewing of similar presentations. It will be unfortunately similar to Wayfaring, but the whole animation thing is unique. Anyway, I’m starting work on that… Once I get into the Rails backend part, then I’ll hopefully get to implement my test recorder idea at the same time. But first things first, I’m starting to work on the editor first, which will be mostly Javascript.

Next, I’ve finally ditched my old Apache/FastCGI setup in favour of Lighttpd and Mongrel. The conversion thusfar has been quite easy. I was resisting the whole Lighty movement for the longest time because I wasn’t sure if it was configurable enough for me, particularly in the virtual hosts area. Well it turns out it’s more than good enough. I like the lighttpd.conf format too. And while I like FastCGI (and will continue to use it to power my forum), Mongrel is simply a better fit for a Rails application. I’ve still got a few loose ends to tie up in my Lighty/Mongrel configuration, but I really don’t see myself reverting back to Apache.

As you can see, I’ve reverted back to the default Azure theme for this blog… SublteSpeed just wasn’t working for me, so in the process of moving to Mongrel, I ditched it. I intend to change the design (as well as the design of my web site), but it’s a low priority.

Most importantly…

The Oil’s cup run is probably the greatest thing happening in the world right now. Not exaggerating. The only sad thing is that I’m not in Alberta to experience it. But it aint that bad… When I wear my Oilers jersey downtown I usually run into a couple vocal fans. And I’ve been booed a couple times, but that’s cool too.

I’ve been buying a lot of records. Garage sales, antique warehouses, and record stores. Here’s just the latest garage sale haul:

Finally

4 comments | no trackbacks

Rails Integration Testing Idea

Posted by Jason Tue, 21 Mar 2006 05:19:00 GMT

If you haven’t heard about it yet, read up the new (unfortunately named) integration testing framework being developed for Rails 1.1.

An example jamis mentions is a situation where bugs are caused by cruft building up in the session when visiting a number of pages. The integration testing framework definitely allows you to build the test once you can reproduce the bug, but reproducing is still a problem. Something I’ve faced in (non-Rails) webapps is that developers aren’t able to reproduce a bug while users can do it every time. It happens because users may use your application in different ways than developers do. (It happens, unfortunately.)

The idea is simple: let users record integration tests. My immediate vision for this feature goes like this:
  • Developer starts WEBrick (or lighty) with recording enabled
  • User goes in and reproduces their bug… All their steps are recorded.
  • Once the user is done, the developers now have a failing Rails integration test that reproduces the bug.

Of course, I have bigger visions for this too. Like a complete user acceptance testing framework. But that all depends on the recording/generation of acceptance tests to work. The main issue I see with the generation of integration tests is whether or not the generated test will be maintainable. I don’t mind if the developer will have to clean up some of the test before checking it in – I think that’s a must for any passive code generator. I’m more concerned about tests requiring more maintenance as the application changes. But I think it’s best just to try and see how it works out.

Now I just have to turn this idea into a plugin/patch. I’m not always successful in this respect, but I must try my best. After I’ve cleaned up all my stuff from the Japan trip.

1 comment | no trackbacks

Pictures From Japan

Posted by Jason Tue, 21 Mar 2006 03:25:00 GMT

Japan trip pictures

It was a great trip, and it was great to see my bro again.

Plus it was cool to see the Oilers pick up Dwayne Roloson and Sergei Samsonov in my absence.

I guess I must eventually choose a new theme that would make it reasonable to add my Flickr photostream.

no comments | no trackbacks

USB Drives with Slackware and Hotplug

Posted by Jason Mon, 20 Mar 2006 17:41:00 GMT

I finally found a workable solution to my biggest Slackware annoyance. And since it was one of those things that wasn’t immediately available on Google, I figured it would be a service to others to blog about it.

My problem was with USB storage. I could plug in my flash drive or external hard drive in and it would all work; the device would get assigned to /dev/sdX. But it wouldn’t work if I unplugged the device and plugged it back in later. I had to reboot to get that USB device to work again. After rebooting, it was the same One And Done situation.

When first plugging in the device, I would get something like this in /var/log/messages:


Mar 20 22:01:29 crane kernel: hub.c: new USB device 00:10.4-1, assigned address 3
Mar 20 22:01:29 crane kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Mar 20 22:01:29 crane kernel:  sdb: sdb1

After unplugging the device and plugging it back in, the relevant entries in the messages file would look like this:


Mar 20 21:57:07 crane kernel: hub.c: new USB device 00:10.4-1, assigned address 4

The device would show up as you’d expect in the output of lsusb in both cases, but the SCSI emulation system doesn’t to pick up the drive when it gets plugged in for the second time.

The workaround turned out to be pretty simple. Every time I need to plug in one of my USB drives, I run this command as root: /etc/rc.d/rc.hotplug restart

Then everything’s good to go.

Since you need root/sudo access to do this, it’s not really a great solution. But it’s good enough for me. The real solution likely requires kernel updates, and I don’t have the same desire to upgrade my kernel like I did back in the day :)

no comments | no trackbacks

phpBB and Postgres Performance, AWStats & logrotate

Posted by Jason Tue, 28 Feb 2006 06:13:00 GMT

It’s been a fun little webmaster week for me as I’ve solved two of the nagging issues I’ve had with the site.

I host a message board here, and after a couple months of use, performance was terrible. Watching top on any request would show the bottleneck was obviously Postgres. Although I didn’t think to try doing an EXPLAIN on any of the queries phpBB uses, I did eventually try doing a vacuum on the database, and it worked well. The speed wasn’t great, but it was usable. Well, just this week I tried doing a full vacuum and it gave another great speed boost. So now the forum performs at the level you’d expect, as long as the load on the Linode is at a reasonable level. All it took was one entry in crontab:

0 4 * * * vacuumdb --full --all --verbose --analyze

It may seem like overkill to do a full vacuum everyday, but I figure it’s worth it. With sites like this blog where content is cached, a full vacuum won’t affect viewing. And for a site the forum, it’s worth it for the site to inaccessible for a few minutes during a dead hour if it keeps the site snappy during peak hours.

The interesting thing was the possible causes of the slowdown. It seems that a few indexes would get really crufty though normal phpBB uses. When the vacuum was performed hundreds of index rows would be removed, and this was on the forums table! Considering the forums table has less than 10 rows, it’s possible that dropping that index might give a speed boost. But at the same time, I know Postgres uses MVCC, and that mean every update creates a new row. Since that forums table gets updated on every post, that probably results in hundreds of rows in the forums table.

Since I don’t really know exactly what the problem is, this would be an interesting experiment:
  • Create a script (preferably with a load testing tool like JMeter) that hits a phpBB instance like so – hit the front page, log in, view a forum, post a message, post 10 replies, log out
  • Run it a thousand times or so, and see how performance degrades
  • Start again, but this time drop one of the indexes that gets a lot of action during a vacuum.
  • Run it again the same number of times and see if the performance degradation is worse or better.
  • Repeat for other suspect indexes.
  • Repeat the experiment, with all the original indexes, but this time, pause the test after 100 runs, run a vacuum, then resume the test.

I would do it, but the full vacuum is a working, automated solution for the time being. If the forum’s database gets too big, it may be worth trying.

The other thing I did this week was I got my Apache log files under the control of logrotate, and the analysis of those logs under the control of AWStats. At first I followed the AWStats documentation and set up AWStats as a CGI program. Got that working, but I wasn’t happy with it because it was a little slow, and I’ve had some automated attacks on AWStats hit me before. (I was fairly safe against them – I’d put it on it’s own virtual host and password protected it.) So instead, I changed it to generate static reports whenever my logs are rotated. It works great. It’s secure, accessing the reports is fast, and I don’t need real time reports or the other features that CGI gives you.

So here’s how I did it… This is the relevant logrotate entry:


/var/log/www/*.log {
  missingok
  daily
  notifempty
  # /var/log/www is NOT world readable, but /var/log/www_old is, so
  # awstats will always be looking at /var/log/www_old/HOSTNAME_access.log.1
  olddir /var/log/www_old
  sharedscripts
  postrotate
        /bin/kill -HUP `cat /opt/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true; su - awstats -l -c 'awstats-update.sh' > /dev/null 2>&1
  endscript
}

And here’s the awstats-update.sh script that gets called after the logs are rotated:


#!/bin/sh

STATS_PAGE="/var/www/awstats/stats/index.html" 
echo "<html><body><ul>" > $STATS_PAGE

for AWSTATS_CONF in `find /etc/awstats/ -type f | perl -e 'while ( <STDIN> ) { chomp; my ( $config ) = ( m|/etc/awstats/awstats\.(.*)\.conf$| ); print "$config\n"; }'`; do
  awstats_buildstaticpages.pl -config=${AWSTATS_CONF} -update -awstatsprog=$HOME/bin/awstats/awstats.pl -dir=/var/www/awstats/stats
  echo "<li><a href=\"awstats.${AWSTATS_CONF}.html\">${AWSTATS_CONF}</a></li>" >> $STATS_PAGE
done

echo "</ul></body></html>" >> $STATS_PAGE

Done deal. It creates a little index page for easy navigation. If I add new virtual hosts, I just add the awstats configuration file in /etc/awstats and the script picks it up.

Tomorrow I am off to Japan to see my brother. VERY EXCITED.

3 comments | no trackbacks

Older posts: 1 2