May 6, 2008

Installing Proggy Fonts in Ubuntu

Drew Stephens @ 3:56 pm — Tags: , ,

I don’t recall how I came across the free Proggy font family but I wanted to try them out on my Ubuntu workstation for use in Eclipse. After some searching, I figured out how to install TrueType (.ttf) fonts and the process is pretty straightforward. I downloaded and unpacked the fonts into ~/.fonts, created a fonts.dir metadata file, added them to the font cache and when I restarted Eclipse, they were available.

~$ mkdir .fonts
~$ cd .fonts
~/.fonts$ wget http://www.proggyfonts.com/download/download_bridge.php?get=ProggyCl
ean.ttf.zip
~/.fonts$ wget http://www.proggyfonts.com/download/download_bridge.php?get=ProggySq
uare.ttf.zip
~/.fonts$ wget http://www.proggyfonts.com/download/download_bridge.php?get=ProggyS
mall.ttf.zip
~/.fonts$ ttmkfdir -o fonts.dir
~/.fonts$ fc-cache -f -v

September 13, 2007

Changing the Physical Interface for a VMware Bridged Interface

Drew Stephens @ 5:36 pm — Tags: , , ,

I use VMware to run a virtual Windows machine for my company’s VPN and the occasional game of Starcraft. When I moved and switch from a wired network to wireless, the device with which I connect to the internet changed from good old eth0 to the new-fangled ath0. VMware was setup to tie its virtual interface for bridged networking to eth0. Since eth0 no longer has a network connection, the virtual machine lost the internet as well. To fix this, I had to open /etc/vmware/locations and change the reference to eth0 to ath0. The virtual interface that I use is vmnet0 so the line in the file referenced VNET_0_INTERFACE. Simply changing that line and restarting the VMware backend (/etc/init.d/vmware restart) fixed everything.

September 11, 2007

EXMAP on Ubuntu

Drew Stephens @ 7:05 pm — Tags: ,

EXMAP is a shared memory analysis utility that makes it easy to determine exactly how much memory a process is using. Unlike top, which counts all memory shared amongst programs toward each of those programs, EXMAP gives three numbers most notable of which is “Effective Resident” memory usage. This number is the amount of memory mapped directly by a process, plus a portion of any shared memory pools it is part of, that is, the program is only counted as using an equal portion of shared memory as all other processes that are sharing the same.

On my system, both Gaim (Pidgin my foot) and Evolution are using aspell. In top, they are both responsible for libaspell.so in its entirety, contributing 672K to each of their displayed memory usage. EXMAP puts 338K towards Gaim and 334K to Evolution, a much more accurate tally, since only a single instance of libaspell is actually in memory, shared by the two other processes. From my quick testing, it seems that subsequent users of shared memory take the larger share, 4K more in Gaim’s case, since I started it after Evolution. If I close Gaim, Evolution is then credited with the entire 632K of memory that libaspell occupies.

So, on to installing EXMAP which certainly isn’t hard, but requires a kernel module which makes it non-trivial. First, use apt-get (or really, it’s better replacement aptitude) to install EXMAP, the required kernel module source and the stuff you’ll need to build said module:

sudo -i
aptitude install linux-headers-$(uname -r)
aptitude install module-assistant build-essential
aptitude install exmap exmap-modules-source

Then, build the EXMAP module:

module-assistant prepare
module-assistant update
module-assistant build exmap
module-assistant install exmap
depmod
modprobe exmap
echo exmap >> /etc/modules

module-assistant automatically compiles and installs the module against the kernel headers that aptitude installed in the previous block and depmod calculates the dependencies amongst all modules, including the new EXMAP one. modprobe installs the new module into the kernel and adding its name to /etc/modules ensures that it will be ready next time your system restarts as well. Once all that is done, you can run gexmap.

September 9, 2007

SSH Tunnels for Quick, Secure Net Access

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

An SSH tunnel is a great way to quickly setup a secure method for browsing the web from an unsecure location, such as a public wireless network. All you need is a machine running an SSH server. I setup a tunnel from my Mac OS X laptop using the following command:

ssh -C -D 7070 dinomite.net

This sets up a tunnel, locally accessible on the laptop on port 7070 (-D 7070), that sends any traffic through the encrypted and compressed (-C) SSH stream to the server, where it is spit out onto the net as normal. To use this tunnel, I simply instruct Firefox to connect via a SOCKS proxy on port 7070:

Firefox 2 Advanced Settings Window Firefox 2 Proxy Settings

Many other applications, such as Adium, support SOCKS proxies and can be set up in a similar way to send their traffic to port 7070 and take advantage of an SSH tunnel.

September 1, 2007

Linksys WUSB54G in Ubuntu

Drew Stephens @ 4:50 pm — Tags: , ,

Since we’re going all-wireless in my new house, I had to setup my Ubuntu machine with a wireless card. All of the slots on the computer are filled, so I grabbed a Linksys WUSB54G USB (hence the model number) adapter. Installing it required some terminal work, unusual for Ubuntu. This thread gives a somewhat cryptic outline of the steps required to get the card working and following them requires a bit of Linux experience. For the unexperienced, read on.

After plugging the card in on my Feisty machine, it came up in the network manager (System > Administration > Network) but wouldn’t connect to any networks, be they open or encrypted, G or B, nothing. So I retreated to the interwebs and found that ndiswrapper was the solution to my problems. To begin, install ndiswrapper-utils-1.9:

~$ sudo aptitude install ndiswrapper-utils-1.9

Then, download the latest driver from the Linksys site, unzip it and find the WUSB54Gv4 directory under the Drivers directory. Run ndiswrapper -v and check to make sure there aren’t any errors. Then, install the new Linksys driver.

~$ sudo ndiswrapper -i rt2500usb.inf
utils version: 1.9
driver version:        1.38
vermagic:       2.6.20-16-generic SMP mod_unload 586
~$ sudo depmod -a
~$ sudo modprobe ndiswrapper
~$ sudo ndiswrapper -m

You have to blacklist the standard kernel driver so that it won’t override the ndiswrapper driver. To do so, add the following to the end of /etc/modprobe.d/blacklist:

WUSB54G driver

blacklist rt2570

Then, restart your machine and you should be able to configure wireless using the Gnome GUI tools.

August 8, 2007

Changing default paper size in Ubuntu

Drew Stephens @ 10:35 am — Tags: , ,

Ubuntu’s default paper size is the very international A4. Unfortunately, here in the United States the standard size of paper is Letter (8½ inches by 11 inches). When trying to print, Ubuntu will tell printers to use A4 paper unless you select ‘Letter’ in the print dialog each time. To change this default, simply run the following command which will set the value in /etc/papersize:

sudo dpkg-reconfigure libpaper1

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 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 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.

Older Posts »

Powered by WordPress