Feeds:
Posts
Comments

Archive for the ‘Ubuntu Linux’ Category

If you are getting a message such as

rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.map

when you try to run Resque workers (for example by QUEUE=* rake environment resque:work), then here is the solution: http://github.com/defunkt/resque/issues/110

I’m simply posting here because Google did not turn up that Github issue in all my variations on the above search terms. I’m also including the actual solution, posted by Github user djanowski:

djanowski 2 days ago | link

Hello,
The issue is that Redis changed this behavior: before, calling commands operating on non-existent keys would return nil. Now it returns the same result as a key containing an empty structure.
On the other hand, the Ruby client had a bug that was treating a nil response from Redis as an empty array. This was fixed in 2.0.1. So now the client correctly reflects Redis’ behavior.
Thus, your options are:

* Use redis-rb 2.0.0.
* Upgrade Redis to a more recent version (something later than antirez/redis@4e27f26).
* Patch Resque to handle this bug (less optimal in my view). Basically: redis.smembers(:workers) || [].

Read Full Post »

If you get an error like the following while trying to install the MySQL gem:

checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

…make sure you have installed the MySQL development package (in addition to mysql-server). On Ubuntu, this looks like:

$ sudo apt-get install libmysql++-dev

Read Full Post »

Ubuntu 9.04, Jaunty Jackalope, changed the Gnome GUI for turning off the system beep. You know, the beep that doesn’t come over your speakers, but issues from within the computer case.

To turn it off, open System > Preferences > Sound. Click the Sounds tab. Uncheck Play alert sound.

I know this sounds too obvious for a blog post, but lower down in the Sound Preferences dialog, there is an Alerts and Sound Effects box, and when you click the play button by the Alert sound option, you get a nice sound played through the speakers. So it doesn’t seem like that would be connected to the obnoxious system beep. But it is.

Read Full Post »

[30 October 2009 update: Ubuntu 9.10, Karmic Koala, has been released and my display is performing beautifully, including the (now very fast) visual effects]

The default settings of Ubuntu 9.04, Jaunty Jackalope, on my new Optiplex 760 resulted in frequent glitches when displaying windows or interface element changes. The glitches seemed to be more frequent the more time passed (which may be more a factor of the number of open windows than passing time). Toggling between windows, or minimizing and maximizing windows resolved the problem for a time, but after a while, it was really unusable.

I found a how-to article detailing my exact specifications, which indicated that Ubuntu 9.10, Karmic Koala, should resolve the problem. The author of that article describes a process of updating drivers in 9.04 using drivers from the forthcoming 9.10 release, but the specific version numbers mentioned are no longer available, and the drivers now require several other drivers to be updated. I did go through the process of updating the drivers and their dependencies, but after rebooting and logging in, my display was solid black, with a white cursor.

It turns out that simply turning off visual effects removed all the glitches. I’m glad to know that the drivers have been improved, so that when 9.10 is released at the end of October, I can have the effects back, but until then, I’m just happy to be glitch free. (To turn off visual effects: System > Preferences > Appearance, Visual Effects tab, None radio button.)

Read Full Post »

Encryption of my entire home directory is made easy by Ubuntu 9.04’s built-in encrypted home directories. I tried to use TrueCrypt, but could not get it to successfully mount my home directory on start-up. It was while researching workarounds that I stumbled upon the aforementioned blog post.

I still want to use TrueCrypt for portable drives. As an aside, TrueCrypt can format its internal file system using EXT3, meaning that I no longer need to worry about unacceptable characters in my file names when copying to the external drive (EXT3 only forbids the forward slash; whereas, NTFS and FAT forbid several characters).

Installing TrueCrypt is very easy, but verifying that the downloaded installer tarball is not corrupt and has not been tampered with involves a few extra steps that I am recording here for future reference.

  1. Visit the TrueCrypt download page.
    • Under Linux, select Ubuntu – x86.deb if you are on a 32 bit system, Ubuntu – x64 (64 bit).deb otherwise
    • Click Download and save the tarball to your desktop
    • Click PGP Signature and download it to your desktop (don’t worry if you see a message about their public key; we will cover that next). This will be used to verify the integrity of the tarball
  2. In order to use the signature file to confirm the tarball integrity, you need to download TrueCrypt.org’s public key from the TrueCrypt.org contact page
    • At the time of writing, the link to the key is at the bottom of the page, and is titled TrueCrypt-Foundation-Public-Key.asc. Click that link and save the key to your desktop
    • Keep the contact page open so that you can refer to the public key fingerprint
  3. In order to use the public key you just downloaded, you need to sign it
    • First you need a PGP key. If you don’t have one, follow these easy instructions to create one. You only need to follow the instructions in the first post
    • Keep the Passwords and Encryption Keys panel open (if you closed it, open it again through Applications > Accessories > Passwords and Encryption Keys). Click File > Import. Select the .asc file you saved to the desktop
    • Click the Other Collected Keys tab, right-click on the newly added key and select Properties. Then click the Details tab
    • Compare the ten groups of four characters under Fingerprint against the fingerprint provided on the TrueCrypt.org contact page. Make sure they match
    • If the fingerprints match, then click the Sign Key button in the Passwords and Encryption Keys panel
  4. Now we can finally verify the tarball. Open a terminal
    $ cd ~/Desktop
    ~/Desktop$ gpg --verify truecrypt-6.2a-ubuntu-x86.tar.gz.sig truecrypt-6.2a-ubuntu-x86.tar.gz

    If it says
    gpg: Good signature from "TrueCrypt Foundation "
    Then the file is valid
  5. Continuing in the terminal, we will extract and run the TrueCrypt installer
    ~/Desktop$ tar xzf truecrypt-6.2a-ubuntu-x86.tar.gz
    ~/Desktop$ ./truecrypt-6.2a-setup-ubuntu-x86
  6. Walk through the installer
    • Click Install TrueCrypt
    • Read and, if you agree to the terms of use, click I accept and agree to be bound by the license terms (click and drag to scroll through the terms)
    • The Package Manager should open. Click Install
  7. Now that TrueCrypt is installed, open it from Applications > Other and follow the TrueCrypt tutorial. Pay special attention to the fact that encrypting a drive or a partition will delete all data on that drive / partition, so back up first, and only restore after establishing TrueCrypt encryption on that drive / partition

Read Full Post »

Caps lock is a wide key on the home row (at least for standard US keyboards), but most people seldom use it. Home row requires less wrist and finger contortion than the normal position of the Control key along the bottom row. I spend my time in Emacs, on the command line, and in Firefox with Emacs keybindings, so I give the control key a workout.

Caps lock be made into a control key on any system, but it is particularly easy in Ubuntu (it worked this way in 8.04 and 9.04, and maybe earlier, but I only got on the Ubuntu bandwagon last year, after 8.04 was released).

How to do it

System > Preferences > Keyboard opens the Keyboard Preferences dialog. Click the Layouts tab. Click Layout Options. Click the expansion arrow next to Ctrl key position. Select the radio button next to Make CapsLock and additional Ctrl. Close the dialog, and you should be good to go

Read Full Post »