Il blog di Gas

No comment

Files older than some days

without comments

I usually download some podcasts and I store them in a drectory with a tidy structure like:
Podcast Title
---File

Doing this sometimes I forget about some of podcast I downloaded, I know I downloaded them but I don’t remember where I put them, so I made a script for nautilus that gives me a list of files recently added (modified actually) in a directory. It uses zenity for the gtk gui.

cd ~/.gnome2/nautilus-scripts/
wget https://dl.dropbox.com/u/3038370/Older%20Than
chmod +x Older\ Than

you can change how old the files should be to be show in the list and what program to run when you click

Now right click in nautilus -> Scripts -> Older Than

Screen-older-than

Example of zenity output

Written by gas

ottobre 9th, 2012 at 8:08 pm

Posted in English,Linux

Tagged with , ,

CellProfiler and Gentoo

without comments

CellProfiler is free open-source software designed to enable biologists without training in computer vision or programming to quantitatively measure phenotypes from thousands of images automatically. See our papers on analyzing cell images and non-cell images.

First we need to install the dependecies ( as root):
dev-python/matplotlib wxwidgets>>/etc/portage/package.use
echo "dev-python/h5py">>/etc/portage/package.keywords

dev-python/numpy lapack >>/etc/portage/package.use
emerge -1 lapack-atlas scipy

atlas will take long to merge but will not take up much space so there is not to worry if portage dir is on tmpfs

Read the rest of this entry »

Written by gas

aprile 10th, 2012 at 8:52 am

Posted in English,Linux

Tagged with , ,

Move files with zenity progress bar

with 2 comments

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.

 

 

 

Written by gas

luglio 22nd, 2011 at 4:52 pm

Posted in English,Linux

Tagged with , , ,

Working pidgin facebook chat for linux 64 bit

without comments

Already compiled, just grabbed from svn, put this file in /usr/lib64/purple-2/ and rename it to libfacebook.so

Written by gas

maggio 12th, 2011 at 3:42 pm

Posted in English,Linux

Tofu ripieno di carne

without comments

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

carne a conciare
lasciar li a conciare per 20 min

Read the rest of this entry »

Written by gas

marzo 2nd, 2011 at 1:05 pm

Posted in Ricette

Tagged with

Zuppa con germogli di funghi

without comments

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

zuppa con germogli di funghi

Written by gas

marzo 2nd, 2011 at 12:10 pm

Posted in Ricette

Tagged with

Gnome places double entries

without comments

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.

Written by gas

settembre 13th, 2010 at 8:42 pm

Posted in English,Linux

Tagged with ,

Move files in bash with tar and progress bar

with 4 comments

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 -)

Written by gas

settembre 11th, 2010 at 3:14 pm

Posted in English,Linux

Tagged with , ,

PixieLive

without comments

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.

PixieLive

Written by gas

agosto 26th, 2010 at 7:04 pm

Posted in English,Linux

Tagged with , , ,

Audio transcoding in bash

without comments

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

Written by gas

agosto 26th, 2010 at 6:50 pm

Posted in English,Linux

Tagged with ,