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:

AltGr+Sysrq+k

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 https://wiki.archlinux.org/index.php/Xorg#Ctrl.2BAlt.2BBackspace_does_not_work.

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 http://www.imagemagick.org.

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 http://www.imagemagick.org/script/convert.php, 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 http://www.monacam-app.com

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 http://www.monacam-app.com

Monday, January 16, 2012

Vibration units conversion

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

www.cbmapps.com/appshelp/8

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 http://www.monacam-app.com

Saturday, January 14, 2012

Using webcalldirect in linux

To use the webcalldirect.com 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

Friday, July 1, 2011

Batch convert youtube flv files to .mp3 audio (linux)

The following command will convert all .flv files in a directory into .mp3 files (keeping the filename). Make sure you have ffmpeg installed.
for i in *.flv; do ffmpeg -i "$i" -ab 128k "`basename "$i" .flv`".mp3; done
You can replace 128k with another bitrate. Keep in mind, however, that the conversion won't improve the quality beyond that of the bitrate of the original audio track of the .flv video file, which can be found with the command:
ffmpeg -i filename


Apply cool effects to your webcam with http://www.monacam-app.com

Friday, June 17, 2011

Edit "places" menu entries in Gnome

Just edit the (hidden) file .gtk-bookmarks in your home folder. Each line of the file represents one shortcut in the menu, like this:

file:///home/user/Documents
file:///home/user/Music
file:///home/user/Pictures
file:///home/user/Videos
file:///home/user/Downloads
sftp://user@server.com:2222/ Network_Shortcut_Name


This is the only way I have found to remove, for example, the shortcuts made by the "Connect to Server" option.

Saturday, October 31, 2009

Convert multi-burst photos into animated gifs



Here is an easy, free way to convert a multi-burst image like this:



Into a nice animated gif:



  • First install the GIMP (GNU Image Manipulation Program), download it from www.gimp.org (or windows installer in http://gimp-win.sourceforge.net/stable.html)

  • Then download the Multi-burst to animation script file: multi-burst-to-anim.scm and save it into C:\Program Files\GIMP-2.0\share\gimp\2.0\scripts for windows or into /usr/share/gimp/2.0/scripts under linux (you will know it is the right folder if you see several other .scm files).
    The GIMP is actually a very powerful image editing program, the script presented is just a little tool to extend its functionality, you can learn how to do many other interesting things with the GIMP.

  • Restart GIMP or refresh scripts with Filters -> Script-fu -> Refresh scripts from the main menu.

  • Open the original multi-burst image, you can apply filters to enhance the image if you wish, but if the picture was taken in portrait mode don't rotate the image (the script can do that) as it would change the order of the frames and the resulting animation would seem scrambled.

  • Time to use the script: right-click on the image and from the contextual menu, choose Filters -> Animation -> Multi-burst to animation.




  • The following dialog will pop up:



    The default options will work for a multi-burst photo with landscape orientation, change them if needed and click OK. The animation will be saved in the same folder and with the same filename as the original image, ending with "-anim.gif". Here is the resulting animation for the image above:



Apply cool effects to your webcam with http://www.monacam-app.com