Fun with Sun Solaris 9
I know, I know... why am I using a proprietary Unix after singing the praises of Debian GNU/Linux and dumping Mac OS X? Why the heck not? I love tinkering and experimenting with stuff. Besides, it wasn't terribly difficult to get Linux working on my Sun Ultra 1 Creator.
So why bother with proprietary Sun hardware at all? Because it's CHEAP and loads of fun to tinker with. Since the dot com crash of 2000, there's a plethora of Sun hardware to be found at very reasonable prices. My Ultra 1 Creator listed for $27,000 when it first came out in 1996 but I got it for FREE on Craigslist.
Since I got this machine free off Craigslist, and it did come with all the Solaris media (and then some), I have tinkered with it in several ways. When I first brought it home and booted it up, it had the 64-bit version of Solaris 9 on it. I've never really cared for Solaris (some call it Slowaris) so the first inclination was to install FreeBSD. I got that installed without any problems, including X.org, etc... Yawn. Now on to Linux. My first inclination was to try Gentoo but I gave up on it since I couldn't get the kernel to compile no matter what I tried.
Next I looked around to see which other Linux distros support UltraSPARC hardware. Since I'm particularly fond of Debian, I naturally jumped in that direction. Getting the current stable (Etch at that time) Debian CD to boot turned out to be a major drag since it would continually freeze when trying to load the SCSI driver, a known bug in the installer. For kicks, I decided to see if a network boot would get me where I wanted to be. Sure enough, after setting up a RARP and TFTP server, the installer went flawlessly when using the Debian "Testing" image.
But even that got boring. So now I decided to get Solaris installed again. Not only that, I want to get the 64-bit kernel booting. It turns out this is more of a challenge than I thought.
To begin, I put the Solaris 9 installation CD in the drive and boot up. If you're wondering why I don't use Solaris 10, that's because it isn't supported on such old hardware. The first hiccup I run into is the screen warning me that a 64-bit OS is installed but that the installer will boot into the 32-bit SunOS kernel. Not a big problem. When I see the "Initializing Memory" screen, I hit Stop + A to drop to an Open Boot PROM screen. At the "ok>" screen, I type "boot cdrom kernel/sparcv9/unix" and hit enter. Sure enough, it boots the 64-bit kernel.
Now for the next hiccup. When the installer starts, you eventually wind up in a small xterm-ish console and it asks you if it can repartition the hard drive so it can place some temporary installer files on the hard disk. Most users of modern operating systems have come to expect that the OS will just ask you if it can erase what's already there and move on. Not so with Solaris. It will warn you that it can't partition enough space from the available free space on the drive. So now what?
I wound up bailing out of the installer with a Control + C and got dropped to a root prompt. Remembering another time I had to use a new disk in Solaris, I entered the format command to start that utility. I formatted the drive, gave it a label and rebooted. This time it worked. However, when I got to the section of the installer where you actually install the Solaris software, my CD drive starting acting up so I couldn't complete the install. I'll come back to it later I suppose. I guess free hardware comes with a price?
Installing the official Nvidia drivers on a Debian system
Since I'm doing the Linux thing, I'm going to start writing more informational articles describing handy tips that I feel are useful. If you read my last post, you'd know I'm now using a Debian GNU/Linux system that has an Nvidia video card.
Video has always been a bit of a sore spot in the Linux and Unix world. It wasn't until the late 1980's that Unix systems even had a graphical subsystem (XWindows, as it is still known). Even today, the hardest part of bringing up a useable Unix-based system is getting the video adapter to work with XWindows. Today, most systems use a fork called Xorg.
While it would seem that the only video card you can buy will either contain an Nvidia or ATI chip, that's not entirely true. It is interesting (at least to someone like me) that Nvidia graphics cards are more often seen on Linux-based systems and ATI-based cards are more often seen in the BSD world (Free/Net/Open). Probably just a coincidence, but when I read forum posts, that's what I tend to see. Since we're talking about Linux in this article, let's get down to the business of installing some accelerated drivers for our Nvidia-based card.
One of the first places to look is the Nvidia Driver Debian wiki. Per the wiki, there are two ways to install the driver. The first method is the Debian method, which, while it may be easier, it also may be lagging behind driver versions. I chose the second method, which involves downloading the driver binary from Nvidia's website and manually installing it. There are a few caveats, namely that it's possible to screw up the install, not work, or require a reinstall if you upgrade your kernel since the driver compiles a kernel module. I didn't run into any installation problems but I would imagine that I'd have some difficulties if I upgraded my kernel. Nothing terrible to worry about though.
One thing to note is that driver availability for older Nvidia cards (made before 2005) is probably non-existant. So while you can probably get by using the generic VESA driver, you probably will no longer be able to use the latest Nvidia driver and therefore the 3D acceleration. See this section on the Debian Nvidia wiki for more info.
First, download the driver from here: driver download. Do remember that this driver is a propriatary, closed source driver. If that offends you, you should probably stop here. My understanding is that there is an open source Nvidia driver on the way so if you don't need 3D acceleration (obviously you haven't tried Compiz Fusion), this article isn't for you. I'm willing to bit the bullet and install a non-free driver for the sake of fully utilizing my hardware and will certainly move to the open source version when it shows up.
Next, you'll want to download your kernel source. Actually, I got by just getting the header files. Open your favorite terminal and type 'sudo apt-get install linux-headers-2.6-686'. If you don't have the sudo program installed (and you SHOULD), just su to root and issue the apt-get command again without the sudo part. I'm assuming you're running a 2.6 kernel on 686 hardware. Most people should no longer be running an i386 kernel.
Now for the fun part. You might want to write this down or open this article on another machine. To install the driver, you need to fully exit your X session. No, you can't open a terminal session from GDM. I'm particularly lazy, so I just rebooted into single user mode. Either way, you need to completely get out of X and be at a root prompt. Change to the directory where you downloaded the driver and chmod it to 755 if needed. Now run it, ignoring the runlevel error. Accept the license. You may get an error about the version of GCC installed on your system not matching what was used to compile the kernel. Do NOT just ignore this. Exit the installer. In my case, GCC 4.1 was used to compile my kernel so I just did a '#apt-get install gcc-4.1'. Next, you'll want to export the location, so first do a 'which gcc-4.1'. In my case, I did a 'export CC=/usr/bin/gcc-4.1'. Now rerun the installer. You should be good to go from here. The installer will build a custom kernel module, back up and modify your X config, and tell you if things have completed successfully. If that's the case, exit the installer and reboot!
Once I was back up I did a test by running Doom3 and was happily surprised to see it come right up. I have to admit, it's nice to run a system with no proprietary drivers, but I can't complain that Nvidia is gracious enough to provide a driver. After all, they don't have to since the majority of their customers are on a Windows system and developing and testing a Linux driver takes resources from that. So I say kudos to Nvidia for making a solid driver that installs easily and just works!
The long goodbye…
As anyone who has known me knows, I'm definitely a Mac user. I've used Apple hardware on and off since the Apple II days. The first Mac I actually bought, however, was a G4 tower. Most of the time before that was spent hating Apple and suffering in a Windows world.
This went on until a good friend took the time to show me what his G3 could actually do. Of course, back then, Mac OS 8 was the de facto OS and Mac OS X was still a research project. I initially resisted but started liking what I saw enough to say "I want one!". It was then that I bought my first Macintosh, a 400 Mhz PowerPC G4 PowerMac. It came with 64 MB of RAM, an 2x AGP ATI video card with 16 MB of RAM and a whopping 20 GB hard drive. It also came with the venerable 400 MHz PowerPC 7400 (G4) processor with the AltiVec "Velocity Engine" vector processing unit and 1 MB of backside cache. This CPU smoked any Intel Pentium 3 at the time and was classified by the U.S. Government as a supercomputer since it was capable of at least a Gigaflop of performance. Another nifty component this machine has is a gigabit Ethernet interface. No other PC I can remember at that time (we're talking late 1999, early 2000) had that and most didn't have an Ethernet interface (56k was still the bomb-diggity). Needless to say, for $1599, this was a very nice Macintosh.
I endured many months of ridicule but really enjoyed my G4. One very interesting point was that the Playstation emulator, Connectix Virtual Game Station, actually ran Playstation games on my G4 faster than a Playstation! I continued to love my G4 until I decided it was time to go back to school.
At that point, I got my first Apple notebook, the Powerbook G4 Titanium 867. It basically had double the specs of the PowerMac. I wound up selling my PowerMac to a friend that needed a new machine which I thoroughly regret to this day. I had been running Mac OS X 10.0, then 10.1 on the PowerMac with Mac OS 9 "Classic" alongside it. The PowerBook came with Mac OS X 10.2 "Jaguar" and it was a rather large bump in speed from earlier releases as well as actually having software to use.
Shortly before graduation in 2004 I bought a shiny new PowerMac G5 (Dual 2.0) as well as a 23" Apple flat panel (graduation present to myself of course!). It had easily six to ten times the speed of my notebook and is what I currently still have. Not planning on selling it and making the same mistake twice!
Since that time, a subtle but continuous shift has been going on with the direction Apple has taken its business. Back when Mac OS X debuted, Apple was very gung-ho about it's core business: selling Macs. It also had a miniscule share of the overall PC market, so it was still playing catch up after the success of the iMac line. Development of new hardware and Mac OS X happened at a frenzied pace, as evidenced by all the announcements of cool new technology. This continued to happen until around 2006, when the iPod really started becoming a large part of Apple's revenue. Then the iPhone debuted in 2007. And there was the Apple TV. Suddenly, Apple is no longer a PC maker and is instead a consumer electronics maker. They even dropped "Computer" from their name.
I started noticing many changes to what were Apple's core business: Macs and Mac OS X. Now there's nothing but tie-ins to the iTunes store or some other non-PC product or service. New notebooks now have HDCP built in to appease Hollywood in its neverending quest to make water not wet. Everything Apple does surrounds the iPod line or the iPhone now. People say it's supposed to be a halo effect to get you to buy a Mac but I call bullshit on this one. If Apple can sell an iPhone to someone who just wants to make phone calls, they will. There's no indication at the AT&T store that you should also own a Macintosh to get the best experience. Apple is now the new Sony: a consumer electronics behemoth that does much, but nothing very well in particular. Their OS is now comparable to Windows: a tiny portion of it is engineered to get stuff done and the rest is engineered to get in your way and wrest control of your computer from you. And resist as I could, I just couldn't stay away. Until now.
For the past several months, I've been evaluating more than one Free/Open source operating system for use as a replacement. After lots of time spent on all three, I wound up settling on Debian GNU/Linux. Why? Because Debian is a very mature and actively developed distribution of Linux. I tried Ubuntu for a month and a half and it just feels like it's got more "stuff" than I need. I presume this is for handholding new Linux users. It would appear that I'm not the only one getting a little more than sick of the way Apple treats its power users. Two "A-list" bloggers (gawd I hate that word), Mark Pilgrim and Cory Doctorow, are also former Mac users and for very much the same reasons I am (only they did it 3 years ago).
I've used Linux plenty in the past, first installing Red Hat 5.1 on an old 486 back in the day and even managing to get X windows to bend to my will. Today's Linux distros are nothing like that. Everything just kind of works and the stuff that doesn't isn't so hard to fix. I would place the hardware support in Linux about where Windows 98 was: if it works, it works, but if not, prepare to get dirty. To that end, I built a pretty nice box:
* Intel Quad Core Q6600 CPU
* 2 GB PC-8500 DDR 2 RAM
* 1 TB Seagate SATA hard disk
* Nvidia GeForce 9500 GT video card with 1GB RAM
* Gigabyte EP45-DS3l motherboard
* Logitech wireless mouse, wired keyboard
* Repurposed LaCie Big Disk Extreme 500GB Firewire 800 drive
* PCI express Firewire 800 card
* Dual layer DVD burner
By today's standards, these specs are probably a mid-range Windows Vista machine. Yet, by running Debian, I get spectacular performance, no annoying product tie-ins, and best of all, my operating system does what I want and nothing more (yes, that's you, DRM). In layman's terms, this means I control my computer at all times instead of being forced to prop up an entire industry dedicated to preventing me from doing what I want with the stuff I've got. For those of you with entirely too much time (hey, you've made it this far), read here about what goes into ensuring you can't "pirate" content on Windows Vista.
As a parting note, it was nice to build a PC again after a 4 year hiatus. I got all that hardware for less than the cost of a Mac mini and it's certainly more capable. I was rather shocked at just how cheap and powerful PC hardware has become as of late. Since I didn't have to buy a PC and pay the Windows tax, I also saved more cash. And in these times, that's certaintly a good thing. Next time I'll post a list of what apps I'm using so any Linux enthusiasts out there can compare and contrast.
So long Apple, it was fun while you were a PC company.
Getting FreeBSD 7.0 running on an IBM Thinkpad T40
I've been experimenting with various operating systems on my Thinkpad and have been trying to get a Unix-like system on there. I've played with Ubuntu but the battery life is abysmal. I can get around 3 hours with Windows XP installed and barely half that with Ubuntu 8.10 installed.
Just for grins, I decided to see how difficult it would be to get FreeBSD 7.0 working on this machine. After I was done, I decided I'd share the knowledge:
Disable Firefox Prefetching
I love the Firefox web browser. Even more than Opera. However, Firefox tends to be a memory hog. The reason for this is that once you load a web page and begin viewing it, Firefox begins prefetching the pages that are linked to the page you're viewing. I can only assume that this is intended to make subsequent pages you click on load faster. This feature would have been great twelve years ago when everyone was on a 56Kbps dial-up modem but in today's world of multi-megabit broadband it really isn't needed.
One very undesirable effect prefetching has is to swell the amount of memory Firefox uses. Don't believe me? Load up four separate web pages in four tabs and leave them idling over the weekend. When you come back, don't be surprised if you see that the Firefox executable is using nearly 800 Megs of RAM. Yikes!
Even though you're probably reading this on a quad core Xeon with 4 Gigs of RAM, you may as well disable prefetching so you can put your memory to other use. To do this, first open a new tab or window. Next, in the location bar, type 'about:config' (without the quotes). This will bring up a list of internal Firefox preferences. You can tweak many aspects of the browser but we're interested in disabling prefetching. In the Filter field, type the word fetch. You should see a screen similar to the one below:
Simply double clicking the 'network.prefetch-next' value will set it to false (disable prefetching). Restart Firefox and look in amazement at how much less memory it consumes.
Now that it uses less memory, why not make it faster? Try this other tweak here.
How to block the obnoxious Apple January Software nag screen in iTunes 7.6 (Part 2)
Ok, so I finally got frustrated with the whole situation in my previous post and decided I would try to revert my firmware back to 1.1.1 (what the iPod Touch shipped with when I bought it). It was slightly tricky but not too difficult. In a nutshell, you will need:
* A Windows computer (can be 2000 or XP)
* iTunes 7.5
* The 1.1.1 firmware
* Nerves of steel
Just kidding about that last one. Seriously, I don't understand why you can't do this on a Mac, but whatever.
First, download iTunes 7.5 from here (link) and install it.
Next, download the 1.1.1 firmware from here (link) and put it in a safe spot.
Now, the fun part. Hope your iPod's data has been backed up. Connect your iPod to your Windows machine with the USB cable. iTunes will tell you it belongs to another library and that you will need to erase it if you want to sync it to this computer's library. Go ahead and do so. I think you can probably ignore the warning but I'm not sure if the iPod will show up in iTunes.
Once that's done, make sure you are on the iPod sync screen. Next, hold down both the home button and the power button at the same time. The home button is the round button at the bottom of the iPod and the power button is the small square button at the top. Once the iPod disappears from iTunes, release the power button but continue to hold the home button. A screen should appear saying you're in recovery mode. Bingo!
Now, hold the shift key on the keyboard and click the restore button on the iPod sync screen. You should now be able to select the firmware file you just downloaded. Select it and let iTunes restore the firmware. Now you're back in business! You can now re-jailbreak your iPod (if that's what you wanna do) or just bask in the glow of not having to see that annoying nag screen again. If you buy music from the iTunes store you will want to follow my previous post to undo the changes you made to your hosts file. Though, if you're as frustrated as I was, I doubt you'll want to anymore.
As an aside, I find it a bit saddening that Apple is becoming the new Microsoft. They really have changed into something I no longer like. I remember early this decade when Mac OS X first came out and it seemed as though Apple was the little guy who had finally had some legs to stand on. Now they just want to sell you overpriced hardware and could care less about treating you as a customer. I guess when you're winning you don't care who you walk all over. Lame.
Installing Dynamips and Dynagen on Ubuntu 7.10
I've been using Dynamips and Dynagen for a little while to practice for some Cisco tests and have to admit, they really help you get configuring routers in a flash. I decided to write up an article in case you're looking for a quick and easy way to do some Cisco labs.
The only downside is that you don't get exposure to real hardware but considering most network engineers are nowhere close to the equipment they're working most of the time, that isn't necessarily a bad thing. Check out the article here.
BSD is fun!
I've been experimenting with FreeBSD and OpenBSD lately and they're both quite enjoyable, especially coming from the GNU/Linux world. I'm especially fond of the ports collection. Ports is basically how you manage the software on the system and includes everything from web servers to desktop environments. It's similar to the APT or Yum utilities commonly used with Linux systems. The major difference is that instead of simply installing pre-built binaries, Ports compiles the source code. I won't argue for or against this method for performance improvements but it works for me even on a low end system. My favorite BSD feature by far is the PF firewall. PF is a firewall "for the rest of us". Very simple syntax yet very powerful. You could even block computers running that "other" OS from reaching your system.
FreeBSD has come a long way as has OpenBSD. I encourage you to check them both out, especially if Vista isn't the killer upgrade from XP that you thought it'd be...
Blocking third party cookies in Firefox 2.x
I've been a little hesitant to upgrade to Firefox 2.0 on my Mac since the option to block third party cookies was removed from the preferences pane. For those that don't know, third party cookies are cookies that come from sites you connect to other than the site you're browsing. For example, if you're browsing, say, Slashdot.org and advertisers on there send you cookies, that would be third party cookies. One of the biggest advertisers out there, DoubleClick, uses third party cookies to track your behavior. How you ask? Well, say you go from Slashdot (and they've already sent you a cookie) to another site like CNN. Now DoubleClick knows you've gone to both sites. What's worse is if individual pages within the site send you cookies. Now DoubleClick knows what you're reading. Knowing that, I'd say it's a good idea to block third party cookies.
Here's how it's done in Firefox 2. Open a new window or tab, then type 'about:config' in the address bar (without the quotes). In the filter bar, type 'network.cookie.cookieBehavior' (again, without the quotes). You should start seeing filter results as you type, but this is the name of the string you want to change. You've got three numeric options you can change it to:
0: All cookies are allowed. (Default)
1: Only cookies from the originating server are allowed.
2: No cookies are allowed.
3: Cookies are allowed based on the cookie P3P policy (Mozilla Suite only).
Obviously, option zero is the worst since allowing all cookies would allow third party cookies. Shame on the Mozilla team for making it the default! Option two would be nice, but it'd break many sites. Option three would work as long as you're using the full Mozilla suite (they still release it?). So option one is the one we want since it only allows cookies from the original (that is, first party) server. Double click the 'network.cookie.cookieBehavior' string and change the numeric value to 1. Click ok, then exit and re-open Firefox for the change to take effect. There, all better now!
MythTV 0.19 Released!
MythTV 0.19 Released!: "As most of you know, we at 2CPU.com are big fans of the Home Theatre PC. As such, we felt it necessary to let everyone know that MythTV 0.19 has been released! Changes include:"
(Via 2CPU.com.)
