понедельник, 28 мая 2012 г.

Convert ALAC m4a to FLAC with tags, artwork and lyrics

Hello, dear anonymous!

There is a script i wrote i'd like to share with you. It uses ffmpeg, mp4info and metaflac to convert an ALAC file to FLAC keeping tags, artwork and lyrics! It has several options, so execute it with -h option and read. I don't like batch scripts so use find -exec to convert all your ALAC collection to FLAC like this:

double-click the code to select and copy Download: http://alac2flac.googlecode.com/files/alac2flac-1.0.1.tar.gz
ebuild: http://alac2flac.googlecode.com/files/alac2flac-1.0.1-ebuild.tar.gz

If you're not using gentoo, then you have to install its dependencies manually. It depends on: ffmpeg, flac, libmp4v2 (built w/utils).

If you don't want to download anything, then open the spoiler below and save the code to alac2flac. Don't forget to chmod +x alac2flac it. Exec it from the dir containing it then: ./alac2flac Or save it in $PATH. Or maybe you just want to look. Anyway, here it is:

Click to show

P.S. At first i was relying on an alac|flac pipe, but when i used it in batch mode on my ALAC collection it turned out, that alac_decoder (http://craz.net/programs/itunes/alac.html) couldn't decode some m4a files. :(  Then it turned out that ffmpeg does the same job 5-10 times faster.

суббота, 12 мая 2012 г.

Conky' various graph' scale parameter

Hello, folks!

At last i have some time and some linux-related stuff that worth of being posted to post.

So, here we go.

The first note is about conky' varios graphs' scale parameter. There are several unanswered topics out there in the www and the conky' official documentation lacks of the information about the proper usage of that parameter too.

OK, what the scale parameter means? The scale of the conky graph is the maximum value of the graph.

Let's look at this example (it's a real config line from my conky setup):

${downspeedgraph eth0 10,20 888888 FF8C8C 2441KiB -l -t}

The first parameter to downspeedgraph - eth0 - is the name of the network interface that looks out to the www through my ISP (Internet Service Provider). eth0 is a 100Mbit connection interface, but my ISP lowers its bandwidth to 20Mbit because of the internet plan i pay for. So, the maximum download speed for eth0 is 20Mbit. Most of ISPs (and, btw, mass storage hardware manufacturing vendors) use decimal bytes instead of binary bytes. Decimal kilobyte (kB) consists of 1000 bytes and binary kilobyte (kibibyte - KiB or KB) consists of 1024 bytes. Most operation systems and software use binary bytes (that is why OSs or file managers show lower capacity of your 3TB HDD). Just like any other normal software, conky uses binary bytes also (at least by default). So to figure out the proper value for the scale parameter 20Mbit (20 decimal megabits) should be converted to binary kilobytes (kibibytes). Using Qalculate it's done by simply typing "20Mbit to kibibyte" and hitting enter. If you do not trust your machine do the math yourself: (20*10^6)/8/1024. Don't know why, but scale should be set strictly in kilo's (KiBs).


That is how to get the proper value for conky' graphs.


Other parameters passed to downspeedgraph:
10,20 - 10 is the height of a graph and 20 is its width.
888888 - is the first color and FF8C8C is the second one.
A graph is drawn from the right to the left. The last measurement is shown at the right side of the graph. When it becomes obsolete it crawls to the left.
If -t switch is not used, then the rightmost measurement is FF8C8C and the leftmost is 888888. Graph' color fades from the second color at the right to the first color at the left.
If -t switch is used, then graph will be  888888 at the bottom and FF8C8C at the top. The higher value is - the more FF8C8C'er it will be.

So, that is pretty much it.


The other article will be all about a eclass i developed to make various game's additives like mods or addons easy to install using portage. Stay tuned and good luck.
xoxoxo