Donnerstag, 15. August 2013

Create *.po translation files from Vala Sources with context information in Ubuntu / Linux

I recently tried to create a *.po-File for translations strings from Vala sources which include locale context information.
As it was not so easy to figure out the right command, I thought I would share it with the internet folks:

xgettext -o result.po -L C -k_ --keyword=C_:1c,2 src/*.vala

So how does this work ?
  • xgettext extracts the translatable strings from the sources 
  • ...and puts it into the output file (-o result.po)
  • ...it also requires a defined programming language in this case C (-L C)
  • ...and needs to know what are translatable keywords (_ for strings and C_:1c,2 for contextual information, in this case)
  • ...finally set the input files (src/*.vala)
It's not that hard if you understand how it works :)

Dienstag, 9. Juli 2013

Build Umbrello UML modeler from Git in K/Ubuntu 13.04

Umbrello is a neat KDE-tool to create UML diagrams. If you want to test the latest code, why not get the git version ?


Here's a small guide to build compile latest umbrello from git:

  1. Get prerequisites:

    sudo apt-get install cmake make kde-workspace-dev libboost-all-dev libxml2-dev git-core

     
  2. Get source from git:

    git clone git://anongit.kde.org/umbrello

  3. Configure umbrello:

    cd umbrello; cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`

  4. Compile it:

    make

  5. Install it:

    sudo make install


Want to run dev version in parallel with the stable version ? No problem just change cmake according to the Umbrello FAQ


Montag, 8. Juli 2013

Download all PDF files from Springer Link or other websites in Ubuntu using wget



As a regulary visitor of Springer Link I was always bored to download every single chapter of a publication. So I put together a small wget-comment which allows me to automatically download multiple PDF files from a webpage:


wget -nd -e robots=off --wait 0.25 -r -A.pdf http://yourWebsite.net/


The option -nd stands for no-directories, which means no directories are downloade and -e robots=off forces to not download the robots.txt, because we only want PDFs. The wait command ensures that failed downloads are retried after 0.25 seconds. Additionally I use the r parameter to get PDFs from subpages recursively and -A.pdf to get PDF files only.

Got improvements ? Leave a comment !

Donnerstag, 4. Juli 2013

Kubuntu 13.04 - Enable proper auto spell-checking in KDE

Unfortunately Kubuntu does not install the required packages to enable proper application-wide spell-checking. Here is a guide to enable auto spell-checking for all applications in Kubuntu.

1. Install the required packages ($lang is your language shortcut, e.g. en or de):

sudo apt-get install kde-l10-$lang language-pack-kde-$lang aspell-$lang hunspell-$lang

2. Setup and enable auto spell-checking in KDE:


 Open the KDE system settings and go to Locale


There select Spell Checker and enable Automatic spell checking enabled by default and check your default language (in this case German (Germany)). If you finished set confirm with Apply.

In some applications spell-checking is now enabled by default, like LibreOffice Writer in other you have to enable it, like KMail (New Message -> Right-Click).

Enjoy !

Mittwoch, 26. Juni 2013

Convert APE to FLAC in Ubuntu 13.04 using Libav

If you have a file in the lossless APE format and want to convert it without installing the MAC codec, you can easily do this in Ubuntu using Libav.

Just install av tools:

sudo apt-get install libav-tools

and convert the your file/s:

avcon -i inputApeFile.ape outputFlacFile.flac


That's one easy of many ways to convert APE files in Ubuntu.

Freitag, 21. Juni 2013

Reset Ubuntu Home Dir Permissions

In case you messed up the permissions of you home dir. Here is a small guide to fix it:

1. Reset the permissions for the directories recursivly:

sudo find /home/user/ -type d -exec chmod 755 {} \;

2. and the permissions for all files too:

sudo find /home/user/ -type f -exec chmod 644 {} \;

3. Ensure that your GPG directory has the proper permissions:

sudo chmod -R 600 .gnupg/
sudo chmod 700 .gnupg/

If you don't want that other users can read your home folder (which not default in Ubuntu) change it's permission also:

sudo chmod 700 /home/user

That's it. Not that hard, if you know the right commands.

Mittwoch, 12. Juni 2013

Check MD5 and SHA1 sum for a file in Ubuntu Linux

Imagine you have a file to download with a given checksum and you want to make sure that the file is not corrupted after download.



It's really easy to compute and check the MD5 sum in Ubuntu / Linux using the terminal:

md5sum myFileToCheck

and for SHA1 checksum:

sha1sum myFileToCheck
Both commands compute the corresponding checksum of your file, so you can compare than with the original checksums.