Thursday, November 1, 2012

Debian: network not working after suspend

The problem:

When resuming from suspend, the network connection is lost. This happens whether using network-manager or /etc/network/interfaces. My network interface is Realtek r8169 (I found this with lsmod).

In /var/log/pm-suspend.log, I get the following message:

/etc/pm/config.d/unload_modules: SUSPEND_MODULES: not found

  1. Install packages acpitool and firmware-realtek.
  2. Make sure the file /etc/pm/config.d/unload_module exists, and add this line:

  3. SUSPEND_MODULES="r8169"

Tuesday, October 2, 2012

Eclipse - ActionBarSherlock

To get ActionBarSherlock examples working in eclipse:
  • Download ActionBarSherlock (ABS) .zip or .tar file and unpack it somewhere.

  • First import the library project with: File → New Project → Android → Android project from existing code. 
    Select the "library" subfolder of ABS as root.
    Tick "Copy projects into workspace" checkbox.

  • Then import the samples project with the same steps above, using "samples/demos" subfolder as root.

  • If you get "Call requires API level XX (current min is X)" errors:
    1. Go to Project Properties > Java Compiler. Use JDK 1.6. 
    2. Ensure you're compiling both the library and your app with Android 4.0+ 
    3. Ensure you're targetSdkVersion is 14 or higher.

  • Then, if there are some errors remaining:
    1. Right click on project -> Android tools -> Clear Lint Markers.

Sunday, September 16, 2012

Restart X (ctrl+alt+backspace)

The ctrl+alt+backspace key combination that used to do a hard restart of the X server has been disabled in many distros. This functionality can be achieved with the combination:


Where Sysrq is the same Print screen or Prtsc key.

Also, the old ctrl+alt+backspace behaivor can be restored by following the instructions in

Saturday, September 8, 2012

Resize image to huge resolution with imagemagick

Recently I needed to print a 5-megapixel photo to roughly 1x2 meter size; the printing store wouldn't print it unless the resolution was at least 300 dpi, which, at that size, means a resolution of 500-megapixels!

Unfortunately, most image editing programs won't support so big files. One solution is to use ImageMagick from the command line. This should work in any platform supported by ImageMagick: Linux, Unix, MacOS and Windows.

First donwload and install ImageMagick from

From a terminal window, type the folowing command:

$ convert -monitor -limit memory 1GB -filter triangle input_file.jpg -resize 1000% output_file.jpg

The details of the different options can be found at, in short:
  • convert is the ImageMagick tool that can (among many other things) resize images.
  • -monitor is an option to display the progress of the operation. This is important to know what's happening, as the process may take several minutes.
  • -limit memory 1GB. This limits the amount of memory used by ImageMagick Without this, the file failed to save!
  • -filter triangle. This tells ImageMagick to use bilinear interpolation.
  • 1000% was the resize factor I needed to produce the 300 dpi image at 1x2m, you can specify other percentage, different horizontal and vertical factors or a target width or heigth (or both) in pixels.

Apply cool effects to your webcam with

Raspberry Pi: terminal "ls" colors for root in bash

To have the "ls" command output shown in colors for the root user, add the following line to the /root/.bashrc file.

alias ls='ls --color'

Note that, depending on the distribution you are using, this line (or something very similar) can already be present but commented out.

Apply cool effects to your webcam with

Monday, January 16, 2012

Vibration units conversion

To convert sinusoidal vibration amplitude units, you can use the online calculator at:

It handles displacement, velocity and acceleration; in mil, ┬Ám, ips (in/s), mm/s, ft/s², m/s², g; expressed in peak (pk), peak to peak (pk-pk) or rms amplitude values.

Apply cool effects to your webcam with

Saturday, January 14, 2012

Using webcalldirect in linux

To use the service in linux:

  1. Install Ekiga if you don't have it. You can ignore the configuration assistant if you wish.
  2. Set up a new SIP account (Edit -> Accounts -> Add a SIP account).
  3. Use the following data, replace your own username and password:

  4. You're done!

Friday, January 6, 2012

Know which version of Debian you are running

To know which version of Debian GNU/Linux you are running, execute this command:

$ cat /etc/debian_version

or (works for other distros, too):

$ cat /etc/issue