CppAddict

середа, 2 січня 2013 р.

How to convert flac encoded files to mp3 on Ubuntu (Debian) Linux

Flac is lossless compression format for audio files. Lossless means that you will get exactly the same quality of sound as original CD (raw wav files). The file compressed with flac is 60 % of original not compressed file size. Recently flac format gain increasing popularity amongst audiophiles. Due to a large capacity of modern HDDs and extremely cheap external flash USB drives many people prefer flac format to store their music collections. The big disadvantage of flac though that very few (if any) portable devices support flac format. Unfortunately my audio players (Sony Walkman and iPod 4) do not support flac. Recently I got few audio albums encoded with flac...
If you have Debian or Ubuntu system installed then problem can be easily solved.
Install 2 packages with standard Debian magic:

sudo apt-get install flac
sudo apt-get install lame


flac - is standard flac encoder/decoder.
lame - the best known mp3 encoder.
Change directory to place where flac encoded files located, in my case:

cd /home/oleg/Music/Coldplay

Run commands to convert files:

find . -name "*.flac" -exec flac -d {} \;
find . -name "*.wav" -exec lame {} \;


Remove flac and wav files if you do not need them.
Unfortunately if you have Mac OS X system you have to compile both encoders in standard Unix way. If you need Mac OS X guide please post a comment.

четвер, 11 березня 2010 р.

Incremental backup with rsync

To get identical boot-able drive:
sudo rsync -vaxAX --delete --ignore-errors / /Volumes/Backup/
To backup all files in your account:
sudo rsync -vaxAX --delete --ignore-errors /Users/user/ /Volumes/Backup/

неділя, 21 лютого 2010 р.

Building 4.6.2 QT library from sources.

This article is not tutorial. It is just my personal experience, that might be useful for other C++ developers as well. There is plenty of information about this subject on web. The good place to start is an official QT site:http://qt.nokia.com/doc/4.6/install-win.html
http://qt.nokia.com/doc/4.6/install-x11.html
http://doc.trolltech.com/4.5/qt-embedded-install.html

Note that compiled version of library available, but for some reason compiled package was available only for VS2008 (at least at time I wrote this article). I use VS2005 and VS2003 for my development.

Unzip qt archive
Run Visual Studio command line, cd to unpacked library directory, run

configure.exe -static -platform win32-msvc2005

When configuration process completed, run nmake.
First advice: Download zip archive and do not trust any Windows ports of tar utility if you are going to extract archives created on other platforms. Downloading of tar.gz archive was the natural choice for me (can be used on Windows and Linux). It caused the first problem. I run configure with success and then proceed to nmake. To my disappointment every time I run nmake I got (approximately 2 hours per iteration!) very strange error with description I never saw before. I hope I will never see it again :).
Second advice: Check that you have enough free space on your hard drive before compilation. My development laptop HDD had 4GB of free space and it was not enough. If you got strange linker error with message “Can’t …” - actually means "No free space left on HDD".

Exist tricks that help to reduce free space consumption. Run nmake tasks:

nmake sub-src
nmake sub-tools
nmake sub-plugins
nmake sub-sql

Use -no-webkit configuration flag if you do not need HTML rendering engine. Compilation of WebKit takes significant time and HDD free space.

Прихильники