Bash: Rename all files in current directory to lowercase

Just some code i used to rename my holiday pictures to lowercase.

find ./* -type f -maxdepth 0 | while read upName; do loName=`echo "${upName}" | tr '[:upper:]' '[:lower:]'`; mv "$upName" "$loName"; done

find lists all files in current directory. -type f lists only files, not directorys.

The while loop iterates over the file list.

echo | tr makes the filename variable lowercase.

mv finally moves the file.

Thanks to Veikko for the maxdepth hint.

Bash: Sleepsort Algorithm

Some code that a friend showed to me was this:

#!/bin/bash

function f() {
  sleep "$1"
  echo "$1"
}

while [ -n "$1" ]
do
  f "$1" &
  shift
done

wait

Example:

./sleepsort 9 3 7 1 3 2 4 7 4 6

He called it "sleepsort". And somehow, it really works. Not the fastest, but it works.

Wie man Videos von Youtube, Vimeo und Co. unter Ubuntu kinderleicht abspeichern kann.

Von einem Mitstudenten habe ich im Blog einen Artikel gefunden, der zeigt wie einfach man unter Ubuntu Videos von Webseiten lokal abspeichern kann.
http://jumplink-share.blogspot.com/2011/01/webvideos-ohne-zusatzsoftware-auf-die.html
Es wird keine Zusatzsoftware benötigt und es ist so einfach dass man sich problemlos daran erinnern kann.
Danke JumpLink!

MySQL: Save RAM by disabling InnoDB

If you run a MySQL Server and have not much RAM, like in a OpenVZ Container or VirtualServer, there is some saving possibility by disabling InnoDB in your my.cnf.
By default InnoDB Engine is enabled and uses about 100MB of RAM. You can disable InnoDB in your /etc/mysql/my.cnf with the keyword "skip-innodb".
But check first if there are any databases with InnoDB Tables in your MySQL Server. They will stop working if you just disable it.

Linux: How i satisfied a windows user with Ubuntu

A few days ago, a friend of mine had a hard disk failure. Luckily, i had a old disk i could offer for replacement. But instead of installing Windows XP or Windows 7, my friend wanted to try Ubuntu Linux.

In the following post, i will mention some programs and tips to satisfy a windows user with Ubuntu Linux.


|Den ganzen Beitrag lesen...

Auto: Meine Tux Auto-Fahne

Jetzt zur WM 2010 in Südafrika gab es kaum ein Auto ohne Auto-Fahnen zu sehen. Dies hat mich auf eine Idee gebracht ...

|Den ganzen Beitrag lesen...

Ubuntu: Howto move min/max/close buttons to the right in Ubuntu Lynx 10.4

With version 10.4 Ubuntu design team decided to move the minimize/maximize/close buttons to the left. Maybe to look like mac. For everybody who do not like this and want their buttons back on the right, follow the instructions.

|Den ganzen Beitrag lesen...

Verkaufe Bücher!

Ich habe ein paar Bücher im Regal aussortiert die ich nicht mehr benötige. Schaut euch einfach die Liste an.

|Den ganzen Beitrag lesen...

Auto: Opel Corsa C Kurbelwellensensor austauschen

Auf dem Weg nach Hause habe ich es das Erste mal bemerkt. Beim Rollen zu einer Roten Lichtzeichenanlage (Ampel) ist der Motor einfach ausgegangen. Ich hab mir nichts weiter bei gedacht und den Motor wieder gestartet. Doch ab dann hat die Motorkontrolleuchte (MKL) geleuchtet (nicht geblinkt!). Ein paar Kilometer weiter leuchtete dann auch noch die Abgaskontrolleuchte (AKL) und der Drehzahlmesser hat nichts mehr angezeigt.
Ab dann war mir klar dass da irgendwas an dem Auto nicht in Ordnung ist.
Wer wissen will wie ich das Auto wieder repariert habe, der lese einfach weiter...

|Den ganzen Beitrag lesen...

PHP: Micro vs. Macro optimization, or "Get the low hanging fruit first"

After using and developing PHP for a few years now, i heard pretty much stuff about optimization, special technice's and other myths and fairy tales. But this article is not about tips or tricks, it is about if this the real key to better performance.

|Den ganzen Beitrag lesen...