Move files with zenity progress bar
I’m playing with a script that moves files between two directories and does that by piping two tar commands, so called Fast Copy.
You need zenity to see the progress bar, it is a work in progress as there are some bugs, eg when you click “cancel” the two tar child processes are not killed for some reason, I couldn’t get the correct exit code that probably gets lost somewhere.
Probably in the future I’ll write a better notification.Suggestions and modifications are wellcome.
Working pidgin facebook chat for linux 64 bit
Already compiled, just grabbed from svn, put this file in /usr/lib64/purple-2/ and rename it to libfacebook.so
Tofu ripieno di carne
Mettere nell’acqua 20 minuti i funghi ( tipo insalata, sottili, venduti secchi)
tagliarli più piccoli e togliere le parti dure
sciacquarli un paio di volte
Mettere il macinato in una terrina con pepe, fecola, soia e olio di sesamo, stavola sale perchè li mettiamo nel tofu e non possiamo metterlo alla fine

lasciar li a conciare per 20 min
aprire il tofu e metterci la carne
padella a fuoco alto con strato di olio
mettere su il tofu dalla parte della carne e poi girare
togliere quando pronto e tenere l’olio in padella
nella padella con l’olio rimasto mettere garlic, ginger, chili e poi i funghi
dopo un po a rosolare mettere il tofu ripieno
aggiungere un centimetro scarso di acqua fredda e cuocere finchè si asciuga
Zuppa con germogli di funghi
Mettere in una pentola olio, garlic, ginger e rosolare
aggiungere un po di carne macinata conciata come al solito
poi aggiungere i funghi in scatola (germogli di funghi) e rosolare
aggiungere acqua abbondante e consumare a fuoco lento
Gnome places double entries
As a gentoo user I’ve been stuck with gnome 2.26 for ages and when I emerged gnome 2.28 I found out that two out of three nfs shares had double entries in the gnome places menu. It seems that there is some sort of problem with gvfs, some users have reported double entries in gnome places for local mounts and for remote shares.
I could solve the problem (now, end life of gnome 2.30) by mounting my shares with “defaults” as an option. These things make me wonder why I like computers.
Move files in bash with tar and progress bar
Example
gas@caldaia ~ $ my_move source_dir/ dest_dir/
43.5GB at 61.0MB/s eta: 59s 91% [=========== ]
You need to install “command line progress bar”, in gentoo it can be installed with emerge bar in ubuntu the deb can be grabbed here and installed with gdebi.
my_move:
#! /bin/sh
SOURCE="$1"
DEST="$2"
SIZE=$(du -sb "$SOURCE"|awk '{print $1}')
(cd "$SOURCE" && tar -cf - *)|bar -s $SIZE| (cd "$DEST" && tar -xBpf -)
PixieLive
A friend of mine, Christian, has released PixieLive, a slax based live linux distro build with gentoo.
It’s one of the few live distributions that support Intel GMA500, popular on netbooks like some Asus EEEPC.
Audio transcoding in bash
A proper transcode must have a lossless audio format as a source, a good one is flac ,stands for Free Lossless Audio Codec, because it does the job well and has a good licence ( BSD and GPL ).
If you have some flacs and want them in mp3 format (you need lame and flac) you can use this one liner:
for FILE in *.flac; do flac -cd "${FILE}" | lame - "${FILE/.flac/.mp3}"; done
the above line decodes every file that ends in .flac to the standard output (screen) and pipes it to lame that will encode it. “${FILE/.flac/.mp3}” will be the output file, in bash that means: take the variables “$FILE” (that is the original filename), remove “.flac” and substitute “.mp3″.
Nowadays I transcode quite often to 320 kbit/s constant bit rate (CBR)
- achieving the best quality for an mp3 and still being highly portable, some players don’t like variable bitrate of high quality ( like the V0 preset)
- doing something unefficient since mp3 is not a good codec for that quality but if your stereo reads just mp3 you don’t have any choices
I simply need to use lame with the proper switches , the above one liner becomes:
for FILE in *.flac; do flac -cd "${FILE}" | lame --cbr --preset insane - "${FILE/.flac/.mp3}"; done
To rip my compact discs and encode my music in flac I use a program for windows called Exact Audio Copy (EAC), my Wine build doesn’t like it for some reasons and Virtualbox has historical problems in handling cdroms correctly, the solution was VMWare. The native solution is RubyRipper
Fail2ban and postfix sasl
Today I found the usual chinese trying to get in my smtp to send his spam to the world and I realized that fail2ban wasn’t working because the regexp used to match the offender is wrong.
This is the log entry (/var/log/mail)
Aug 21 22:45:30 myserver postfix/smtpd[12071]: warning: unknown[xxx.xxx.xxx.xxx]: SASL LOGIN authentication failed: authentication failure
and this is the regex that work , just remove the part after “authentication failed” (/etc/fail2ban/filter.d/sasl.conf)
failregex = (?i): warning: [-._\w]+\[
Test it:
fail2ban-regex /var/log/mail.log /etc/fail2ban/filter.d/sasl.conf
if you are on a slow server or on a big mail server use /var/log/mail.err instead
Unmerge Kde in gentoo
Update
emerge --ask -C `eix -C kde-base --only-names --installed`
nano /etc/make.conf
and delete kde from the USE flags, remove qt3support and qt4 also if you don’t need them anymore
emerge -uavtqND world"
Now you should have just a few kde packages in the list you got as an output of that command, it’s your choice to leave them or unmerge them manually, with unmerge -pv –depclean





