martedì 15 gennaio 2013

Split ape file using cue, convert to flac, add tags, rename!


Here  you can find very useful infos about packages and commands to split a loseless audio .ape file and convert it to flac files.
Basically, using ubuntu
sudo apt-get install cuetools shntool
You will also need the monkeys-audio tools package mac_3.99*.deb
In the link above it is suggested to add a repository, but it won't work with ubuntu quantal 12.10  
I'd suggest to use https://launchpad.net/~flacon/+archive/ppa/+build/3698121
to download a compile and debianized file that can be easily installed this way
sudo dpkg-i
Now, you will have all the tools installed.

Just do
cuebreakpoints *.cue | shnsplit -o flac *.ape ;

And then tag the file using the information in the cue file:
 
cuetag *.cue split-track*.flac ;


If you wanna rename now many split-track*.flac files this wonderful script from here will become your friend and save you the manual work (that's indeed because we love computers!!!).

#!/bin/bash

for a in *.flac; do
ARTIST=`metaflac "$a" --show-tag=ARTIST | sed s/.*=//g`
TITLE=`metaflac "$a" --show-tag=TITLE | sed s/.*=//g`
TRACKNUMBER=`metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g`
mv "$a" "`printf %02g $TRACKNUMBER` - $ARTIST - $TITLE.flac"
done

Terra2.blogspot ad memoriam

Non è ancora morto, ma visto che non è aggiornato da un po' e temo di perdere per sempre questo post, lo riproduco qui. Absit intentio copiae infringendae.

Caro principe Shōtoku Taishi, tanto bravo, tanto intelligente, che a sei anni sapevi già andare a cavallo, che potevi ascoltare dieci persone contemporaneamente e che ha mandato delegazioni in Cina per importare ideogrammi, architettura, buddismo e soprammobili; spiegami una cosa, come te la sei fatta sta fama di genio?

No dico, il giapponese ha tanti difetti ma non quello di essere una lingua estremamente polifonica. Ha 9 consonanti e 5 vocali; sarebbe stato sufficiente mettersi lì un pomeriggio e creare 14 simboli. C'era proprio bisogno di importare un sistema di scrittura che all'epoca contava già 20mila caratteri?

Paradossalmente, pur essendo stati inventati per tutt'altro, con i caratteri latini si potrebbe riscrivere tutta la letteratura giapponese. Mentre per scrivere in giapponese, attualmente, vengono utilizzati quattro sistemi di scrittura differenti: kanji, katakana, hiragana e... caratteri latini (per le sigle, gli acronimi, etc.). Cinque se ci mettiamo anche i numeri arabi, perché da autentico geniaccio hai importato l'unico set di caratteri che fra 20mila simboli non aveva lo ZERO.

Ok, forse inventare un alfabeto non è la cosa più banale.
Ci avete provato con l'hiragana e siete riusciti ad incasinare ulteriormente il tutto tirando fuori altri 46 simboli. 46 simboli per un linguaggio con sole 9 consonanti. Non ho parole, bravi!

Simboli che oltretutto non hanno il minimo legame estetico-logico fra di loro. Prendiamo le sillabe な(na) に(ni) ぬ(nu) ね(ne) の(no). Sarebbe stato carino disegnarle in maniera tale che si fosse potuto intuire che tutte e cinque cominciassero con la stessa consonante o almeno essere associate alla loro vocale: あ(a), い(i), う(u), え(e), お(o). Macché, manco a parlarne.

Con le altre consonanti, ovviamente, il discorso non migliora.

In compenso, ね(ne) è praticamente uguale a わ(wa) e ぬ(nu) sembra il fratello gemello di め(me). Se poi ci mettiamo dentro che per scrivere わ(wa), nella maggior parte dei casi si usa il carattere は(ha), che la sillaba を(wo) c'è ma si pronuncia sempre "o" come la vocale お(o) e che per allungare le sillabe in "o" si preferisce usare la う(u); il quadretto è completo.

Forse il tizio che ha inventato l'hiragana era anch'esso costantemente circondato da 10 persone che parlavano in contemporanea ed in quei frangenti è ovvio che creatività e logica ne risentano.

Ma era proprio poi l'alfabeto il problema principale del giapponese? Non credo proprio.
Nel giapponese metà degli aggettivi (quelli in い(i) ) possono essere declinati quasi come fossero verbi, l'altra metà invece no.
Vogliamo poi parlare delle declinazioni verbali? Non tutte ovviamente, perché altrimenti facciamo notte.

La forma TAI ad esempio. Quella che trasforma una azione del desidrio di compiere quella azione e che conseguentemente muta verbi come KAKIMASU (scrivo/scrivere) in KAKITAI (voglio scrivere). Serviva?
C'era già l'aggettivo HOSHII (si, in giapponese "voglio" è un aggettivo). Perché un aggettivo ed una declinazione per esprimere lo stesso concetto?

A dire il vero la forma TAI non è davvero una declinazione verbale poiché un verbo in TAI può essere ulteriormente declinato... ma come un aggettivo in い(i): KAKITAKATTA(volevo scrivere). Bello vero?

Ma il vero capolavoro di demenza semantica è la declinazione "potenziale", quella che prende un verbo e lo trasforma in un altro verbo che esprime la "possibilità di mettere in pratica quella azione" semplicemente variando una sillaba nella sua corrispondente che termina per "e". In pratica, grazie a questa genialata, KAKIMASU (scrivo/scrivere) diventa KAKEMASU (posso scrivere).

Peccato che KAKEMASU sia una parola usata per esprimere almeno altri cinque verbi (e NON nella loro declinazione potenziale), ovvero: "correre", "subire danni", "scommettere", "volare" e "telefonare" (ora sapete perché quando ha a che fare col giapponese il traduttore di Google diventi una delle applicazioni più comiche mai scritte).

Davvero Taishi, la grammatica nippona era già complicata di suo e, detto tra amici, sta cosa di importare 20mila ideogrammi (attualmente levitati fra i 45mila ed i 50mila) è stata una stronzata fotonica.

domenica 13 gennaio 2013

indicator-sysmonitor displays ↓0kB/s ↑0kB/s with >1 network interfaces

I have to admit that the (in)famous Lens functionalities (except the amazon-drive one) have let me try once more the ubuntu-unity user interface.
I obviously do miss gnome-extensions...
I felt indicator-sysmonitor could mitigate my blues, but its code can't properly handle the presence of 2 interfaces: in the panel net traffic was always 0kB/s in download as well in upload.
Luckly enough, indicator-sysmonitor is written in python (and it is open source)!
So take a look /usr/bin/indicator-sysmonitor: near line 278 the function _fetch_net(self)  has hardcoded to use the 4th and 5th value of ifstat. But if there are more than one network interface the one has to use 8th and 9th value.
 ifstat -a -n -q -S -T 0.5 1  |tail -1
(which is used by indicator-sysmonitor) outputs a line very similar to the following

    0.00      0.00     26.12     12.00      0.00      0.00     26.12     12.00

the first two values being lo the local loopback, the second pair being eth0, the third one wlan0, the last pair the total.
So if this is your case, you has to change by hand the code (reckon from 2 as awk arguments: $8 and $9 are the 7h and 8th values):
def _fetch_net(self):
        """It use the command "ifstat" to know the total net usage"""
        total_net = subprocess.Popen(
            "ifstat -a -n -q -S -T 0.5 1 | tail -1 | awk \
            '{ printf(\"↓%dkB/s ↑%dkB/s\", $8, $9) }'",
            stdout=subprocess.PIPE, shell=True).communicate()[0].strip()
        return total_net



giovedì 10 gennaio 2013

Maxtor Axis Central boots from wrong partition

I loaded on my Maxtor Axis Central a custom image (http://home.comcast.net/~coyoteden/edamame-3.5.74.custom.bin see here and Suphammer).
For reasons I cannot explain (i think errors on filesystem or so), maxtor started to boot from /dev/sda2 loosing all the optware goodies and settings (and samba shares too!!).
I managed to tell the NAS to boot from /dev/sda1 this way:

~ # mxoparam -f
Watchdog will be enabled next boot
~ # mxoparam -q 0
Thanks to http://forum.doozan.com/read.php?3,7531,7552,quote=1

martedì 8 gennaio 2013

Softmodem on HP G72 under Linux [SOLVED]

I have been struggling one hour (or more, ehm...) in order to have the onboard software modem on my HP-G72, so I decided to leave a note for myself (goldfish syndrome) and hopefully for others.
Note that the modem capability wasn't detected by aplay -l
But lsmod gave me some interesting modules loaded
snd_atiixp_modem       19044  0
snd_via82xx_modem      18601  0
snd_ac97_codec        134316  3 snd_atiixp_modem,snd_via82xx_modem,snd_intel8x0m


ENVIRONMENT:
Ubuntu 12.10 (kernel 3.5)

HOWTO:
sudo  service sl-modem-manager start
sudo ulimit -l 8192 && slmodemd -c ITALY --alsa hw:0

(in another console)
 sudo wvdialconf  /etc/wvdial.conf 

output:
Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

Modem Port Scan<*1>: S0   S1   S2   S3   S4   S5   S6   S7  
Modem Port Scan<*1>: S8   S9   S10  S11  S12  S13  S14  S15 
Modem Port Scan<*1>: S16  S17  S18  S19  S20  S21  S22  S23 
Modem Port Scan<*1>: S24  S25  S26  S27  S28  S29  S30  S31 
WvModem<*1>: Cannot get information for serial port.
ttySL0<*1>: ATQ0 V1 E1 -- OK
ttySL0<*1>: ATQ0 V1 E1 Z -- OK
ttySL0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttySL0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttySL0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttySL0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttySL0<*1>: Modem Identifier: ATI -- SmartLink Soft Modem
ttySL0<*1>: Speed 4800: AT -- OK
ttySL0<*1>: Speed 9600: AT -- OK
ttySL0<*1>: Speed 19200: AT -- OK
ttySL0<*1>: Speed 38400: AT -- OK
ttySL0<*1>: Speed 57600: AT -- OK
ttySL0<*1>: Speed 115200: AT -- OK
ttySL0<*1>: Speed 230400: AT -- OK
ttySL0<*1>: Speed 460800: AT -- OK
ttySL0<*1>: Max speed is 460800; that should be safe.
ttySL0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttySL0.
Modem configuration written to /etc/wvdial.conf.
ttySL0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
Without ulimit command the output was
error: mixer setup: Off-hook switch not found for card hw:0
SmartLink Soft Modem: version 2.9.11 May 27 2012 20:09:21
symbolic link `/dev/ttySL0' -> `/dev/pts/1' created.
modem `hw:0' created. TTY is `/dev/pts/1'
error: locked memory limit too low:
error: need 8388608 bytes, have 65536 bytes
error: try 'ulimit -l 8192'

A patch to address this issue was discussed here lhttp://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg616496.html
where, btw, it seems that the error is raised only when slmodemd is started manually...