zondag 8 januari 2012

rsync and scp autocompletion

Apparantly, rsync and scp boast tab autocompletion !

When you have configured passwordless SSH access (by copying over your public key) and you use these tools, tab autocompletion works as expected.

For example, typing the following on a bash shell:

rsync localfile.txt exampleserver:/examp<TAB>

will automatically autocomplete the foldername.
In the example's case, it becomes:


rsync localfile.txt exampleserver:/examplefolder/


The same goes for scp, like:


scp localfile.txt exampleserver:/examp<TAB>


becomes


rsync localfile.txt exampleserver:/examplefolder


rsync and scp are able to do this because the passwordless SSH allows them to see what files can be found on the other server without asking for a password.

On my LAN network, it takes about 1 second to autocomplete, which is perfectly acceptable for me. It certainly beats having to open a seperate SSH session and manually making a lising ;-)

Super-sleek shell script as a simple touchscreen controller for Linux

#!/bin/sh

# Beautifully simple shell script to detect screen touches

# I use it to toggle the music player on my FriendlyARM 2440 Mini
# but it can be used for any Linux touch screen


# Copyleft 2011 - t-Omicr0n

while true; do
     head -c 1 /dev/input/event0
     echo "You touched it !"
done &

Hunting advice

Let's say you're a hunter. If a deer takes your gun, shoots itself and then straps itself to the roof of your car..... you have to take it home and eat it ! -- Two and a Half Men