How to insert ubuntu PPA’s to debian

Ubuntu created a very interesting service called PPA – personal package archives.

If anyone of you ever used debian (or ubuntu) you may be wondering how cool it could be, if your software could be in official repository so that people could just type:

sudo apt-get install blah

These of you who managed to get through all the bureaucracy and got the packages there, might be wondering how cool it would be, if that package which got build and published there months ago, could be ever updated to latest version of your software 🙂

Today, it’s both possible and very easy, thanks to PPA.

I am not going to describe the process of how to submit stuff to PPA, because that is explained on many places, but I am going to explain how PPA work and how you can use this powerful service on debian.

What is PPA

PPA is basically a repository server, where each user can create their own personal aptitude remote repository, using unlimited number of own GPG keys. There is basically no difference between PPA repository and any other apt repository.

How do I make it work on debian

There is no command apt-add-repository on debian, because PPA is ubuntu thing. That makes 2 problems:

* You can’t easily add PPA
* You may have problems with dependencies, as some debian packages are named differently than ubuntu packages

First problem can be overriden easily. You can either get the source code of apt-add-repository and install it localy, OR you can just insert the url of PPA in format of

to your /etc/apt/sources.list where USER is username on PPA and REPOSITORY is PPA. You also need to replace ubuntu version with any ubuntu version which is most close to your debian version, typically some LTS (precise, or lucid).
The other thing you need to do, is installation of GPG key of the user you want to download packages from:
gpg --keyserver --recv-keys KEY
gpg -a --export KEY | sudo apt-key add - 

Now you should be able to download and use the PPA repository.

You may be however facing the other problem with dependecies, and there is currently no other solution for it, than rebuilding the source package yourself with correct debian dependencies.

Underscores, camels and insane madness of modern programming styles

So, I went over several articles related to programming style, after I noted that basically every modern project uses some special formatting, which even if I am familiar with, I never liked.

I decided to take programming styles little bit more in a detail from technical perspective and made some interesting conclusions.

In past, when GNU project started, most of programmers followed the so called “ISO” style (which is known as Allman see wikipedia) which I kind of like, even if I could think of better one.

This style uses opening and closing bracket for every function on separate line, for example

void Foo(int Bar)
    printf ("%i", Bar);

Unfortunatelly this style has two disadvantages. I love that allman style put brackets vertically on same position – that makes it just perfectly simple to “parse by eyes” and you never get lost in brackets, unfortunately, GNU does pretty weird indentations, probably because old code was developed in 85×24 terminals, so they really needed to keep it low on width.

Nowadays, most of programmers like to write code using style that makes the code “cute” but awfully hard to read, error prone and ineffective.

It’s not just that K&R put brackets in a way, that you can save one line (like if that was actually needed), but can’t figure out which bracket matches which. But also the letter cases are pretty weird. I discovered this great post: you really should check it out. It perfectly describes pro’s and cons of camelCase over underscore_name and I can tell you, I can see why most of respondents changed their mind after reading the article. Underscores, are clearly better in almost everything, and only argument why camelCase is better was “it is more cute”.

I think this kind of reflects the modern programming trends. Programmers, instead of making effective code, write cute code…

Even if I am not a big fan of Microsoft, I must say that code they use in their examples and Visual Studio has modern and very effective styling which I find extremely easy to read.

They basically use NormalCases and vertically matching brackets for everything, as well as 4 spaces to indent. Which indeed need more space than GNU’s 2 spaces, but make the code easier to read on modern screens with high resolutions. So no matter how people blame Microsoft for everything, this is a style I like and probably going to use in most of my projects, no matter of language. It may not be “cutest” but at least it makes the code easy to read.