Xaero.org Tech news, reviews, and whatever else I wanna put here!

8Feb/091

Installing Handbrake on Debian GNU/Linux

I don't actually watch that many movies but occasionally I want to back them up or convert them to a more convenient format. To date, I've been using the excellent Handbrake utility on my PowerMac G5 for my video conversion needs. Since I waved goodbye, I now needed at least the same functionality on my Linux machine. Fortunately, Handbrake is open source and under GPL license so it also has a GTK-based Linux equivalent. To get it installed, you'll need to edit your apt sources and add the following:

#Handbrake
deb http://www.debian-multimedia.org sid main

You'll notice I specifically used the "sid" release. There is no "stable" prepackaged binary for Handbrake yet unless you're on Ubuntu, so you have to specify sid. It works regardless so not to worry. With that line added, save the file and install:

$sudo apt-get update
$sudo apt-get install handbrake-gtk

It should install the requisite binaries without a hitch and add Handbrake to your menu under "Multimedia" if you're using Gnome or XFCE (I don't use KDE so I couldn't tell ya). Here's a screenshot from my machine for the ever-curious (click on the image to enlarge it):

Enjoy!

18Jan/090

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!

13May/081

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:


Picture of prefetch preference

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.

12Apr/080

How to connect to the IPv6 Internet

Wrote up a new article on how to connect your home router to the IPv6 Internet. Have fun visiting all 10 IPv6-enabled websites ; ) Check it out here - article.

13Mar/080

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.

10Mar/080

How to block the obnoxious Apple January Software nag screen in iTunes 7.6

Looks like Apple is turning into the IRS. Now they're nickel and dimeing you after your purchase. As if their users don't pay enough for pretty hardware that does the same thing as a beige box PC... Ok, seriously Apple, why the need to annoy the shit out of your users by nagging them to buy software for the iPod touch that comes free with the iPhone? OK, I'm done complaining (for now).

I'm usually hesitant to upgrade the software on my iPods since they rarely add new features and are more commonly used to clamp down on users (see the iPhone bricking debacle) or refresh DRM but I thought the 1.1.4 update might be worth it. So lo and behold, I plug my 16 Gig iPod touch in, hit the upgrade software button and let it do it's thing. Afterwards I expect to just have to resync all my content back to it but what am I greeted with? A nag screen telling me to buy a bunch of crap software I don't even want. I gave myself a day to cool off before figuring out how to block this since the only options are to "Take me to the iTunes store" or "Remind me later". So much for choice when it comes to Apple, huh?

Here's a quick and dirty way to block this annoyance. Be warned though, that it will likely block some or all of your access to the iTunes store, but you don't really buy crippled music anyways, do you?

Pop open a terminal and type "sudo vi /etc/hosts" (without the quotes) and hit enter. You should see two to four lines with 127.0.0.1 and possibly ::1 and fe80::1 if you're using IPv6. Type GG to go to the end of the file and insert the following:

127.0.0.1 ax.phobos.apple.com.edgesuite.net

Hit ZZ to save the file and exit. Now type "sudo dscacheutil -flushcache" to flush your DNS cache. This effectively prevents your computer from using the iTunes store, which is precisely what happens when you plug your iPod Touch into your docking cable (By the way, thanks for including an actual dock with the IPT Apple. Real elegance there...) and it loads a web page inside iTunes that nags you to buy the January software. You'll get an error message about the network connection to the iTunes store being refused but you only have to hit OK to be dropped back to the iPod management screen.

Obviously all Apple has to do to disable this is to change the hostname you connect to but they wouldn't really do that to further annoy you, would they?

It does appear that when you do actually buy the software, a file called nikita_receipt.plist is placed in /private/var/mobile/applications. I'll be looking for a way to add the necessary data to that file. For now I'm not sure since all plist files seem to be just a binary blob instead of the XML format they used to be in versions of OS X past.

6Oct/070

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!

9Jan/050

Make Firefox Faster!

Using this little tweak, Firefox will load pages MUCH faster. Works great with broadband connections.

Filed under: Tweaks/Hacks No Comments
3Jan/040

A fix for slow 10.3.2 boot up times

Unless you live under a rock, use Windows, or are still using Mac OS 9 or even Jaguar, you've probably heard of some issues with the latest 10.3.2 update. In particular, the slow boot up times.

This is actually a week or so old, but I thought it'd be worth posting. Apparently, a file named BootCacheControl is called when you boot up your Mac to generate a cache of the boot up files needed to get the Mac up to the login window.

This file is called twice on boot up, and a third time with the following command:

/usr/sbin/BootCacheControl autostop 15

Since the file doesn't exist under /usr/sbin under 10.3.2, boot up is slowed considerably.

This first fix involves copying this file to /usr/sbin:
cp -p /System/Library/Extensions/BootCache.kext/Contents/Resources/BootCacheControl /usr/sbin

I would highly recommend against using this because the discussions on the Apple Discussions board claim it can screw up future updates. Instead uses ln -s to create a symlink:

ln -s /System/Library/Extensions/BootCache.kext/Contents/Resources/BootCacheControl /usr/sbin

After using the symlink method (don't forget -s for a soft link), I rebooted my Powerbook twice and noticed a substantial decrease in boot times. I'm running a Tibook 867, 768 MB RAM, yadda yadda...