<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Martinʼs Blog</title>
	<link>http://www.martin-ueding.de/site</link>
	<description>physics, computers, photos and security</description>
	<lastBuildDate>Sat, 04 Feb 2012 17:44:19 +0100</lastBuildDate>

	<language>en</language>
	<item><title>publishing mp3 packer</title><link>http://www.martin-ueding.de/site/120204-mp3_packer.html</link><pubDate>Sat, 04 Feb 2012 00:00:00 +0100</pubDate><description><![CDATA[
<p>A while ago I built <code>mp3-packer</code> to compress my whole music library to fit onto a small memory card. Today I pushed it to github.</p>

<!-- more -->

<p>It creates a whole copy of your music library, just with a smaller bitrate.</p>

<p>More information about its use as well as the code it <a href="https://github.com/martin-ueding/mp3-packer">at github</a>.</p>
]]></description></item><item><title>unwrap multi page PDF into original JPEG files</title><link>http://www.martin-ueding.de/site/120203-unwrap.html</link><pubDate>Fri, 03 Feb 2012 00:00:00 +0100</pubDate><description><![CDATA[
<p>A lot of my documents are scanned, and I used to save them as JPEG files and then combine them into a single PDF for better handling.</p>

<p>The downside is that I cannot do anything with the original JPEG images any more, and I did not keep those. Luckily, there is a nice tool called <code>pdfimages</code>.</p>

<!-- more -->

<p>Since I like my files to be numbered with an <code>+1</code>, <code>+2</code>, and so forth, I wrote a script that unwraps the image files from the PDF and numbers them for me.</p>

<p>More information and the script is <a href="https://github.com/martin-ueding/unwrap-pdf-to-jpeg">at github</a>.</p>
]]></description></item><item><title>convert Adium logfile into pidgin format</title><link>http://www.martin-ueding.de/site/120202-adium2pidgin.html</link><pubDate>Thu, 02 Feb 2012 00:00:00 +0100</pubDate><description><![CDATA[
<p>This is another weekend project.</p>

<p>In case you have some chat logs from the Mac OS X chat client <em>Adium</em> that you
want to convert into format of the multi platform <em>Pidgin</em> client, this tool
might be handy for you.</p>

<p>The code and more information can be found <a href="https://github.com/martin-ueding/adium2pidgin">at github</a>.</p>
]]></description></item><item><title>view multiple images as a multipage document</title><link>http://www.martin-ueding.de/site/120115-multiimage.html</link><pubDate>Sun, 15 Jan 2012 00:00:00 +0100</pubDate><description><![CDATA[
<p>A lot of my scanned images are plain JPEG files. When I have a multiple page document, it will become multiple images.</p>

<p>One could join them into a single PDF file, but I'd rather have the original files since images in PDF usually look blurrier. With text, it makes it harder to read.</p>

<p>Browsing through multiple images is not a problem with programs like <em>Gwenview</em> or <em>Eye of Gnome</em>. The only thing is that they display them fitting to the window. If you zoom, they will center. This might be natural for pictures, but not for a document.</p>

<!-- more -->

<p>Opening a single picture in <em>Okular</em> yields what I need: Fit to page width, starting at the top of the image. Unfortunately, <em>Okular</em> does not support multiple image files, and that is <a href="http://bugs.kde.org/show_bug.cgi?id=183102">not going to change</a> either.</p>

<p>This is a little script that generates a HTML page which combines all those images. A web browser starts at the top of the screen and is able to fit images to width of the window.</p>

<h2>Usage</h2>

<p>It assumes that your images are numbered like this:</p>

<pre><code>physik111-03-korrigiert+1.jpg
physik111-03-korrigiert+2.jpg
physik111-03-korrigiert+3.jpg
physik111-03-korrigiert+4.jpg
physik111-03-korrigiert+5.jpg
physik111-03-korrigiert+6.jpg
</code></pre>

<p>They have to have the exact same name, just differ by the number behind the <code>+</code> sign.</p>

<p>Call it with any of the images, it will figure out the whole sequence.</p>

<pre><code>multiimage physik111-03-korrigiert+5.jpg
</code></pre>

<h2>Download</h2>

<p>The code is at <a href="https://github.com/martin-ueding/multiimage">github</a>.</p>

<h2>Example</h2>

<p>And this is what it looks like:</p>

<p><img src="http://martin-ueding.de/site/uploads/2012/multiimage.png" alt="" title="" /></p>
]]></description></item><item><title>Export your files before it is too late</title><link>http://www.martin-ueding.de/site/120104-file_formats.html</link><pubDate>Wed, 04 Jan 2012 00:00:00 +0100</pubDate><description><![CDATA[
<p>When I had my Mac, I would use programs like Keynote, Pages and third party software like Mindnode. Now I use Linux and do not have regular access to those programs any more. Therefore, I need to convert them into PDF or the likes.</p>

<p>Those files are all over my hard drive. Some of them already have a PDF exported, some do not. In order to find those, that still need a PDF exported, I wrote a <a href="https://github.com/martin-ueding/legacy-file-formats">little Python script you can find at GitHub</a>.</p>

<!-- more -->

<p>It searches through the current directory (or any folders you specify on the command line) an searches for files that are not easy to open on Linux.</p>

<p>Say you have <code>presentation.odp</code> but want to have a corresponding PDF to it. The script will check for a <code>presentation.odp.pdf</code>. In case that is not there, it will resort to <code>presentation.pdf</code> and rename it to <code>presentation.odp.pdf</code> to make clear that it is exported.</p>
]]></description></item><item><title>git-changelog moved to github</title><link>http://www.martin-ueding.de/site/111221-git_changelog.html</link><pubDate>Wed, 21 Dec 2011 00:00:00 +0100</pubDate><description><![CDATA[
<p>Today, I pushed my repo of git-changelog to
<a href="https://github.com/martin-ueding/git-changelog">github</a>. You can get the
latest version there. There is no longer a project page on this server.</p>
]]></description></item><item><title>git-changelog revisited</title><link>http://www.martin-ueding.de/site/111105-git_changelog_revisited.html</link><pubDate>Sat, 05 Nov 2011 00:00:00 +0100</pubDate><description><![CDATA[
<p>A while ago, I mentioned the <a href="110926-git_changelog.html">git-changelog</a> script. Today, I created a
small <a href="../git-changelog/">project site</a> for it and made it more robust against unsigned tags
or lightweight tags.</p>

<!-- more -->

<p>It will now only use the tags that are in your current branch. If you have two
branches for two versions of your program, like <code>v2-series</code> and <code>v3-series</code>,
you do not want the versions that start with a 3 to show up in your other
changelog.</p>

<p>In case you want them all, there is an <code>--all</code> option now.</p>

<p>And if you want more control, you can specify a regex with the <code>--filter</code>
option. But as always: Using a regex often creates more problems than it
solves. ;-)</p>
]]></description></item><item><title>Uni Bonn Computer Setup</title><link>http://www.martin-ueding.de/site/111024-unibn_setup.html</link><pubDate>Mon, 24 Oct 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>This is something regarding students at the University of Bonn using Linux.</p>

<p>The <a href="/download/unibn_setup">unibn setup</a> script will help you configure the VPN
client on a Ubuntu or Fedora installation. It will also install emacs, LaTeX
and gnuplot and at your option also set the ROOT statistics package up for you.</p>

<!-- more -->

<p>To use this script, open a terminal, either via <code>CTRL+ALT+T</code> or Menu ->
Accessories -> Terminal.</p>

<p>Then these commands will download and execute the script.</p>

<pre><code>wget http://martin-ueding.de/download/unibn_setup
bash unibn_setup
</code></pre>

<p>Please read the on screen instructions, the script asks a couple questions :-)</p>

<p>The script is published under the Modified BSD License, feel free to
redistribute or change it as long as you mention that I created it initially.</p>
]]></description></item><item><title>include() vs. functions</title><link>http://www.martin-ueding.de/site/111018-include.html</link><pubDate>Tue, 18 Oct 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>A couple days ago, I had an intriguing conversation with somebody who disclosed
some secrets about PHP. He told me that he does not use functions but rather
include files, since a function file would have to be included and since
something has to be included anyway, there was no need for the function after
all.</p>

<!-- more -->

<p>I always thought that a function is cleaner than an include file which inherits
all your variables and changes them without you noticing by chance. A function
is encapsulated so that this would not happen. Recursion should be out of the
question with include files, or at least it seems very cumbersome to me.</p>

<p>Anyway, one of the things that I learned from Steve McConnel's books is that
you should not "optimize" something unless you can show that it is really
faster or better than before. In order to be fair I put together a little test
case for the claim regarding include files.</p>

<p>It basically has a very simple code snipped that I wrapped up into a simple
include file <code>foo.php</code>, a similar snippet that I wrapped up in a function
(<code>foo2.php</code>). Then there is the <code>test.php</code> which does the magic.</p>

<h2><code>test.php</code></h2>

<pre><code>&lt;?php
# Copyright (c) 2011 Martin Ueding &lt;dev@martin-ueding.de&gt;

$count = 10000;

# Start with including the code snippet $count times.
$start = microtime(true);
for ($i = 0; $i &lt; $count; ++$i) {
    include('foo.php');
}
$duration_include = microtime(true)-$start;
# End include part.

# ------------------------------------------------------

# Begin function part.
$middle = microtime(true);

# Define the function.
require_once('foo2.php');

# Call the function.
$second = microtime(true);
for ($i = 0; $i &lt; $count; ++$i) {
    foo($i);
}

$duration_function = microtime(true)-$second;
$duration_function_and_require = microtime(true)-$middle;
# End function part.

# ------------------------------------------------------

# Print the report.
print "include:\t\t".$duration_include."s\n";
print "function:\t\t".$duration_function."s\n";
print "function+require_once:\t".$duration_function_and_require."s\n";
print "\n";
print "The include method is "
    .($duration_function_and_require/$duration_include)." times faster.\n";
print "The function method is "
    .($duration_include/$duration_function_and_require)." times faster.\n";
</code></pre>

<h2><code>foo.php</code></h2>

<pre><code>&lt;?php
$k = 1;
$y = 2*$k;
?&gt;
</code></pre>

<h2><code>foo2.php</code></h2>

<pre><code>&lt;?php
function foo($i) {
    $y = 2*$i;
}
?&gt;
</code></pre>

<h2>Results</h2>

<p>This is what my machine came up with:</p>

<pre><code>include:                0.3787100315094s
function:               0.026961803436279s
function+require_once:  0.027056932449341s

The include method is 0.071444984811999 times faster.
The function method is 13.99678371591 times faster.
</code></pre>

<h2>Conclusion</h2>

<p>I would say that it does not make too much sense to avoid functions just to
save a couple of lines of code. Abstraction comes with a penalty, but I think
that it is worth it.</p>
]]></description></item><item><title>git-changelog</title><link>http://www.martin-ueding.de/site/110926-git_changelog.html</link><pubDate>Mon, 26 Sep 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>For my <a href="/jscribble/">jscribble</a> project, I use git. The human readable changes are
stored in the annotated tags itself. So I have a tag called <code>v1.5.3</code> which
contains the text that you can read in the changelog. That way, the information
is not spread out in the git repository (the microscopic changes) and the
changelog file (the macroscopic changes).</p>

<!-- more -->

<p>In order to generate a changelog file, I had to tinker a little. As it seems,
there was no easy way to get all the tags together with their descriptions. I
created a script called <code>git-changelog</code> which takes all the tags, reverses them
and gets their descriptions:</p>

<pre><code>#!/bin/bash
# Copyright (c) 2011 Martin Ueding &lt;dev@martin-ueding.de&gt;

set -e
set -u

for tag in $(git tag | tac)
do
    if [[ $tag =~ v?[0-9]+(\.[0-9]+)* ]]
    then
        git show $tag | parse_tag_object
    fi
done
</code></pre>

<p>Each tag description is passed through the <code>parse_tag_object</code> script, which
strips all the irrelevant git information (the commit id, the whole patch, time
and author) as well as the GnuPG signature and generates a clean changelog:</p>

<pre><code>#!/usr/bin/python
# -*- coding: utf-8 -*-

# Copyright (c) 2011 Martin Ueding &lt;dev@martin-ueding.de&gt;

import sys
import itertools

def main():
    for line, i in zip(sys.stdin, itertools.count()):
        if line == "-----BEGIN PGP SIGNATURE-----\n":
            sys.exit(0)

        if i &gt;= 4:
            print "\t"+line,
        elif i == 0:
            print line[4:-1]


if __name__ == "__main__":
    main()
</code></pre>

<p>This assumes that all your numeric tags are indeed version numbers and that you
have signed all of your tags.</p>

<p>The generated changelog contains this:</p>

<pre><code>v1.5.3
    * Add Java Webstart.
    * Create extensive manual page.
    - Fix drawing dots (broken since v1.5.2).
    - Allow movements with extra mouse buttons (enable in config).
    - Add config option to disable eraser.
</code></pre>

<p>That was extracted from the output of <code>git show v1.5.3</code>:</p>

<pre><code>tag v1.5.3
Tagger: Martin Ueding &lt;dev@martin-ueding.de&gt;
Date:   Sun Sep 25 12:46:31 2011 +0200

* Add Java Webstart.
* Create extensive manual page.
- Fix drawing dots (broken since v1.5.2).
- Allow movements with extra mouse buttons (enable in config).
- Add config option to disable eraser.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAABAgAGBQJOfwaJAAoJEB64QqUqUa0tDCQH/AxpYUD4UZg5wFR/6tAhEDrr
VQGrBEYoQ3IN2mnHHH9SO/sDvyFa90j3uR57gfNgE1R+i5nC1c6r90nujedAJum7
…
</code></pre>

<p>To use this, download the <a href="/download/git-changelog/git-changelog_1.0.tar.gz">tarball</a> and put both files in your path. You
need Bash and Python and obviously git.</p>
]]></description></item><item><title>The (Almost) Infinite Notebook</title><link>http://www.martin-ueding.de/site/110629-notebook.html</link><pubDate>Wed, 29 Jun 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>When doing a derivation in math or just organizing my thoughts, I usually just
use pen and paper since it seems to be the fastest way to persist my thoughts.
Typing on a computer is great for great amounts of text, but making diagrams is
not that easy I think.</p>

<p>Since most of the paper that I write is not read after a day or so, I tried to
come up with a better way. Text on the computer can be easily deleted if you do
not need it any more, but you cannot erase pen from paper too easily.</p>

<!-- more -->

<p>My idea is that your computer can easily serve as an almost infinite notebook.
If you save pictures with the resolution of your screen, you can store millions
of pages. And they do not weigh anything. Ideally, you do not need to bring
paper to do your math homework, following a lecture or sketch something.</p>

<p>Since you cannot seriously draw with a mouse, you need to have something like a
pen tablet or a touch screen to make this work well.</p>

<p>You might say that using a graphics tablet is nothing new. Sure, there is
plenty of drawing software out there. But I just did not find one where you
cannot click on anything that makes your page disappear and can create a
reasonable number of images (i.e. pages) with little effort.</p>

<p>So my software goes full screen on a netbook with 1024x600 pixels of
resolution. You can only control it with your keyboard. That way, you can draw
freely with your pen without worrying about accidentally clicking something.</p>

<p><img src="http://martin-ueding.de/site/uploads/110629/notebook.png" alt="" title="" /></p>

<p>If you have filled the whole screen, just press the arrow keys (or space bar or
enter) to advance in your virtual notebook. If you are at the end of it, at new
page is instantly created. That way, you will never run out of (virtual) paper.</p>

<p>You can organize your notesheets in notebooks that can individually hold as
many pages as you like. On startup you can choose the notebook that you want to
work in:</p>

<p><img src="http://martin-ueding.de/site/uploads/110629/chooser.png" alt="" title="" /></p>

<p>If you just need paper for scribbling, you can just enter the "scribble" mode.
You can go back and forth in this, but when you close it, it disposes all the
sheets.</p>

<p>In case you are interested in the program, please send me an
<a href="/kontakt/form.php">Email</a>. I'll be happy to send you a copy. You can also
<a href="/jscribble/">download the program and sources here</a>.</p>
]]></description></item><item><title>Hamburg</title><link>http://www.martin-ueding.de/site/110620-hamburg.html</link><pubDate>Mon, 20 Jun 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>This weekend, I visited Hamburg, DE</p>

<p><img src="http://martin-ueding.de/site/uploads/110620/110618-Hamburg-8093.jpg" alt="" title="" /></p>

<!-- more -->

<p>These are taken from the "Wunderwelt" miniture world:</p>

<p><img src="http://martin-ueding.de/site/uploads/110620/110618-Hamburg-8128.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110620/110618-Hamburg-8150.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110620/110618-Hamburg-8163.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110620/110618-Hamburg-8171.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110620/110618-Hamburg-8215.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110620/110618-Hamburg-8253.jpg" alt="" title="" /></p>
]]></description></item><item><title>New Backend</title><link>http://www.martin-ueding.de/site/110607-new_backend.html</link><pubDate>Tue, 07 Jun 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>I switched back to WordPress in September 2010, after I abandoned it a while
before that since it behaves so slow on my server. Today, I decided to move
away from WordPress once again, in favor of plain static pages.</p>

<!-- more -->

<p>There are redirections from the old pages to the new ones, so you should be
fine, even with the RSS feed except that every old post is doubled now.</p>

<p>There is nothing done on the server, it just serves generated webpages that
are generated with a set of makefiles, bash scripts, PHP and markdown. So this
should load a little faster than the five to seven seconds that WordPress took
before.</p>
]]></description></item><item><title>Göttingen, DE</title><link>http://www.martin-ueding.de/site/110606-goettingen.html</link><pubDate>Mon, 06 Jun 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>I spend this weekend in Göttingen, where I got to walk through the botanic
garden of the university.</p>

<p><img src="http://martin-ueding.de/site/uploads/110606/110603-Goettingen-7990.jpg" alt="market place" title="" /></p>

<!-- more -->

<p><img src="http://martin-ueding.de/site/uploads/110606/110603-Goettingen-7996.jpg" alt="a church" title="" /></p>

<p><img src="http://martin-ueding.de/site/uploads/110606/110603-Goettingen-8045.jpg" alt="bumblebee at work" title="" />
<img src="http://martin-ueding.de/site/uploads/110606/110603-Goettingen-8055.jpg" alt="more flower" title="" />
<img src="http://martin-ueding.de/site/uploads/110606/110603-Goettingen-8067.jpg" alt="spiky" title="" />
<img src="http://martin-ueding.de/site/uploads/110606/110603-Goettingen-8085.jpg" alt="herbs" title="" /></p>
]]></description></item><item><title>München, DE</title><link>http://www.martin-ueding.de/site/110602-munich.html</link><pubDate>Thu, 02 Jun 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>It's München, DE, this weekend.</p>

<h2>Olympia Park</h2>

<p><img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7756-600.jpg" alt="" title="" /></p>

<!-- more -->

<p><img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7753-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7782-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7803-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7845-600.jpg" alt="" title="" /></p>

<h2>BMW World</h2>

<p><img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7842-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7650-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7646-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7654-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110602/110529-Muenchen-7705-600.jpg" alt="" title="" /></p>

<h2>Schloss Nympfenburg</h2>

<p><img src="http://martin-ueding.de/site/uploads/110602/110530-Nympfenburg-7954-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110602/06/110530-Nympfenburg-7967-600.jpg" alt="" title="" /></p>
]]></description></item><item><title>Geneva, CH</title><link>http://www.martin-ueding.de/site/110522-geneva.html</link><pubDate>Sun, 22 May 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>While I was visiting CERN, I also went into downtown Geneva. Here are some of
the pictures.</p>

<p><img src="http://martin-ueding.de/site/uploads/110522/110518-Genf-7427-600.jpg" alt="" title="" /></p>

<!-- more -->

<h2>Jet d'eau</h2>

<p><img src="http://martin-ueding.de/site/uploads/110522/110518-Genf-7438-600.jpg" alt="" title="" /></p>

<h2>Horloge fleurie</h2>

<p><img src="http://martin-ueding.de/site/uploads/110522/110518-Genf-7440-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110522/110518-Genf-7421-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110522/110518-Genf-7463-600.jpg" alt="" title="" /></p>

<p><img src="http://martin-ueding.de/site/uploads/110522/110520-Genf-7570-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110522/110520-Genf-7579-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110522/110520-Genf-7604-600.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110522/110520-Genf-7599-600.jpg" alt="" title="" /></p>
]]></description></item><item><title>CERN</title><link>http://www.martin-ueding.de/site/110519-cern.html</link><pubDate>Thu, 19 May 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>This week I visted CERN in Geneva, CH.</p>

<p><img src="http://martin-ueding.de/site/uploads/110519/110515-CERN_Spaziergang-7314-800.jpg" alt="" title="" /></p>

<!-- more -->

<p>This is the ATLAS Control Building and its control room:</p>

<p><img src="http://martin-ueding.de/site/uploads/110519/110516-CERN-7341-800.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110519/110516-CERN-7337-800.jpg" alt="" title="" /></p>

<p>There is also a pretty newly built “globe” where one can explore the world of
particle physics.</p>

<p><img src="http://martin-ueding.de/site/uploads/110519/110515-CERN_Spaziergang-7308-800.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110519/110516-CERN-7361-800.jpg" alt="" title="" />
<img src="http://martin-ueding.de/site/uploads/110519/110516-CERN-7360-800.jpg" alt="" title="" /></p>

<p>It looks very nice at night.</p>

<p><img src="http://martin-ueding.de/site/uploads/110519/110518-CERN_bei_Nacht-7491-800.jpg" alt="" title="" /></p>
]]></description></item><item><title>Version Control Display in Shell Prompt</title><link>http://www.martin-ueding.de/site/110405-scmpromt.html</link><pubDate>Tue, 05 Apr 2011 00:00:00 +0200</pubDate><description><![CDATA[
<p>Version control is a neat thing when programming, but I sometimes forget which
project uses which system. So I have a lot of projects that use Bazaar and a
couple others that use Git. When I work on the command line, I would like to
know whether the current directory is version controlled and which system is
used.</p>

<!-- more -->

<p>One could use a simple <code>ls -A</code> and check whether some <code>.bzr</code> or <code>.git</code>
directory is present, but these are only in the root directory of your tree.
You could enter <code>git status</code> and see the error message if you were wrong, but
that does not help if you use Mercurial and Subversion on your machine as
well.`</p>

<p>I added a small <code>\$(~/bin/scmpromt.sh)</code> into my prompt in my <code>.bashrc</code>. This
causes the script to be executed each time the prompt is displayed. The script
basically contains the following:</p>

<pre><code>#!/bin/bash

CDIR=`pwd`

while [ "$CDIR" != "/" ]
do
    if [ -d "$CDIR/.bzr" ]
    then
        echo " bzr"
        exit 0
    fi

    # ... similar rules for .git, .hg, .svn ...

    CDIR=${CDIR%/*}
    if [ -z $CDIR ]
    then
        CDIR="/"
    fi
done
</code></pre>

<p>It basically checks for the <code>.bzr</code> directory (just as you would by hand) and
then goes up in the directory tree until it finds a directory. If it finds one,
it displays “bzr” which is then displayed right in the prompt:</p>

<pre><code>martin@iMac:~/Code/scmpromt bzr $
</code></pre>

<p>That way, I know that I used git on this project, and then can use the
appropriate commands.  You could also beef the script up with some colors, I
altered my prompt so that “git” show up in a dark yellow so that it does not
draws too much attention.  You can do this by wrapping the call to the prompt
like this:</p>

<pre><code>\[\033[00;33m\]\$(~/bin/scmpromt.sh)\[\033[00m\]
</code></pre>

<h2>showing the status of the working tree</h2>

<p>It would be really handy to know whether the current working tree had any
uncommited changes in it. The quickest hack was just to count the number of
lines in the status messages. Git only displays two or three lines for a clean
tree, Bazaar does not print anything. The hack looks like this:</p>

<pre><code>if [ "`git status | wc -l`" -le 3 ]
then
    echo " git✓"
else
    echo " git"
fi
</code></pre>

<p>It worked for me pretty good, but it is not safe at all since the output of
<code>git status</code> could change any time or display other lines like that the branch
it ahead of the origin. Another caveat is that this might take a lot of time,
and your promt will not display until the script is done. Especially with
Bazaar, you can wait around a second until the prompt shows up. Therefore, I do
not use this any more but rather enter <code>bzr st</code> by hand.</p>
]]></description></item><item><title>Bookmarkpage reached version 0.2</title><link>http://www.martin-ueding.de/site/110125-bookmarkpage.html</link><pubDate>Tue, 25 Jan 2011 00:00:00 +0100</pubDate><description><![CDATA[
<p>The personal start and bookmark paged rechached version 0.2 today, if you’d
like, you can download the version from
<a href="https://launchpad.net/personalphpbookmark/+download">Launchpad</a>.</p>

<p><img src="http://martin-ueding.de/site/uploads/110125/personalphpbookmark-0.2.png" alt="" title="" /></p>

<!-- more -->

<p>This release features my database installer, it should be fairly easy to
install the database with it.</p>

<p>One shortcoming in this version is that you cannot change the language on the
website, you would have to dive into the PHP files and alter the language
selection.</p>
]]></description></item><item><title>Project Ubernahme Game reached Version 0.4</title><link>http://www.martin-ueding.de/site/110124-pu_game.html</link><pubDate>Mon, 24 Jan 2011 00:00:00 +0100</pubDate><description><![CDATA[
<p>A couple months ago, friends and I started with a small game that would try to
combine all the aspects that we like in other games. We realized pretty quickly
that it is quite an endeavor. The game is not close to be done yet, but if you
like, you can take a look at version 0.4 which conveys a big part of the idea.</p>

<p><img src="http://martin-ueding.de/site/uploads/110124/pu-0.4.png" alt="" title="" /></p>

<!-- more -->

<p>You will find the most current release on the <a href="https://launchpad.net/projectubernahme/+download">Launchpad download
page</a>, you can even pull the
<a href="https://code.launchpad.net/~martin-ueding/projectubernahme/trunk">current developer
version</a> if
you like. You need Java 1.6 (sometimes referred to as “Java 6”) to play the
game.</p>

<p>The interface is not really intuitive so far, so please take a minute and read
<a href="http://www.martin-ueding.de/diverses/pu/usermanual/en/">the manual to the
game</a>.</p>

<p>I hope you like the game, feedback is appreciated!</p>
]]></description></item><item><title>Why Email Is Not Secure</title><link>http://www.martin-ueding.de/site/100926-email.html</link><pubDate>Sun, 26 Sep 2010 00:00:00 +0200</pubDate><description><![CDATA[
<h2>Comparison With Postcard</h2>

<p>There are certain things one would not write on a postcard. Like a password or
some personal secret. But some people write those things in emails. I would
like to show you how similar email and postcards are and how the messages could
be read by strangers. After that, I will show you some ways to protect your
emails.</p>

<h2>Where Can Email Be Attacked?</h2>

<p>A postcard can be read by everyone at any time. The mail man, somebody at the
mail office or even your neighbor, if he looked into you mailbox. The path of
an email is quite similar. It starts on your computer and is sent off to your
email provider. On the way to the email provider, the email goes through your
local network to your internet service provider (ISP). Then your email provider
sends the email to another email provider, where it goes the same way backwards
to the recipient.</p>

<!-- more -->

<p><img src="http://martin-ueding.de/site/uploads/100926/1-insecure.png" alt="" title="" /></p>

<p>As you can see, there are a lot of points on the way, and on each point the
email could be read – in principle. It is rather difficult to spy on the way
between the two email providers, but within your local network is quite easy.
The email provider could also read your emails easily, since it stores them all
for you.</p>

<h2>How You Can Protect Your Emails</h2>

<p>There are two concepts to protect your emails, one is used most of the time. It
you trust your and the recipient’s email provider, this gives good security. If
you access your emails via an encrypted connection, it means that the
communication cannot be seen (I assume that the encryption works, that would be
a whole different story) between you and the email provider. It is like putting
your postcards in a portable vault supplied by the central mail office. Anyone
in your local network and also your ISP will not be able to read the mails. In
the office example, this would protect you from your desk (but not including
it!) to the central mail office from the curious looks of co-workers or
somebody at the mail office in your company. It offer good security against
people spying in your network.</p>

<p>If the recipient uses the same, which is usually the case, the email should be
pretty private. There is still the option that one of the computers is lost,
and the emails can be read from it, since the email itself is not encrypted,
just the way. Common names for this is SSL, TSL, IMAPS and POPS.</p>

<p>All the points and connections which are colored green are secured with the SSL
approach:</p>

<p><img src="http://martin-ueding.de/site/uploads/100926/3-SSL.png" alt="" title="" /></p>

<p>The other method is to encrypt the email itself, like writing in a secret code
on the postcard. Then you could even send the mail without any protection,
since the email itself is encrypted. On your computer, the email is encrypted
as well, so it does not really matter, if your computer should be lost. At
least for the information in those emails.</p>

<p><img src="http://martin-ueding.de/site/uploads/100926/4-GnuPG.png" alt="" title="" /></p>

<p>The downside of this, it is implemented in PGP and S/MIME by the way, that both
the sender, as well as the recipient have to have some sort of secret code. In
PGP it is a secret key, in S/MIME it is a certificate you have to optain from
some sort of certificate authority and it usually costs some money. With SSL,
you just tick the “use encryption” checkbox, and you are done. In many web
interfaces, you do not even notice that the connection is encrypted.</p>

<p>As always, you have to weigh security against comfort. Once PGP is properly set
up, it is not any more work than a normal email. Before that, you have to
exchange keys or certificates, confirm that they actually belong to the owner
and so on. Your email provider already did all that for you with the SSL
connection encryption, but it does not extend all the way to the recipient.</p>

<p>If you would like to try it out, you can install a free PGP implementation,
namely GnuPG, generate a keypair and send me an encrypted email. You will find
my key (0x2A51AD2D) on keyservers and also in the „Contact“ section to
download.</p>
]]></description></item><item><title>WordPress. Again.</title><link>http://www.martin-ueding.de/site/100902-wordpress.html</link><pubDate>Thu, 02 Sep 2010 00:00:00 +0200</pubDate><description><![CDATA[
<p>Some of you might remember that I had WordPress installed on my website some
time ago. Since it did not run very fast on my server and I did not have any
content I wanted to publish, I took it offline and replaced it by a simple site
with just my contact data.</p>

<!-- more -->

<p>Today, I wanted to start off blogging again, but I thought to blog in English,
so that I could reach all my friends over the world. English might not be the
best language to reach people in Germany, but I still think it is the best
compromise.</p>
]]></description></item><item><title>CoconutBattery Exporter</title><link>http://www.martin-ueding.de/site/091222-cobaex.html</link><pubDate>Tue, 22 Dec 2009 00:00:00 +0100</pubDate><description><![CDATA[
<p>CoconutBattery is a little tool for Mac OS X that shows the battery capacity
for laptops, useful to see how far the battery degraded. There is a button to
save a snapshot, but one can only look at these snapshots in a list view within
the program. There is no meaningful export option.</p>

<!-- more -->

<p>The data is stored in a XML file a little buried in the user's library
directory (<code>~/Library/</code>). The data points look like this:</p>

<pre><code>&lt;object type="SAVEDDATA" id="z102"&gt;
    &lt;attribute name="date" type="string"&gt;2010-09-03&lt;/attribute&gt;
    &lt;attribute name="capacity" type="string"&gt;87 % (4742 mAh)&lt;/attribute&gt;
&lt;/object&gt;
</code></pre>

<p>Somebody asked whether there is a possibility to export them to CSV and I tried
to write a <a href="https://launchpad.net/cobaex">little program</a> that does this job.</p>
]]></description></item>	</channel>
</rss>


