Linux Mint 12, Dell Vostro 3750 laptop, enable/disable touchpad (howto)

Steps to get a simple shourtcut to enable/disable touchpad on a dell 3750 (it should work also on other laptops):
1. create a custom bash script “toggle-touchpad” (see details here) with this code:

#!/bin/bash

# this script queries the status of the ImPS/2 ALPS GlidePoint device
# via xinput and disables / enables the device accordingly.

#get touchpad id
XINPUTNUM=`xinput list 'ImPS/2 ALPS GlidePoint' | sed -n -e's/.*id=\([0-9]\+\).*/\1/p'`

TPSTATUS=$(gconftool-2 -g /desktop/gnome/peripherals/touchpad/touchpad_enabled)

#if status fails, exit 1
test -z $TPSTATUS && exit 1
if [[ $TPSTATUS == true ]]; then
xinput set-int-prop $XINPUTNUM "Device Enabled" 8 0;
gconftool-2 --type bool -s /desktop/gnome/peripherals/touchpad/touchpad_enabled false
else
xinput set-int-prop $XINPUTNUM "Device Enabled" 8 1;
gconftool-2 --type bool -s /desktop/gnome/peripherals/touchpad/touchpad_enabled true
fi

Thanks to http://ubuntuforums.org/showthread.php?p=11504018 for this script (these guys kick ass)

2. check that the script works (run the script to enable/disable touchpad).

3. create a keyboard shortcut for your script:
- open “System Settings > Keyboard > Shortcuts > Custom Shortcuts”
- click on “+” and type “toggle-touchpad” in the name field, and the path to your script in the command field (should be something like “/home/john/bin/toggle-touchpad” )
- click “Apply”
- click on “Disabled” column and type the shourtcut you’d like to use (something like Ctrl+Alt+0)

4. close and test your new shortcut ;)

Running buildout when pypi is down or does not respond

When http://pypi.python.org is down you’re not able to install, deploy, create enviroments etc.
This is quite boring!
Anyway, pypi has several mirrors:

Add this line to your buildout.cfg to use one of these mirrors and bypass the (temporary) problem:

[buildout]
index = http://d.pypi.python.org/simple

Invivo – Magnets

Me @ Invivo.
“Magnets” is the first single from Invivo’s new album called “Warp”.
Buy your digital copy of “Warp”:

Me @ OpenSource Day 2001 (Udine) – Liferay

Mash Up applicativo per l’accesso ai servizi aziendali – Marco Celotti, Davide Pavan

Ubuntu howto – add custom bash scripts to your path

  1. Create your bash script:
    mkdir ~/bin/
    gedit ~/bin/myscript
    chmod +x ~/bin/myscript
  2. Update PATH:
    To do so, open a terminal and edit your ~/.bashrc (if there’s no .bashrc file just create a new one):

    gedit ~/.bashrc

    Append the following two lines:

    PATH=$PATH:~/bin
    export PATH
  3. Logout and login.
    Now you should be able to run “myscript” just like the other commands

Plone4 buildout howto

Plone4 wants python 2.6, anyway people running python2.7 say it that works so … I’ll use python2.7.
I’m using Linux Mint 11 (Ubuntu 11).

Install python-dev package:

$ sudo apt-get install python2.7-dev

Then install EasyInstall: download the egg from “http://pypi.python.org/pypi/setuptools” and then run it as if it were a shell script:

$ sudo sh setuptools-0.6c11-py2.7.egg

Ok, so let’s use paster to create a Plone4 buildout:

$ paster create -t plone4_buildout

Run bootstrap.py:

$ sudo python bootstrap.py

Ok we’re ready, let’s run buildout:

$ ./bin/buildout

Now to start the application type:

$ bin/instance start

Done! :)

Axis of Awesome – 4 Four Chord Song

Facebook FBML deprecated – roadmap

FBML will be deprecated starting from 01/01/2012.
So, if you’re using one of the tools listed here:
http://developers.facebook.com/docs/reference/fbml/
… please notice that all FBML endpoints are removed as of June 1, 2012.

More details here:
https://developers.facebook.com/roadmap/

For updates and development news subscribe here:
https://www.facebook.com/developers/emailsettings.php

we have to get rid of facebook asap, wake up!

LG Optimus One P500 unbranding simple how-to (sbrandizzare)

There are tons of forum posts, guides, comments, wikis regarding android rooting, goldcards, overclocking etc.
It’s quite confusing.

I’ve personally tried several procedures to unbrand the phone, this is the one that worked as expected.
It’s simple and effective and you just have to exec steps from 1 to 7:

http://www.androidiani.com/forum/modding-lg-optimus-one/57132-guida-aggiornamento-gingerbread-v20c-v20g-recovery-21-11-2011-a.html

I’ve succesfully unbranded an LG Optimus One P500 phone, upgrading to Android 2.3.3.

Xargs – blank spaces in filenames

With xargs you can easily concat commands like:

find . -name *.metadata | xargs rm

But … if you have filenames with spaces (ie “my beautiful file.metadata”) the xargs command fails to perform the operation.
A possible solution is to use a null character:

$ find . -name *.metadata -print0 | xargs -0 rm

(find) “-print0” option: print the  full  file name on the standard output, followed by a null character (instead of the newline character that -print uses)
(xargs) “-0” option: Input items are terminated by a null character instead of by whitespace

Page 1 of 512345