June 26, 2007

Apache2 ProxyPass

Drew Stephens @ 2:02 pm — Tags: ,

If you’re trying to setup a proxy on Apache2 in Ubuntu Feisty, by default it disallows all access to any proxy URLs, which is good. What isn’t good, however, is that nowhere I could find mentioned that this could be found in the proxy.conf file located in /etc/apache2/mods-enabled. I spent some time wondering why my Allow and Deny orders were being ignored until I looked at this file and found that it has the final say. To allow access to your proxy, you must edit this file adding ‘Allow’ orders within the <proxy *> block. Simply use hostnames, IP addresses or CIDR notation:

Allow from foo.com
Allow from 192.168.1.52
Allow from 10.1.0
Allow from 10.1.0.0/255.255.0.0
Allow from 192.168.0.0/16

For more detail, see the mod_access documentation.

June 25, 2007

Oracle Repository GPG/PGP Key

Drew Stephens @ 2:59 pm — Tags: , ,

If you’re using the Oracle apt repository (deb http://oss.oracle.com/debian/ unstable main non-free) with Ubuntu or a recent version of Debian and don’t have their GPG key, you’ll get the following error when running apt-get update:

W: GPG error: http://oss.oracle.com unstable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2E2BCDBCB38A8516
W: You may want to run apt-get update to correct these problems

To fix this, you need to add Oracle’s key to apt, which is straightforward, if you can find the key. After some searching, I found it at http://oss.oracle.com/el4/RPM-GPG-KEY-oracle; to import this, run the following:

sudo wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -

June 24, 2007

Ubuntu: It Just Gets Better

Drew Stephens @ 3:23 pm — Tags: ,

Everyone has used Windows and at some point in time has tried to open up a file for which they didn’t have a reader installed and got that dialog that offers to find a suitable program to view the file. This dialog is worthless and has never lead anyone to finding the program that they need.

I created a spreadsheet on my office using Gnumeric the other day and brought it home to look at. When I went to open it on my Feisty machine at home, I was greeted by the “Add/Remove Applications” application which offered to install Gnumeric Spreadsheet in order to open the file. Very automatic, easy and very cool. These are the sorts of things that really make Linux a great option for desktop users.

June 20, 2007

Fast Downloads with Metalink

Drew Stephens @ 6:24 pm — Tags: ,

Reading the Slashdot thread about PC-BSD someone mentioned that there was a VMWare image pre-installed for playing around with it. On the download page, in addition to being able to select mirrors, as one expects with a large file, there was a Metalink. Not to be confused with Oracle’s worthless support website, Metalinks are files that describe methods for obtaining a file, in this case, HTTP and FTP locations where it is available and hashes for pieces of the file. After first trying a couple of mirrors and only getting ~60Kb/s I grabbed the Metalink file and installed Aria2, a command-line Metalink downloader. I simply pointed aria2 to the Metalink file (it can also take the URL of the Metalink) and it started downloading from 15 of the servers in the list simultaneously. Needless to say, this resulted in a much faster download. More information about Metalinks, including projects that employ them, can be found at the Metalink website.

June 17, 2007

Caps Lock to Control on Ubuntu

Drew Stephens @ 8:51 pm — Tags: , ,

If you’ve ever used a Sun workstation, you know the joys of having a control key where most keyboards position the caps lock key. If you’re an experienced user of the Interweb, you know that there is nary an occasion that calls for the caps lock. The fact that you have to hold down the shift key is a good moment to reconsider any yelling. Though I don’t use the console often, it is endlessly annoying to find that I don’t have a properly positioned control key when I do. I went searching for the right way to change the keyboard’s layout, since I hadn’t ever bothered to do it previously. I found this how-to by Gary Vollink which describes how to replace the worthless caps lock with the useful control key in all operating systems anyone ever uses.

For Ubuntu’s console, it’s a simple change in /etc/console-setup/boottime.kmap.gz, which can be edited directly with vi; no need to un-gzip it first. Keycode 29 is the left control key and #58 is the caps lock. If you want another control, just copy the contents of 29 to 58 and if, for some reason (lots of SQL?) you care to swap the two rather than be rid of caps lock entirely, simply swap the values after the equals signs.

In X, I had previously used Gnome’s keyboard preferences to change the caps lock setting, but the above-mentioned howto showed that it could be done by adding the following option to the ‘InputDevice’ section of one’s xorg.conf:


Option      "XkbOptions"    "lv3:ralt_switch, ctrl:nocaps"

June 15, 2007

Malted Milk Ice Cream

Drew Stephens @ 8:00 pm — Tags:

A Google search for ‘malted milk ice cream’ only turns up a single recipe, that from A Perfect Scoop. I used that as the basis for my ice cream but only very loosely. I’ve been cooking long enough what changes can be made to a recipe without screwing it up completely and so took the liberty of omitting the eggs. I usually make ice cream without eggs mainly because I’m lazy and if you use eggs you have heat your mixture to cook them. Also, without eggs ice cream is considerably healthier, containing much less fat and cholesterol. Finally, ice cream made with eggs is technically a custard. That final stipulation is the one I pull out when I don’t want people to think I’m lazy. My recipe is as follows:

1.5 cups half & half
1.5 cups whole milk
1 cup malted milk
1/2 cup skim milk powder
1/2 cup sugar
1.5 teaspoons vanilla

I use more vanilla and malted milk because I really like those flavors. The amount of vanilla is perfect, but if you’re not into the malt as much, you should first ask yourself why you are making malted milk ice cream and then only use 1/2 or 2/3 of a cup. I used whole milk and half & half in the quantities specified because I wanted 3 cups of liquid total and that’s how much half & half I had that needed to be used up. The original recipe calls for cream, as many ice cream recipes do; this will certainly make a more luscious ice cream, but I’ve found whole milk + half & half to do a fine job. My normal ratio is 1 cup half & half and 2 cups milk, which makes a very good ice cream with much less fat than cream-based ice cream. I guess I really am making ice milk, but no matter, it’s good stuff.

June 13, 2007

Creating Encrypted Backups with GPG

Drew Stephens @ 7:14 am — Tags: , ,

With large hard drives becoming cheap and external enclosures easy to find, many people are finally beginning to perform backups of their data. While an external drive is a good step that will mitigate the risk of the main drive’s failure or an accidental deletion, it doesn’t protect from the worse, albeit more rare risks of fire and theft. I say this and now I’m about to delve into some Linux jazz that doesn’t apply to normal users. Oh well.

I keep regular backups (I’m actually lucky enough to have an offsite location to put them) but want to keep my most important data in another place as well and to do so, I occasionally burn a DVD with said data. My only concern with this is that if I, say, leave it in my car now my potentially private data is even more susceptible to theft. In order to make this a non-issue, I use the following command to create encrypted and gzipped tar archives:

tar -chf - foo/ | gzip - | gpg -e -r Drew > foo.tar.gz.gpg

Quite simple, really.

June 2, 2007

Smoking

Drew Stephens @ 6:53 am — Tags:

Smoking food is great; the only downside is that if you want it ready for an afternoon barbecue, you have to get up early to put the meat to the heat. Alton Brown’s recipe for pulled pork is what I use; it simply consists of brining a pork shoulder overnight and then smoking with a simple rub. If you’ve got the smoker running, you might as well toss on other stuff as well.

June 1, 2007

Installing VMware Workstation on Ubuntu Feisty (7.04)

Drew Stephens @ 11:43 am — Tags: ,

I found a new, easy process for installing VMware on Ubuntu, having updated the kernel on my Feisty machine since the last time I used the virtual machine. Whenever the kernel changes, VMware needs to rebuild it’s kernel module to suit, via the script vmware-config.pl. This involves a few steps such that VMware can correctly build it’s module against the kernel you’re running. First, you need to grab the headers for your running kernel and set them up to support building:

~$ sudo -i
~# aptitude install linux-headers-uname -r
~# cd /usr/src/
/usr/src# ln -s linux-headers-2.6.20-16-uname -r linux
/usr/src# cd linux
/usr/src/linux# cp /boot/config-uname -r .config
/usr/src/linux# make oldconfig && make prepare0 && make scripts

The above installs the kernel headers for your current kernel (uname -r' gives the running kernel's version), gets the.configfor said kernel and preps the headers per the.config`. Now, on to the VMware part of things.

Installing VMware is really easy, thanks to this patch. You simply need to get the patch, untar and run it; the script included invokes the VMware configurator automatically.

/usr/src# wget http://ftp.cvut.cz/vmware/vmware-any-any-update109.tar.gz
/usr/src# tar zxf vmware-any-any-update109.tar.gz
/usr/src# cd vmware-any-any-update109
/usr/src/vmware-any-any-update109# ./runme.pl

Follow the directions provided by the VMware configuration script (the defaults are safe, but read the information) and you’re done.

Powered by WordPress