2013-07-28 18:02

To disable xfce panel and/or Thunar from starting in XFCE:

  1. Start a clean xfce session with no application started
  2. Open XFCE settings manager > Session and Startup > Session tab
  3. Set “Never” in front of xfce4-panel and Thunar
  4. Click Save Session
  5. Logout and login again to test

EDIT 2014-04-27: You can also edit /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml

To remove Thunar daemon : Remove the Client3* properties for Thunar, then replace Client4 by Client3 and update the Count property from 5 to 4.
Then restart your session.

2013-07-28 18:02 · Tags:
2013-03-16 17:41

I’ve spent days looking for a good live Multiboot USB solution. I mean a way to include many downloaded ISO files in a single USB stick. I was looking for a system allowing to drop the ISOs in a folder on the key, just showing a menu with the ISO files to boot. Easy2Boot does exactly that!

Booting an ISO file is complex because lots of live operating systems expect to be at the root of a DOS partition. After some research I found several posts saying that generic ISO chainloading is very hard (p1 p2).

I found solutions like YUMI (Your Universal Multiboot Installer (windows) or MultiSystem. At this time, the problem of those programs is that they use specific “tricks” for each distribution to build a menu that will load directly the Linux kernel. It’s not as simple as dropping your ISOs in a folder: you have to use the software to build the multiboot usb key. Another drawback is that you will loose the SYSLINUX boot menus of the distros, because it loads directly the Linux kernels.

You also have hardware usb disk drives emulating a cdrom device. It’s probably the most reliable solution, but it’s not cheap, and bigger that a small USB key.

Easy2Boot, with grub4dos scripting, uses a nice trick (described here): when the iso file is chosen from the boot menu, a DOS partition (number 4) is created starting and ending at the position of the .iso file on the FAT filesystem. This method is more “ISO generic” and can boot many ISO files (99% of Live Linuxes). The drawbacks is that you have a partition overlapping the other (this is not a problem, at least under Linux), and you have to make sure that the FAT filesystem will not fragment your ISO files when you copy them on the key.

Under Windows, you can use the RMPrepUSB software (freeware/not opensource) to prepare your USB key.

Under Linux/Ubuntu, this is simple too:

  1. Format your USB key with a single FAT partition (I recommend gparted).
  2. Download Easy2Boot (v1 Beta06 works fine) and put all the files at the root of the partition.
  3. Download grub4dos (take the last Featured version) and extract the archive on your PC (not on the usb stick)
  4. From the grub4dos folder, run sudo ./bootlace.com --time-out=0 /dev/sdX to install grub4dos MBR (make sure you use the right device!).
  5. Put some ISOs directly in the /MAINMENU directory
  6. Here you go. Reboot and enjoy!

Thanks to RMPrepUSB and to the reboot.pro forum guys!

Hints:

Links:

2013-03-16 17:41 · Tags: , , ,
2012-09-08 23:59

A small script to listen to mouse events with the mev command using gpm (General Purpose Mouse).

Can be used for example on the Raspberry Pi to run mpd commands, to use a mouse as a remote control.

I didn’t find how to isolate the wheel events in order to control the volume. Any idea somebody?

In Archlinux, you can add the following command in /etc/rc.local to start it at boot time:

nohup /usr/local/bin/mpd_mouse.sh > /tmp/mpd_mouse.log 2>&1 &
#!/bin/sh
# This script listen to mouse events with the mev command using gpm.
# Can be used for example on the Raspberry Pi to run mpd commands, to use a mouse as a remote control.
# You can start it as a daemon with:
# nohup /usr/local/bin/mpd_mouse.sh > /tmp/mpd_mouse.log 2>&1 &

# start gpm if not already started
gpm -m /dev/input/mice -t imps2

# unset TERM variable, otherwise mev refuses to start when detecting xterm
unset TERM

echo "Listening to mouse events..."

# we use script to fake a tty for mev, otherwise it exits (note: mev logs errors in syslog)
script -qc "mev -E" /dev/null </dev/null | grep --line-buffered -v "mouse-movement" | while read LINE
do
        echo
        echo "$LINE"

        EVENT=$(echo "$LINE" | cut -d' ' -f1 | cut -d'(' -f2)

        if [ "$EVENT" = "down-mouse-1" ]
        then
                echo mpc stop
                mpc stop
        elif [ "$EVENT" = "down-mouse-2" ]
        then
                echo mpc toggle
                mpc toggle
        elif [ "$EVENT" = "down-mouse-3" ]
        then
                echo mpc next
                mpc next
        else
                echo "nothing"
        fi

done
2012-09-08 23:59 · Tags: , ,
2012-09-08 23:40

Several desktop environments (Gnome, KDE) automatically start an SSH agent at startup. However, you have to think of running ssh-add before connecting to a server.

Waiting for automatic ssh-add in OpenSSH, you can add this to your .bashrc:

ssh-add -l >/dev/null || alias ssh='ssh-add -l >/dev/null || ssh-add && unalias ssh; ssh'

The alias is created only if the identity is not added, and the alias destroys itself once run.

This way the regular ssh command is used after the identity has been added.

http://superuser.com/questions/325662/how-to-make-ssh-agent-automatically-add-the-key-on-demand/471640#471640

2012-09-08 23:40 · Tags:
2012-05-11 13:22

The server hosting this blog respond on all ipv4 TCP ports from 1 to 65535.

See: http://portquiz.net

The following URLs should also work if you are not filtered :

This allows you to test what TCP ports are filtered by your local network.

Command line example with netcat:

$ nc -v portquiz.net 1
Connection to portquiz.net 1 port [tcp/http-alt] succeeded!

$ nc -v -w2 portquiz.net 65535
nc: connect to portquiz.net port 65535 (tcp) timed out: Operation now in progress
2012-05-11 13:22 · Tags:
2012-04-29 15:53

I’m looking for a new laptop. My old T42p Thinkpad is becoming old. I’m looking for a laptop with a good screen…

However… finding a laptop with a resolution similar to my T42p is impossible on today’s market. The T42p has been released for more than 8 years now!! When I’m speaking resolution, I mean pixel density in PPI. My resolution is of 1400×1050 for 14.1 inches, which is good! it gives a density of 124 PPI.

Nowadays, all laptops have the same unique 1366×768 resolution. The last thinkpad X1 from Lenovo with 13.3 inches is only 118 PPI.

It’s revolting! I want my pixels!

Apparently I’m not the only one in this situation…

It’s sad. Maybe it will be better in the future… with our cell phones screens having far better resolutions…

Other usefull links :

2012-04-29 15:53
2012-04-16 14:00

After searching a long time on the Net, here is how to use ImageMagick to compare two images (diff), to determine if the images are similar, or if one image is a resize version of the other.

convert image1 image2 -resize '400x300!' MIFF:- | compare -metric AE -fuzz '10%' - null:

The convert command takes 2 images and scale them to a smaller identical size. We then pipe them to the compare command. The compare command will count the number of different pixels.

The command displays the number of different pixels. If it’s zero then pictures are similar.

2 parameters can increase the similarity tolerance:

  • The size of thumbnails to compare: the smaller it is, the more details are removed. You can use 1/4 of the smaller image for example.
  • The -fuzz parameter: the color distance tolerance. The more you increase this param, the more you allow different colors. Color difference is almost undetectable below 2%.

Notes:

  • It’s better to keep ratio while generating thumbnails.
  • The exclamation mark is needed to force image scale without preserving ratio. Otherwise in some cases the 2 thumbs are not strictly the same size and the compare command fails.

I also made a small script to scale at 1/4 of the small image and displays the percentage of different pixels: imdiff

./imdiff /tmp/bad.jpg ../Public/images/bad.jpg
pixel difference: 2.927%
NOK

Links:

2012-04-16 14:00 · Tags: , ,
2012-02-25 19:28

Small contribution to CyanogenMod wiki

Physical keyboard is changed to QWERTY after CyanogenMod 6 flash. if your HTC Dream has an AZERTY keyboard:

adb remount
adb shell
cat /sdcard/trout-keypad-v3.kl > /system/usr/keylayout/trout-keypad-v3.kl
cat /sdcard/azerty.kcm.bin > /system/usr/keychars/trout-keypad-v3.kcm.bin
  • Then reboot your phone

Some doc: http://source.android.com/tech/input/key-layout-files.html

2012-02-25 19:28 · Tags: ,
2012-01-30 01:11

The user manual of my Bookeen Cybook Gen 3 is DRM protected ! irrk..

Download last version of DRM Tools Archive here :
http://stream-recorder.com/forum/download-drm-tools-archive-t7955p3.html

Extract the archive, then :

tools_v4.7/Mobi_Additional_Tools$ python MobiDeDRM_032.py /tmp/XXXXX.prc /tmp/decrypted.prc

You can now open the file with fbreader.

I’m not sure it works with all PRC files. Maybo you have to give the device PID for some.

2012-01-30 01:11 · Tags: , ,
2011-11-13 21:32

Here is the little sh script I made to do that. The LOAD DATA INFILE command exists but is not capable of creating the table structure.

#!/bin/sh

MYSQL_ARGS="--defaults-file=/etc/mysql/debian.cnf"
DB="mbctest"
DELIM=";"

CSV="$1"
TABLE="$2"

[ "$CSV" = "" -o "$TABLE" = "" ] && echo "Syntax: $0 csvfile tablename" && exit 1

FIELDS=$(head -1 "$CSV" | sed -e 's/'$DELIM'/` varchar(255),\n`/g' -e 's/\r//g')
FIELDS='`'"$FIELDS"'` varchar(255)'

#echo "$FIELDS" && exit

mysql $MYSQL_ARGS $DB -e "
DROP TABLE IF EXISTS $TABLE;
CREATE TABLE $TABLE ($FIELDS);

LOAD DATA INFILE '$(pwd)/$CSV' INTO TABLE $TABLE
FIELDS TERMINATED BY '$DELIM'
IGNORE 1 LINES
;
"

http://dev.mysql.com/doc/refman/5.1/en/load-data.html

(See comment: “Posted by John Swapceinski on September 5 2011 5:33am”)

2011-11-13 21:32 · Tags: , ,