Archive for the ‘Clam Chowder’ category

Current Git Branch for your prompt

I guess most of you that use Git on a more regular base, like the easiness of creating, merging and deleting branches thats comes along with Git, so you will probably tend to create branch over branch. I often change into a Git repository and ask myself: which was the last branch I was working on? Of course you can simply call ‘git status’, but wouldn’t it be more convenient to promptly see in which branch you reside as soon as you enter the repository?

If you are answer is “yes” then you should take a look on bash completion – to be more exact: to the Git related part of it.

The Git bash completion script offers a function called __git_ps1. As the ps1 already indicates, the function is intended to be called in the PS1 definition of your .bashrc. Just open your .bashrc in your favourite editor and search for PS1= which might look like the following:

PS1='[\u@\h \W]\$'

whereby your shell prompt results in:

[username@hostname path]$

To add the current Git branch to your prompt simply add the __git_ps1 function to it:

PS1='[\u@\h \W $(__git_ps1 " (%s)")]\$'

The argument to __git_ps1 will be displayed only if you are currently in a git repository:

  [username@hostname path (branchname)]$
1 Comment

Xubuntu ‘Karmic Koala’ 9.10 Alpha 6

Xubuntu 'Karmic Koala' 9.10 Alpha 6 - Installation Screen

Xubuntu 'Karmic Koala' 9.10 Alpha 6 - Installation Screen

No Comments

A Packing Rat

Although I do not own an android based phone by myself, there is a small application I would like to recommend to you: PackRat — Media Collection Manager for Android.

Books and CDs present a particular problem to me, mostly because I already have a lot of each: I’m never entirely sure whether I actually possess one, or whether I only read/listened to it at some point in the past. I’ve bought a few books twice that way.

PackRat unwesen tries to get the application ready for this years Android Developer Challenge, so he is a bit under pressure as the submission period ends on 31th August at 11:59:59pm Pacific Time.

Although the application seems to be pretty complete there is no download available at the moment, but unwesen revealed a whole bunch of screenshots so that you can get a first impression of the app.

2 Comments

Getting Things GNOME!

Getting Things GNOME! Recently I had to notice that I have to maintain a lot of projects and so I have been searching for a software tool that fits into my workflow with a maximum of ease of use.

I have tried several solutions, amongst others: Tasque and ThinkingRock. I had installed the latter one for almost a year, but never really used it, as it takes too much time to drop a quick note on a thought. Tasque is great if you want to use Remember The Milk as the backend, but in fact I did not want an online based tool for several reasons (connectivity, security, etc.). There is also a simple SQLite-based backend, but that lacks of a working category support. Other options have been Korganizer, TaskCoach and some simple to-do list programs — none of them fit my needs.

After crawling the web for days, I stucked on a little tool called: Getting Things GNOME!

GTG focuses on usability and ease of use. Its main objective is to provide a simple, powerful and flexible organization tool to the GNOME desktop environment.

The GTG user interface provides several convenience features that I find particularly advantageous. It has a quick-add entry box which allows users to create new tasks on the fly without having to input any extraneous data. Users can optionally specify tags for the task directly in the quick-add box alongside the task title. Another nice user interface feature that I like is the Work View, which will give you a flattened and filtered view of your task list with immediate action items.

The only tiny downside of GTG is that there is no method to minimize GTG to your system tray — but that will probably be part of the next release.

No Comments

Skype Playing Now

Inspired by pidgin-musictracker and the abscence of similiar a Plugin/Script for Skype for Linux, I have decided to write one on my own. This script uses the DBus-Interface of Banshee to retrieve the currently played track. This information is written via the Skype4Py-API into the mood message of the currently logged in account.

At the moment there is only Banshee supported, but I have planned to support some more players soon — so do not expect too much now, especially as I am still a Python beginner.

Read the rest of this entry »

6 Comments

SSL-enabled name-based virtual hosts with mod_gnutls

This article describes how to setup SSL-enabled name-based virtual hosts — that is secure virtual hosts which share the same IP address and port — with SNI-capable mod_gnutls module for Apache’s httpd server.

Server Name Indication (SNI) is a TLS extension which makes the configuration of SSL-enabled name-based virtual hosts possible. The current version of OpenSSL — 0.98 at the time of writing — does not support SNI yet, but it is planned for the upcoming 0.99 release and there are already several patches out there to add SNI capabilities to 0.98. mod_gnutls is an experimental module for Apache’s httpd which includes support for SNI.

This setup has been performed on a server that runs on Debian/Lenny and uses no self-compiled programs/packages.

Installation:

In order to use mod_gnutls you need to install it from the repository of course, simply invoke:

1
2
yourserver:~# apt-get update
yourserver:~# apt-get install libapache2-mod-gnutls

Then you need to enable mod_gnutls and disable mod_ssl:

1
2
yourserver:~# a2enmod gnutls
yourserver:~# a2dismod ssl

Setup GnuTLS:

Now it is time to get rid off mod_ssl and its configuration directives like SSLEngine, SSLCertificateFile and so on in each of your virtual host definitions. Instead we will add the mod_gnutls directives here:

1
2
3
4
GnuTLSEnable on
GnuTLSPriorities NORMAL
GnuTLSCertificateFile /etc/apache2/ssl/apache.crt
GnuTLSCertificateKey /etc/apache2/ssl/apache.key

It is a good practise to check the server configuration after each changed virtual host. You can simply do this by invoking the following command:

1
2
yourserver:~# apache2ctl configtest
Syntax OK

If you see an error instead of the ‘Syntax OK’ message, you should carefully check the changes you made. Usually most errors are caused by typos.

Finalization:

Once you have been done with adjusting and checking your virtual hosts you are ready to reload the configuration of your webserver:

1
yourserver:~# /etc/init.d/apache2 reload

Conclusion:

With mod_gnutls, the server supports the SNI TLS extension. The virtual hosts are name-based, no matter which one you visit, the relevant certificate for each virtual host is used.

Even tough mod_gnutls works pretty well, it is still in experimental state. Therefore, performance issues should be considered as normal (but could not determine any so far).

Another important point to mention regards to SNI support in web browsers. Currently only these browsers have built-in support for SNI:

  • Mozilla Firefox 2.0 or higher
  • Opera 8.0 or higher
  • Internet Explorer 7.0 or higher
  • Safari 3.0 or higher, but not on WinXP
  • Google Chrome, but not on WinXP
4 Comments

How to install PERL CPAN modules in your home directory

I recently had the problem to install some PERL modules from CPAN with a non-root user. As a non-root user you won’t be able to install modules in non-system locations (system location would be: /usr/bin, /usr/lib). Luckily you can also install modules into your home directory. First you need to determine wether or not you need to configure CPAN.

perl -MCPAN -e shell

This might result in the following error message:

  Your configuration suggests "/root/.cpan" as your
  CPAN.pm working directory. I could not create this directory due
  to this error: mkdir /root/.cpan: Permission denied at /usr/lib/perl5/5.8.8/CPAN.pm line 553

If you don’t get this error message you are already done and you can stop reading. Otherwise you need to re-configure CPAN for your personal use.

1
2
3
4
5
6
mkdir -p ~/lib/perl5
echo 'export PERL5LIB=${PERL5LIB}:~/lib/perl5:~/lib/perl5/lib:~/lib/perl5/lib/i586-linux-thread-multi/' >> ~/.bashrc
source ~/.bashrc
mkdir -p ~/.cpan/CPAN
echo "\$CPAN::Config = {}"> ~/.cpan/CPAN/MyConfig.pm
perl -MCPAN -e shell

NOTE: the shell variable PERL5LIB also contains an architecture dependent lib-path. So it might be that you need to change that part of the lib-path, e.g. from ~/lib/perl5/lib/i586-linux-thread-multi/ to ~/lib/perl5/lib/i386-linux-thread-multi/ or whatever your system matches.

Accept all the defaults (as long as you don’t want to make any special settings) until you reach the following question:

  Every Makefile.PL is run by perl in a separate process. Likewise we
  run 'make' and 'make install' in processes. If you have any
  parameters (e.g. PREFIX, LIB, UNINST or the like) you want to pass
  to the calls, please specify them here.
 
  If you don't understand this question, just press ENTER.
 
  Parameters for the 'perl Makefile.PL' command?
  Typical frequently used settings:
 
  PREFIX=~/perl non-root users (please see manual for more hints)

Give the following answer:

1
2
PREFIX=~/lib/perl5 LIB=~/lib/perl5/lib INSTALLMAN1DIR=~/lib/perl5/man1 INSTALLMAN3DIR=~/lib/perl5/man3
...

That’s it, now you should be able to install PERL modules from CPAN via the CPAN shell.

No Comments

Extreme JavaScript Compression

Nicholas Zakas, Principal Front End Engineer at Yahoo!, posted an interesting read about Extreme JavaScript Compression with YUI Compressor on Slideshare.

Thanks to Josi for pointing my interest to it.

No Comments

KDE/Windows is NOT discontinued

Currently there a few entries on blogs and news sites (for example: here and here) saying that the KDE for Windows project is discontinued. In short: That’s not the fact. Indeed, the KDE for Windows maintainer Christian Ehrlicher announced that he won’t continue to contribute to the project any longer, but that doesn’t mean that the project has passed by. Christian already posted another entry for clearing some things on his previously post.

Furthermore the KDE project itself, released a clarification post:

Even though KDE on Windows is only a small project and the loss of one developer will be felt, we are far from dead. The Windows port has not been a one-man-project and many other people are still involved. KDE on Windows will continue to be developed and packages will continue to be made.

The rumour of KDE on Windows stopping is not true and just harms our project. This clearly was not the intent of the blog post and we hope those reports will be corrected. At this point we also want to thank Christian for all the hard work he has done, for fixing bugs, making packages and of course also for making the platform accepted by KDE developers.

No Comments

Subversion Post-Commit Bash Madness

As I’ve started to develop a few bigger browser-based projects recently, I thought about setting up a version control system for keeping track of changes to source files, images and so on.

Since CVS ain’t fun when it comes down to web-based projects and GIT feels a bit too overdosed for my purposes, I made the decision to use SubVersion, which affords me to move files around without loosing their history and is still syntactically quite similiar to CVS.

Because of my job, I’m also used to a bug tracking system, namely Mantis, which can be feeded by a CVS post-commit hook with some extra data to each single bug-ID, and of course I wanted the same for my bug tracker. Like in CVS, there’s also a (per-repository) post-commit hook in SubVersion and so I followed the pervasive tutorials on the net, for getting this nifty feature running.

Sadly none of those tutorials worked for me in the way that I expected or that has been promised. Actually the hook was kinda self-explaining; stating the following commit should push a comment with the commit details to a certain id.

1
  $ svn commit -m"working on issue [#mantisid]" file

The corresponding post-commit script looked like that:

1
2
3
4
5
6
7
8
9
10
11
12
13
  #!/bin/bash
  REPOS="$1"
  REV="$2"
 
  SVNAUTH=$(svnlook author -r $REV $REPOS)
  SVNDATE=$(svnlook date -r $REV $REPOS)
  SVNLOG=$(svnlook log -r $REV $REPOS)
  SVNCHANGE=$(svnlook changed -r $REV $REPOS)
  n=$'\n'
 
  LOGMSG="Changeset [${REV}] for repo [${REPOS}] by ${SVNAUTH}${n}${SVNDATE}${n}${n}${SVNLOG}${n}${n}Changed Files:${n}${SVNCHANGE}"
  # echo $LOGMSG >> /tmp/svnchange.log
  /usr/bin/php5 -q /path/to/mantis/scripts/checkin.php <<< "$LOGMSG"

For some odd reason svnlook hasn’t been executed and the shell variables has been empty (and no, it wasn’t the fact that you’ve got a minimal environment in the post-commit script, neither setting up the PATH nor absolute paths changed the behaviour). As this is not strange enough, the following worked:

1
2
3
4
5
6
  #!/bin/bash
  REPOS="$1"
  REV="$2"
 
  SVNVERSION=$(svnlook --version);
  echo $SVNVERSION >> /tmp/svnversion.test

After some confusing and frustrating days, I found the following solution (sorry I know that is more than just mean, actually it’s a bastard):

1
2
3
4
5
6
7
8
9
10
11
12
13
  #!/bin/bash
  REPOS="$1"
  REV="$2"
 
  SVNAUTH=`exec svnlook author -r $REV $REPOS`
  SVNDATE=`exec svnlook date -r $REV $REPOS`
  SVNLOG=`exec svnlook log -r $REV $REPOS`
  SVNCHANGE=`exec svnlook changed -r $REV $REPOS`
  n=$'\n'
 
  LOGMSG="Changeset [${REV}] for repo [${REPOS}] by ${SVNAUTH}${n}${SVNDATE}${n}${n}${SVNLOG}${n}${n}Changed Files:${n}${SVNCHANGE}"
  # echo $LOGMSG >> /tmp/svnchange.log
  /usr/bin/php5 -q /path/to/mantis/scripts/checkin.php <<< "$LOGMSG"

As mentioned this worked for me, but out of pure curiousity: why the fuck I needed to use a back-ticked-exec for svnlook, instead of a $()?

3 Comments
Page 1 of 812345...Last »

Browser Exception: Retarded Detected

Unfortunately I had to recognize that you are using a crappy piece of software that is called Internet Explorer. Even though this is not bad enough, you are also using a completely outdated version. As this retarded is not any longer supported by this site, you better should toddle off and do not return until you have downloaded a real browser:

Mozilla Firefox Web Browser Logo
Get Mozilla Firefox 3.5

If you do not want to use Firefox for some odd reason, you can choose one of these fine alternatives:

Most webkit/chrome/gecko based browsers should work well too.

If you are one of those hopeless creatures, who cannot get rid off that quirky tool of damnation, you should use at least Internet Exploiter 7 or 8. Both versions might be subject to rendering and/or javascript issues.

By closing this informational window, you will automatically redirected to: Get Mozilla Firefox 3.5