Skip to navigation

How to rename a USB flash drive

May 6th, 2008

Depending on the filesystem, see this guide.

Quick info for FAT32:

fdisk -l

to see what your drive is, then:

sudo mlabel -i /dev/sdb1 ::mynewname

(substitute what you found in fdisk -l for the /dev/sdb1).

How to delete more than 20 Gmail contacts

May 1st, 2008

If you select more than 20 of your contacts in Gmail and click on “delete”, Gmail complains that it cannot delete more than 20 contacts at once. Here’s how you can delete all of your contacts at once anyway:

While logged in to your Gmail account, in the top right corner, you will see a link “Older version” (next to Settings). Click that. Go to your contacts page. Scroll down, select all, delete.

I think the fact that you cannot delete more than 20 contacts in the newer version, along with not being able to turn off the “feature” that anyone you reply to is added to your contacts, is one of the first signs that Google is indeed starting to be evil.

Gmail’s bad encryption defaults

May 1st, 2008

Gmail’s webmail service unfortunately defaults to the following behavior: Your login is encrypted, but the page reverts back to unencrypted http after you’re logged in. If you’re in an unprotected wireless network, such as a public hotspot, not only can the e-mails you read and compose be easily read by anyone else on that network, someone can actually hijack your Gmail account that way.

Gmail's unsecured default URL

The fix is easy if you’re a little computer-savvy: manually put in the URL https://mail.google.com (note the “s” in “https://”, and your entire session will be encrypted via SSL. This also works for https://gmail.com, although Firefox will complain about a domain name mismatch. Fine so far. However, if you use yet another URL alias for Gmail, https://googlemail.com, the trick doesn’t work: your Gmail connection now reverts back to unencrypted after login.

Read the rest of this entry »

Xubuntu Gutsy: Laptop suspend on lid close

April 30th, 2008

I’d assume the following works in different Ubuntu versions in general:

Suspend worked out of the box, but closing the lid didn’t do anything but blank the screen. First, I installed gnome-power-manager and fiddled with gnome-power-preferences. I was able to get it to suspend on lid close, but now suspend didn’t work reliably anymore — about every fifth time the laptop would fail to suspend. So I uninstalled gnome-power-manager.

Turns out, all I had to do was edit /etc/acpi/events/lidbtn and change one line:
From:

action=/etc/acpi/lid.sh

To:

action=/etc/acpi/sleep.sh

Works.

Does the Pembury Tavern have Augustiner Helles?

April 29th, 2008

We are lucky to have the Pembury Tavern around the corner, a nice pub whose beer selection includes our favorite beer from Munich, Augustiner Helles. The only problem: The Pembury’s wholesale supplier sometimes has problems with stocking enough Augustiner, and that along with the fact that Augustiner, containing no additives, doesn’t keep longer than about two months, makes for the all-too-frequent Augustiner shortage at the Pembury.

Nicola and I have been joking for some time that there should be a shell script to check whether the Pembury currently offers Augustiner. Well, it turns out this is easily possible, since the Pembury is in fact a Linux-powered pub whose website directly and accurately reflects what’s in the cellar. Enter lynx-dump and we’re all set:

#!/bin/bash 
WEBSITE=http://www.individualpubs.co.uk/pembury/drinks.html 
AUGUSTINER=$(/usr/bin/lynx -dump $WEBSITE | /bin/grep -i augustiner) 
JEVER=$(/usr/bin/lynx -dump $WEBSITE | /bin/grep -i jever) 
ANDECHS=$(/usr/bin/lynx -dump $WEBSITE | /bin/grep -i andechs) 
if [ -n  "$AUGUSTINER" ]; then      
         echo "The PT currently serve:  
$AUGUSTINER 
$JEVER 
$ANDECHS" 
elif    [ -n "$JEVER" -o  -n "$ANDECHS" ]; then
         echo "The PT currently serve no Augustiner, but they serve: 
$JEVER 
$ANDECHS"  
else
     echo "Sorry, the PT currently serve neither Augustiner, nor Jever, nor Andechser." 
fi

As you’ll notice, this also checks for Andechser or Jever as alternative solutions to our cravings for German beer. :)

For even more geeky fun, I’ve put up a mail reply service. If you send an e-mail with the subject line “PT-augustiner-info” to my private e-mail address (my first name (at) my last name (dot) info), you should receive a reply containing the up-to-date information.

This service uses procmail and anohter shell script.

The shell script:

#!/bin/bash 
SENDER=$(formail -x "From:")
WEBSITE=http://www.individualpubs.co.uk/pembury/drinks.html
AUGUSTINER=$(/usr/bin/lynx -dump $WEBSITE | /bin/grep -i augustiner)
JEVER=$(/usr/bin/lynx -dump $WEBSITE | /bin/grep -i jever)
ANDECHS=$(/usr/bin/lynx -dump $WEBSITE | /bin/grep -i andechs) 
if [ -n  "$AUGUSTINER" ]; then
      echo "The PT currently serve  
$AUGUSTINER 
$JEVER 
$ANDECHS" | mail "$SENDER" -s "The PT serve Augustiner" 
elif    [ -n "$JEVER" -o  -n "$ANDECHS" ]; then
      echo "The PT currently serve no Augustiner, but they serve: 
$JEVER 
$ANDECHS" | mail "$SENDER" -s "The PT currently serve no Augustiner, but ..." 
else
      echo "Sorry, the PT serve neither Augustiner, nor Andechser, nor Jever
But you might check out $WEBSITE for other nice beers." | mail "$SENDER" -s "Sorry, no Augustiner, Jever, or Andechser beer at the PT" 
fi

The recipe in ~/.procmailrc:

:0
* ^Subject.*PT-augustiner-info$
| /home/mpromber/bin/augustiner

Addendum

The e-mail information service now also works if you send an e-mail to augustiner (at) mylastname (dot) info. If you’re unsure what my last name is, look at the URL of this blog :) The modified procmail recipe for this (since one can never have too many examples of procmail recipes):

:0
* (^Subject.*PT-augustiner-info$)|(^To.*augustiner@promberger.info$)
| /home/mpromber/bin/augustiner