Bash highlighting in LaTeX with minted

Today I ran into a nasty problem while highlighting Bash code in a LaTeX document with minted.

I had a $ sign within a comment but this character gets rendered as a £. I took me about 2 hours on Google to find what causes his problem: The font, which is used for the comments. The $ is only available in the normal type setting but the comments are printed in italic style which leads to the £.

There are multiple solutions to fix that, let's call it, bug:

  1. Change the font for the listings
  2. Create your own Pygments style
  3. Change the comment to don't include a $

This blog post hopefully helps you and prevents you from wasting time to find a solution.

Markus

 

[Update 6] ubuntuusers.de – Spendenaktion für eine neue Serverinfrastruktur

Das Communityprojekt ubuntuusers.de ruft aktuell mit Hilfe der Thomas-Krenn.AG zu Spenden für eine neue und besser Serverinfrastruktur auf. Auf diesen Server laufen neben ubuntuusers.de auch noch viele andere Webseiten und Dienste, wie zum Beispiel die Seiten vom ubuntu Deutschland e.V. oder der Ubucon. Aber auch verschiedene Mailinglisten und internationale Projekte rund um Ubuntu laufen auf den Servern.

Damit das Wiki von ubuntuusers.de, was als das beste deutschsprachige Wiki zu Ubuntu und Linux allgemein gilt, und das Forum mit über 4 Millionen Beiträgen von mehr als 130.000 Benutzern auch weiterhin eine sichere Zukunft haben, ist jeder aufgerufen sich finanziell zu beteiligen. Die anvisierte Summe beträgt 12.000€ und sichert das Fortbestehen die nächsten Jahre.

Ich habe dazu mal drei Logos gebastelt, die alle auf dem offiziellen ubuntuusers.de Logo aufbauen:

ubuntuusers.de Spendenaktion – Postit 1

ubuntuusers.de Spendenaktion – Postit 2

ubuntuusers.de Spendenaktion – Postit 3

Update 1: Die erste Zwischensumme aller Überweisungen bis zum 30.04. und der Paypal Zahlungen bis zum 01.05. um 10:30 Uhr hat überrascht: in weniger als einer Woche sind 5.357,92 Euro (44,65%) zusammengekommen. Dafür bereits ein großes Dankeschön an die Community.

Update 2: Die nächste Zwischensumme ist beachtlich: 10.184,02 Euro und damit 84,87% des Ziels. Der Betrag ...

 

Eclipse crashes on Arch Linux (II)

Two months ago, I explained a solution for my Eclipse that crashes on Arch Linux. Today I ran into the same problem again. The solution seems to be to change the environment variables which influence the malloc() behavior. The man page for mallopt() (man 3 mallopt) gave me some hints.

#!/bin/sh

export M_CHECK_ACTION=0
export MALLOC_CHECK_=0

 

[Update] My own IPv6 tunnel broker.

Some days ago I needed to test a web application on its IPv6 support. But since my Internet service provider only gives me an IPv4 address, I was not able to test the application. So, I thought about registering at SixXS to get an IPv6 address. But then I thought about setting up my own broker. After some time I found a nearly perfect tutorial that uses OpenVPN.

I took the scripts from that tutorial and stored them on my server and client, set everything up as explained and ... didn't got it working :(. I must say, that I had limited time to completely understand what was going wrong, so I stop trying.

Last weekend I had some hours to work on the IPv6 tunnel broker again and finally got it working. So, here are my scripts and a short explanation.

Update: I did some improvements and enhancements on the scripts and pushed them to a Github repository. Feel free to fork and report issues.

Server

  • You need a dedicated OpenVPN account if your OpenVPN does not run as root. You must give this user full password-less sudo access to /sbin/ip: openvpn ALL=(ALL) NOPASSWD: /sbin/ip
  • You must ...

 

Update: InyokaEdit

Am vergangenen Samstag hat der Benutzer Shakesbier auf ubuntuusers.de das Programm InyokaEdit veröffentlicht.

InyokaEdit ist ein offline Markup-Editor für Texte, die mit der Inyoka-Syntax formatiert werden. Also primär für Internetseiten geeignet, die auf Inyoka aufsetzen.

Neben den offiziellen Debian Paketen, die man von Launchpad herunterladen kann, habe ich ein ArchLinux PKGBUILD erstellt welches im AUR zu finden ist.

Update: Und hier habe ich noch ein PKGBUILD für die aktuelle Entwicklungsversion: https://aur.archlinux.org/packages.php?ID=57189

Markus

 

Eclipse crashes on Arch Linux

Today I had a strange problem creating a new project in Eclipse.

Right after closing the "New Project" wizard by clicking on Finish, Eclipse terminates. So, instead of starting Eclipse via krunner, I called Eclipse from the command line. And by clicking on Finish, Eclipse terminates again. The terminal shows a segmentation fault in the file /usr/lib/libgobject-2.0.so which belongs to glib2 and which occurs within a Java Native Interface (JNI) call. Hence a failed memory access leads to a termination of the complete Java virtual machine (JVM). Looking at the recent updates I couldn't find a solution.

But asking around (thanks Fuchs), I got the suggestion to run eclipse with

export MALLOC_CHECK_=1
eclipse

Well, what to say, that works, at least for the things I tried :)

To make this change taking effect upon next login, create a file ~/.kde4/env/vars.sh with the following content:

#!/bin/sh

export MALLOC_CHECK_=1

Now make the file executable:

chmod +x ~/.kde4/env/vars.sh

But what about this environment variable MALLOC_CHECK_: The manual page of the malloc() function explains it like this:

Recent versions of Linux libc (later than 5.4.23) and glibc (2.x ...

 

Apache Mahout 0.6 veröffentlicht

Heute hat die Apache Software Foundation (ASF) das Machine-Learning-Framework Mahout in Version 0.6 veröffentlicht. Es gab viele Fehlerbehebungen und Verbesserungen. Insgesamt wurde 182 JIRAs geschlossen. Dazu zählen unter anderem die Fehlerreports [MAHOUT-807] - Wrong prefixes in PrefixAdditionFilter und [MAHOUT-809] - Bad bug in ChunkedWriter von Florian Bausch.

Interessant sind aber auch die Reports [MAHOUT-890] - Performance issue in FPGrowth und [MAHOUT-921] - FPG uses a lot of boxed primitives - this patch eliminates a bunch of List<Integer>, die einige, teils gravierende, Probleme im implementierten FP-Growth Algorithmus beheben.

Hier noch die Mail von der Mailing Liste:

Apache Mahout has reached version 0.6. All developers are encouraged to begin using version 0.6, as much has changed and will continue to do so as we march inexorably toward a 1.0 release. Highlights of 0.6 include:

  • Improved Decision Tree performance and added support for regression problems
  • New LDA implementation using Collapsed Variational Bayes 0th Derivative Approximation
  • Reduced runtime of LanczosSolver tests
  • K-Trusses, Top-Down and Bottom-Up clustering, Random Walk with Restarts implementation
  • Reduced runtime of dot product between vectors
  • Added MongoDB and Cassandra DataModel support
  • Increased efficiency of parallel ALS matrix factorization
  • SSVD enhancements
  • Performance improvements in RowSimilarityJob, TransposeJob
  • Added numerous clustering display examples ...

 

Security bug in X.Org

After I read this blog post, I tried it out on my Arch Linux installation. And, well, it worked :(

If your screensaver is locking your computer, you can press Ctrl + Alt + <Multiply key on the Numpad> and the screensaver disappears without requesting a password.

To fix this problem, I opened the file /usr/share/X11/xkb/compat/xfree86 and commented out the lines 44 to 49

    interpret XF86_Ungrab {
        action = Private(type=0x86, data="Ungrab");
    };
    interpret XF86_ClearGrab {
        action = Private(type=0x86, data="ClsGrb");
    };

so that they look like this:

//    interpret XF86_Ungrab {
//        action = Private(type=0x86, data="Ungrab");
//    };
//    interpret XF86_ClearGrab {
//        action = Private(type=0x86, data="ClsGrb");
//    };

The package that this file belongs to is xkeyboard-config. This are the information that I can provide to this package, according to my installation:

# pacman -Qi xkeyboard-config
Name           : xkeyboard-config
Version        : 2.4.1-3
URL            : http://www.freedesktop.org/wiki/Software/XKeyboardConfig
Licenses       : custom
Groups         : None
Provides       : xkbdata
Depends On     : xorg-xkbcomp
Optional Deps  : None
Required By    : libxklavier  xorg-server-common
Conflicts With : xkbdata
Replaces       : xkbdata
Installed Size : 5640.00 KiB
Packager       : Florian Pritz <bluewind@xinu.at>
Architecture   : any
Build Date     : Thu 19 Jan 2012 10:56:02 AM CET
Install Date   : Thu 19 Jan 2012 07:08:56 PM ...

 

Amarok spielt keine MP3 Dateien ab

Nachdem ich vor Kurzem meinen PC neu aufgesetzt habe, wollte ich eben mit Amarok ein paar Songs abspielen. Jedoch hat sich Amarok beschwert, dass Phono die MP3s nicht abspielen kann.

Ich nutze auf meinem Arch System extra/phonon-gstreamer als Sound Backend für KDE.

Nach etwas Recherche hat sich herausgestellt, dass ich nur die passenden Plugins für GStreamer installieren muss :)

# pacman -S gstreamer0.10-base-plugins gstreamer0.10-ffmpeg

 

Apache Hadoop 1.0 available

On December 27th, 2011, the Apache Software Foundation made the first major release verison of Apache Hadoop available. The release notes of the 1.0.0 version show lots of development activities and list a huge number of resolved bugs.

Apache Hadoop is a Java software that allows users to store and work with petabytes of data and run programs in a Google developed MapReduce environment.

In MapReduce programs the data is processed in key-value pairs. During the Map process, which runs in parallel on the input data, the key-value-pairs are grouped to lists: Map(k1,v1) → list(k2,v2). All lists with the same key are then collected during the Reduce step and the computation over the values for the same keys return either a single value or an empty result: Reduce(k2, list (v2)) → (k3,v3).

The following canonical code snipped was provided by Google and counts the occurrences of every word within a set of documents:

void map(String name, String document):
  // name: document name
  // document: document contents
  for each word w in document:
    EmitIntermediate(w, "1");
 
void reduce(String word, Iterator partialCounts):
  // word: a word
  // partialCounts: a list of aggregated partial counts
  int sum = 0;
  for ...