Archive for the 'Misc' Category

Tito’s lake session

Looks like Tito is showing off again in the wilderness of Lausanne.

Pictures

Few new pictures from the muddiest experience of my life at the Route du Rock festival in Saint Malo with Manacci and Valentina:

… and some more of me playing with animals in a zoo in the Fribourg canton:

Wheelchair testdrive

Yesterday we tested the BCI-controlled wheelchair outside of our lab. Ganga took a couple of cool pictures.

Easy tag creator

I often need to distribute some code to people that do not have access to my SVN/GIT repositories. Furthermore, I create daily tags automatically with cron. Here you have the bash script I normally use.

Please check the example below to understand how it works. Since I run this script for a large number of projects, I fork a tar process for each directory provided as argument. Remove the ampersand (&) at the end of line 22 to disable forking. Lines 28 to 42 wait for all the forked processed before exiting.

Last but not least, if the directories provided as argument contain a .git/ or .svn/ subdirectory, the archive name changes accordingly.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# 2009-01-09  Michele Tavella <tavella.michele@gmail.com>
 
if [ z"$1" == "z" ]; then
	echo "Error: ctk_tag DIRECTORY..."
	exit;
fi
 
PIDS=""
for x in $@; do
	BASENAME=`basename $x`
	TIMESTAMP=`date +%Y%m%d`
	if [ -e $1/.svn ]; then
		REPO="svn"
	elif [ -e $1/.git ]; then
		REPO="git"
	else
		REPO=""
	fi
	ARCHIVE=${BASENAME}_${REPO}${TIMESTAMP}.tar.bz2 
 
	tar cjf $ARCHIVE $x &
	PID=$!
	echo "[ctk_tag] PID=$PID $x--&gt;$ARCHIVE"
	PIDS="$PID $PIDS"
done
 
while true; do
	TPIDS=""
	for x in $PIDS; do
		PIDCHECK=`ps ax | grep $x | grep -v grep`
		if [ -n "$PIDCHECK" ]; then
			TPIDS="$x $TPIDS"
		fi
	done
 
	if [ "z$TPIDS" == "z" ]; then
		exit 0;
	fi
	PIDS=$TPIDS
	sleep 0.10
done

Example

mtavella@miro cnbitk $ ls -sh1
total 16K
4.0K cnbitkapps
4.0K libcnbicore
4.0K libcnbisyncro
4.0K libtransport
mtavella@miro cnbitk $ ctk_tag lib*
[ctk_tag] PID=11996 libcnbicore-->libcnbicore_git20100810.tar.bz2
[ctk_tag] PID=12000 libcnbisyncro-->libcnbisyncro_git20100810.tar.bz2
[ctk_tag] PID=12004 libtransport-->libtransport_git20100810.tar.bz2
mtavella@miro cnbitk $ ctk_tag cnbitkapps/
[ctk_tag] PID=12594 cnbitkapps/-->cnbitkapps_git20100810.tar.bz2
mtavella@miro cnbitk $ ls -sh1
total 10M
4.0K cnbitkapps
180K cnbitkapps_git20100810.tar.bz2
4.0K libcnbicore
8.8M libcnbicore_git20100810.tar.bz2
4.0K libcnbisyncro
 36K libcnbisyncro_git20100810.tar.bz2
4.0K libtransport
936K libtransport_git20100810.tar.bz2

Download

ctk_tag – 2010-08-10

Before/After

Is it better now or before? Well, we were very happy to trash the TV thing, replacing it with the cheapest IKEA couch. So it is better now. I cannot say the same for my head after a routine recording with Ganga(dhar Garipelli). Btw, the holes in my head are nobody’s fault, I just wonder about the word “non-invasive”.

Suit up!

It looks like I’m the winner of the JobZippers’ 2010 tailor-made business suit competition! It means I will , go to Zurich, get in touch with some people at Jeremy Gleave, and suit up!

New apparel for Tito

Post-surgery apparel is pretty cool…

Proper pictures (finally!)

This weekend Elisa and her friend Letizia cross the alps and enjoyed some chilling-out in Lausanne. The good thing is that Letizia is able to operate a camera properly! So we got some nice shots, specially Tito!

By the way, the shots out of focus are because of my poor skills :-(