Switch between laptop monitor configurations with a keybinding

Wow. Wish I'd known about this before.

sudo add-apt-repository ppa:disper-dev/ppa
sudo apt-get update
sudo apt-get install disper

Voila. Now all you need are your new commands.

disper -s   # activates just the laptop monitor
disper -S   # activates just the attached monitor

These, of course, can be bound to any key combination you want in System -> Preferences -> CompizConfig Settings Manager -> Commands.

If you want to get fancy and have exactly ONE key binding which toggles back and forth, bind to this single command:

Using apache's IfDefine for dev and production environments

If you need different .htaccess directives depending on your development environment, you can do it like so:

<IfDefine dev>
# do something for development environment

<IfDefine !dev>
# do something for everywhere but the development environment

The trick is setting the variables. Contrary to common sense, using SetEnvIf does NOT work:

SetEnvIf Host ^dev.* dev

Instead, you have to pass the flag to apache on startup.

Installing Gtk2::Sexy on Ubuntu

First error message and fix

Can't locate ExtUtils/Depends.pm in @INC

sudo perl -MCPAN -e 'install ExtUtils::Depends'

Second error message and fix

Can't locate ExtUtils/PkgConfig.pm in @INC

sudo perl -MCPAN -e 'install ExtUtils::PkgConfig'

Third error message and fix

Package libsexy was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsexy.pc'
to the PKG_CONFIG_PATH environment variable

sudo apt-get install libsexy-dev

CheckGmail fails with "Error: Incorrect username or password"

New fix

Update: this started happening again on 08 Sept 2011 for different reasons.

First update checkgmail to the latest version (not the one included with Ubuntu):

sudo checkgmail -update

Then download this helpful patch file (3 line change) and apply it:

sudo patch /usr/bin/checkgmail /PATH/TO/checkgmail.patch

Source: https://bbs.archlinux.org/viewtopic.php?pid=993642#p993642


Changing timezones in Ubuntu


  • Right click on the clock that displays in your taskbar.
  • Choose "Adjust Date & Time"
  • If the resulting window is greyed out, click "Unlock" at the bottom and enter your password.
  • Choose your timezone.


sudo dpkg-reconfigure tzdata

Flashing a BIOS with an exe in Ubuntu

For step-by-step instructions, go read the mastermind\'s article, from which this is derived. This is mostly for my future reference. I was given an exe (M1330A12.EXE) by Dell and told to flash my BIOS with it. Right. Then I was given the world\'s most incomprehensible instructions on how to supposedly get it working with linux. Thank god for the aforementioned article -- the following worked like a charm.

Unresolved: <Ctrl>Tab for gnome-terminal

Firefox uses <Ctrl>Tab and <Ctrl><Shift>Tab for switching between tabs. Eclipse at least lets you assign these same keybindings to its tabs. Wouldn't it be nice if gnome-terminal would allow the same thing? No such luck.

The symptom, as described by Daniel DiPaolo:

Don't clear out /tmp on boot

Yes, /tmp is for temporary files... but cleaning it out on every boot? Whose bright idea was that?

Here's how to fix it. In /etc/default/rcS, locate this line:


This is where the number of days old a file needs to be for it to be deleted on boot is supposed to go. Notice the offending 0. That means delete everything, every time. Change this value to something sensible like 15 or 30.

Other distros use cron to clean out /tmp, and the default for those is 720 hours (30 days).

Installing fonts

This is the quickest way I've found to install fonts. I'm sure there's an equally easy system-wide method, but I haven't stumbled upon it yet... this is working for now.

  • Create a directory called .fonts in your home directory
  • Copy .ttf files into ~/.fonts
  • Done

Bringing eth1 (wireless network card) up/down on Ubuntu

For reasons that elude me, the normal way of handling this does not work for wireless interfaces:

sudo ifdown eth1
sudo ifup eth1
sudo dhclient

...but this does work:

sudo ifconfig eth1 down
sudo ifconfig eth1 up
sudo dhclient

Thanks to Lih for figuring this one out...

Syndicate content