Archive for the 'Computar' Category

Who needs a Computer Science degree?

Really, who needs it? Programmers don’t. To be a good programmer you need to understand how to construct a good algorithm, and some basics of data structures: what they are, and how to use them. You don’t need to be able to implement the ‘classic’ algorithms, as they’re almost always embedded in whatever language you’re using these days. You don’t even often need to know what data structure you’re using, as script languages like perl etc. will handle that for you. Taking a few CS courses can teach you these things, but so can reading a book or even just working on an Open Source project.

Systems administrators certainly don’t need it. Computer operators don’t need it. Even complex fields like security don’t need Computer Science—they need math.

What does a Computer Science degree give you? Primarily you get experience with some language or two that your school has chosen. Often that language is outdated (some schools still teach in Cobol). A good school will most likely train you in Java. Java is good, but what about the new wave of Ruby? How about next week’s language? Really, the targets move so fast, keeping up with them is almost impossible.

So, if anyone has a real use for Computer Science (aside from teaching it), let me know. I’d like to hear of it.

New iMac Upgrade

My employer just got me a new 20″ iMac to replace my old “flowerpot” (aka Pedestal) iMac. I have to say, I’m impressed with Apple’s migration tool.

All I had to do was turn on the new machine, turn off the old one, connect a firewire cable—luckily I had one of these laying around, if you don’t have one you’re out a good chunk of change—and turn on the old machine while holding down ‘t’ (for transfer, I assume). The new machine then took control of my old mac, searched through its guts, and pulled over all my files, settings, and applications. It took maybe 2 hours to copy over the whole 60 Gb or so (kinda slow..), but it worked!

When the new Mac was finished, I was presented with my old desktop, everything exactly like it was on my old Mac (except with a higher resolution). The whole process was so painless, in fact, that I felt the tinkerer in me let down, having expected to wrestle with configurations and the like. Really they should add some option in to let the geeks fight at least for a little while with some operating system facade, I needed more of a sense of reward.

Now with my new machine, I know it’s at least twice as fast and significantly more capable, but to me it feels just like the old Mac. I do get Front Row now, though, which is pretty neat. Joost will work now too, as they don’t release binaries for PowerPC chips.

I don’t think I’d ever expect myself to be upset with something being too easy, but there you go. Yay Apple? :)

Vista

Installed Vista today. The whole process wasn’t too bad, just took time. Had to convert from FAT32 to NTFS, of course :P. Ah well, at least the ntfs-3g drivers in linux are stable now. Took probably about 2 hours for the whole install. The most annoying part was the incessant false-starts due to ‘incompatible programs’—virus scanners, bluetooth drivers, and cd burning software. Oh and the fact that it overwrote my master boot record (killing grub), requiring me to re-run grub-install inside a chroot from a system rescue cd.

I haven’t had a chance to play with it yet, but it seems ok. Starts up quicker than XP, and as I accidentally found out, it hibernates very quickly and successfully. The win-tab window switching is cute I suppose, but rather unclear as to which window you’re on at the moment. Also, the Gadgets are ok, but I’d rather be able to choose to put them in the bottom right than the top right. And yes, it’s totally a rip off of OSX, except without the unixy goodness. All hail our evil overlords.

BTW, for those of you who may wonder why Mr. Linux has Vista, especially so early, it’s because I’m a web developer and have to stay on top of the latest developments in how Microsoft can break the intarweb. Woo.

Why Gentoo is a Great Server Distribution (a Rebuttal)

Some history: I’ve been using Linux since 1998, when a friend of mine showed me RedHat 5.0. I was instantly hooked, and over the years I’ve spent a lot of time using various flavors of Linux and other Open Source tools. For the past 6 years or so, it’s been my job to administer Linux systems. I’ve used various distributions for this task: RedHat, Fedora, Debian, and Gentoo.

When I read Why Gentoo Shouldn’t be on Your Server, I felt Gentoo was getting a bad rap. I’m currently using Gentoo on a number of production servers for a fairly heavily-used website. Gentoo has simplified my administration tasks greatly, and allowed me the flexibility I need to build the best possible set of systems to handle the job at hand.

Build Times
My current setup has 10 identical machines running Gentoo. One of them I’ve designated as my ‘build server.’ It handles the actual building of new packages, mitigating to a great deal the time spent updating software. My other 2 Gentoo-based machines have rather different configurations (one is even a sparc), so they have to build their own sets. All of these machines have been running Gentoo for over a year.

Building
For any build process, I’ve found screen to be indispensable. I’ll start up (or reconnect) a screen session, then start the emerge process. Usually I’ll add ‘nice -n19′ to the beginning of the command to minimize the impact of the build process. Every time I update, I ‘emerge -uDav world’. This allows me to review upcoming changes. The only reason I do this is to see if any php webapp updates are coming in - I need to handle the upgrades for those by hand still.

Updating Configuration Files
Once the build is done, etc-update lets me view the list of updates. I never bother reading through changes to init scripts (/etc/init.d/*), as I trust the distribution enough to handle those. In fact, I trust the distribution to do the right thing 90% of the time, and often I end up just entering ‘-5′ to let the update system auto-merge all the latest changes. This is what other distributions do most of the time behind your back, anyway.

It’s only for those few configuration files that I have changed where I need to take a look and handle things manually. For those, I’ll look at the diff first (it’s what comes up when you select the update). Most of the time here, I’ll see the update is trivial and either let it apply (’1′) or ignore it (’2′). Sometimes I’ll need to edit the two together - choosing bits and pieces from each to ensure the proper result is achieved. Here, etc-update uses a very intuitive merging tool (’3′). For each change, you can choose which version to use. The old file is on the left, the update is on the right. To use the left hand’s version, you just enter ‘l’. For the right’s version, ‘r’. Only about 1% of the time do I need to do something else, and then I’ll enter ‘ed’ to edit both versions together. All in all, this makes handling configuration updates very simple and ensures the distribution doesn’t do anything it shouldn’t behind your back.

Profile Updates
One of the previous article’s main gripes was about profile updates. Let’s reiterate: Gentoo is a source based distribution. In order to apply security updates, you need to have up-to-date dependencies. In order to have up-to-date dependencies, you need to have a capable base system. These profile updates ensure just that—that you have an updated base system. I’ve found profile updates to be painless. All I do is update the /etc/make.profile link, emerge -e system, then emerge -e world. Again, thanks to the use of nice and screen, I don’t even notice the compile time spent here. My non-build servers spend no time at all. I never have had to rebuild one of my machines from scratch. If I ever do, I’ll wonder what I did to break Gentoo’s well-designed build system.

Closing
In short, Gentoo is one of the most well thought out distributions I’ve ever used. The irony is that I don’t use it on my desktop! I use Ubuntu, mostly because I don’t need the flexibility Gentoo provides and I don’t want to use noticeable processor time building new packages.

Gentoo, through portage, provides a robust, friendly, and dependable build system. It is also important not to forget one of Gentoo’s driving philosophies: If you don’t need the package on your system, don’t install it. Use those USE flags to reduce the number of unneeded dependences! If you only build what you need, you will spend less time building. When you run ‘emerge -uD world’, you know that the updates you’re getting are updates you need. Unlike under most distributions, My servers run with a minimalist list of installed packages. This saves me headaches from security issues, and also decreases the disk footprint of the OS, allowing me to use that capacity for business needs instead.

I’ve occasionally questioned my use of Gentoo on my servers, but each time I come back to Portage. No other distribution lets me control with such a fine grain what goes on my system. No other distribution offers the wealth of packages Gentoo does. Other distributions might be easier to administer, day to day, but they do this by hiding from you things that I actually use. If it’s your job to administer servers, why not take the time to learn about what’s happening? You’ll end up being a lot less paranoid, and a much more capable admin. You’ll even end up saving yourself a lot of time.

The Saga of the Corrupt Registry

Saturday while Jen was preparing some wood boxes for painting, I was trying to see if I could get Bumble (Jen’s Windows 2000 based computer) to sleep or hibernate. My motive for this was due to all of the energy conservation literature I’ve been exposing myself to lately - I figured I could save power if I got Jen’s computer to quickly sleep while not in use. I quickly found out sleep mode wouldn’t work, but I figured Hibernate would be just fine. After enabling hibernate mode, I (seemingly) hibernated the computer with no problem. This was around 5pm.

When I turned Bumble back on, it started to boot just fine, but right about the time when you expect to see the GUI come up, it would reboot. If I let it, it would keep doing this startup/reboot loop forever. I tried booting into safe mode, but I experienced the same reboot loop problem. I had no idea what was going on at this point.. I thought maybe windows was reading something in the something in the hibernation file (hiberfil.sys) that it didn’t like and then rebooting. I thought if I could only remove that file, everything would work fine.

Luckily, I had ubuntu installed on another partition (dapper drake (6.06).. a little old, but still very useful). After fighting with the wireless card momentarily (using ndiswrapper and windows based tnet1130 drivers), I was able to browse the web and find that I needed the ntfs-3g driver to write to (or delete from) NTFS filesystems. I got the appropriate driver and setup everything, but the filesystem wouldn’t mount. The ntfs driver complained the filesystem was marked as crashed and told me I’d need to run windows’ chkdsk utility. Great, I don’t have windows accessible at the moment!

I searched around a bit for some operating environment that would let me run chkdsk and found BartPE. This is a great utility that basically builds a windows livecd using whatever current version of windows you have running. As I was running Linux on my laptop at the time, I rebooted into windows (good thing I keep XP around!) then created a BartPE disc.

Booting BartPE on Bumble was a little odd - it asks (scarily) to upgrade or install a new version of Windows XP, but pressing F10 (to select a new install) just starts up BartPE. I guess that’s what happens when you use a OEM version of Windows to build a BartPE disc.

Inside BartPE, I was presented with a strange ‘mini-windows’ The PE builder replaced Windows XP’s start menu and taskbar with something very stripped down. It seemed to work however, and provided me with a minimalist working environment. I was able to open a command line window and start chkdsk.

Chkdsk ran for about 2 or 3 hours doing a full filesystem scan. This was probably unnessecary, but I wanted to be sure there would be nothing left to blame on the drive. During this time I was able to eat the dinner Jen had been very graciously slaving over for hours (awesome beef/bean/stuff enchiladas!). Finally able to mount the ntfs partition in Ubuntu, I removed hiberfil.sys and rebooted. No dice. Damn!

After lots of searching, I found that having a corrupt registry could cause this reboot loop. Thanks to this post on google groups, I found old registry from feb 2005. This registry was so old it was basically useless, but it let me boot the computer at least! I then tried a variety of old and new registry file combinations until I found the corrupt file - of course the biggest and most important one, the software hive.

At this point I was able to boot into Windows 2000, but in a weird environment with user accounts but no settings or software registry. I tried to find registry recovery tools until around 1:30am. Among the various tools, I found Microsoft’s corrupt registry repair tool but I didn’t have the 6 floppies the tool required. I was so tired that I figured I’d get floppies in the morning at Staples, and went to bed.

Sunday morning, having made prior commitments, I went to spar briefly at 9 with some friends from Tae Kwon Do. We finished up around 10, but Staples was still closed. Cursing the gods of retail, I went home and did some more searching for corrupt registry repair tools.

Now that I’d had a chance to sleep, I quickly found RegDatXP. Its info page mentioned loading corrupt registry files in a newer version of windows (xp, vista). Apparently Microsoft realized the importance of registry files and built in corruption recovery systems to these later versions.

Feeling glad for once that I keep Windows XP on my laptop, I loaded the corrupt binary registry file in Windows XP’s regedit tool (file -> load hive). I assigned it to a temporary key under HKEY_LOCAL_MACHINE (tempKey). Regedit bitched that the file was corrupt, but loaded it anyway. I was able to open the temp key and see software entries. Huzzah! I first exported a .reg file, then unloaded the hive.

I copied the hive and .reg files back to Bumble, opened the repaired hive in regedt32 (on Bumble) and was able to browse the hive without trouble! I tried to import the hive into the live system, but (of course) it said I couldn’t. I then went back to Ubuntu and (after saving everything - can’t ever have too many backups!) replaced the operative software hive file with the repaired original hive (these files are in C:\WINNT\system32\config).

Finally, I booted Windows 2000 and everything worked fine! Yay! I didn’t have to buy any tools of questionable quality or content! I didn’t have to use 6 floppies (although that probably would’ve worked had I not had Windows XP sitting around as well). Huzzah!

Lesson learned: Don’t trust Microsoft when they say Hibernate works! In fact, don’t change any settings in a working Windows install, ever. Especially Windows versions older than XP (which has better recovery tools built in). Also, for good measure, Microsoft sucks! ;) Use Linux! ;) If Jen just used Ubuntu all the time, not only would she not be able to run half the software she uses daily, she would also not be subject to time wasting breakage like this :).

So, here’s the short fix if this happens to you:

  1. Get BartPE and run chkdsk to ensure your filesystem is intact.
  2. Backup your current registry hives (C:\WINNT\system32\config). Backup your backup hives too, just to be sure (C:\WINNT\repair\*.*)
  3. Figure out which combination of new and old registry files breaks your system.
  4. Copy the bad files to a working Windows 2003 or newer install.
  5. Load bad hives in regedit on the newer Windows.
  6. Unload now fixed hives, copy back to broken system.
  7. Place hives back in place while not booted into broken system.
  8. Go back to hatingenjoying your windows install!

Odds, Ends

ok so I was messing around the other day and finally got my webcam working in linux :) http://haven.loki.ws/joshcam/wc.html is the link.

Not alot new going on, still trying to decide about house(s). It’s been really hot and humid here the past few days, so that tends to stifle everything. Been reading Neal Stephenson’s Baroque Trilogy, which has been very good. Jen has become interested in deviantart.. check out her gallery, it’s got some really great stuff :) http://jmulcahy.deviantart.com
(mine is http://raynyskie.deviantart.com)

not much else going on I guess, at least nothing breathtakingly important to the rest of the world ;)

Hydra: Biotest’s New Setup

Let’s see.. what have I been up to?
Work has been hellish.. way too many problems with servers, then finally those get sorted out, and I have problems with the site in the new config. FINALLY got that sorted out (I think!, cross your fingers).. so I can take a breath.
I’ve got too much other stuff piling up.. need to get that taken care of. Then maybe I can relax for once and take a day to just veg or something.. I’m looking forward to it :)

I’m pretty excited about this new config for t-nation though. We’re using ultramonkey (which is a package based around the LVS project). It’s running on 10 of the super awesome rackable systems C1000 servers. Each of those is configured with 2 AMD Opteron 250s (64bit monsters!), 4Gb RAM, one 250Gb SATA drive, and dual gigabit ethernet. These are all plugged into two gigabit switches (from d-link). I’ve isolated cluster and LVS routing traffic to the internal network (eth1), leaving the external net for communicating back to the main apache server on titan. These are serving all of our (on average) 10-20k active sessions without breaking a sweat! load is rarely over .1! I did have to rewrite major portions of the code to handle such a large cluster efficiently, but the rewrite seems to be holding up well so far.
In the future I might move apache onto each cluster box too, depending on how much of a bottleneck it proves to be on titan. As for titan, now that he’s not running java, he seems to be very happy. He’s found his true calling as a mysql server.

Prelinking

I’m taking the plunge into the world of prelink. Kde seems to have become very unhappy, so I’m in windowmaker right now emerging kde 3.4 rc1. I wanted to play with it anyway, and hopefully recompiling all of kde (yeah it’ll take all night easy) will fix my prelink problems. Prelink does seem to have sped up everything at least :)

Beyond that, I found a plugin for gaim to grab what’s playing from xmms and insert it into text etc. I’m going to start using that in these posts, like so:
Bliss - http://fairlight.scene.org - - In Front of a Daydreamer

Blogging with Gaim

So I’ve had this plugin installed for awhile, but I haven’t used it before. I’m posting this using gaim’s blogger plugin. Gaim is awesome btw, you should check it out!

In other news, been busy with work alot. Just finally released the rewrite of the store for my company. It uses all kinds of dynamic classes and javascript on the client end for a rich user experience. It’s probably the most we could really do with our simple store. This way it’s also way more manageable. You can see it in action by putting something in the cart on T-Nation

Still house hunting. I’ll be happy when we’ve found something, but it might be awhile still. ah well.

silence is golden…

except when it’s in a blog, then it’s just boring.

Haven’t had much to write lately, or time to write for that matter. Work’s been keeping me very busy. Hopefully we’ll (finally) launch this new store soon! That and lots of little changes add up.

Gentoo is awesome! I’m using it full time now instead of Fedora. Partly because it’s stable (woo!) although not for the reason I thought - I think there’s a problem with my wireless card drivers and ndiswrapper and the fglrx stuff? anyway when I have all of them loaded stuff crashes. When I’m using my standard eth card, everything is fine. Who knows.
Besides that, portage is awesome ;D