Technik

cat as a shell builtin

Recently i blogged about how to get a process list if you aren’t able to fork any processes . Also a process list is allways handy, i allways find cat a very usefull tool too. But as you might have noticed cat is not a shell builtin. So everytime cat is called a new process needs to be forked. In case you can’t fork processes it’s a problem, and even if you can fork them you may save resources by “creating” a shell builtin cat.
So lets do this,
open your .profile for usage with your user only or /etc/profile for global usage (You may also use your .bashrc or .zshrc instead).
Append the following lines to the file:

#pseudo bash builtin cat function
function cat { echo “$(< $1)" }

Siehe Kommentar :)

More ...

Shortcut to lock the screen on a mac

Sometimes i don’t want to put my macbook air asleep because of some job that is running. But i have to leave the room so i need to lock it.
So there is a shortcut for locking the screen:

Shift+Crtl+Eject

This works on the most macs, but the macbook air has no Eject button on the Keyboard. So on systems without an Eject button you have to use:

Shift+Crtl+Power

How to get a process list if you can’t fork any processes?

Recently I got the question what to do if one got a bash session but can’t fork processes on a Linux system.
So here is an attempt to get a processlist just by using bash buildins:

OLDPWD=$PWD
cd /proc
for x in [0-9]*
do
read cmd < /proc/${x}/comm
read cmdl < /proc/${x}/cmdline
printf "%8s - %15s - %s" $x $cmd $cmdl
echo
done
cd $OLDPWD

some usefull commands to transfer files via tar & netcat

I recently needed to transfer some folders from one machine to an other via lan.
I could have used scp or rsync, but the cryptographic layer seems a kind of overhead to me, additonal the two pc’s weren’t the fastest. So netcat came into my mind, and I just wanted to share the commands i used (and keep them for a later use).
So here they are:

Linux version:
Recieve:
netcat -l -p 1234 | pv | tar x
Send:
tar cf - * | pv | netcat [ip] 1234
BSD version:
Recieve:
nc -l 1234 | tar -xpf -
Send:
tar -cf - * | nc [ip] 1234

[ FSyncMS ] Version 0.12 – Compatibilty

An mich wurden ein paar kleine Updates herrangetragen, (Vielen dank!!) die sich mal wieder zu einer neuen Version maifestieren.

Unter anderem Support für iPhone/iPod Touch devices.
(Ich kanns leider mangels Gerät nicht selbst testen)

Ansonsten wie immer viel Spaß :)

Download hier | Alte Anleitung für das Installieren ( mit SQLite-DB )

[ Android ] meine Top Apps

Nachdem ich breits mehrmals von Android berichet habe, und immer mal wieder merke das sowohl mir noch die ein oder andre coole app fehlt. Als auch das bekannten noch einige coole apps nicht bekannt sind, dachte ich es wäre mal an der Zeit meine Lieblings Apps festzuhalten.

– K9
Das Android-App urgestein, ein muss auf jedem Gerät.
Einfach die beste App wenn es um Sachen Email geht, und coole funktionen wie Email Push etc. kommen auch gleich mit.

More ...

Kontakt und Kalender Sync auf Android ohne Google

Vor einiger Zeit habe ich hier ( [ Sabredav ] Kalender und Kontakte in Sync mit Caldav und Carddav ) schon mal dargelegt wie man sich einfach seinen eigenen Carddav und Caldav Server aufsetzt. Dies ist für diverse Leute interessant sofern sie zwar ihre Daten zwischen mehreren Geräten ausgetauscht wissen möchten, aber gleichzeitig die Kontrolle über ihre Daten behalten wollen. Also ein abgeben selbiger an Dienstleister die alles für lau im Ausland speichern nicht in frage kommt.
Damals ging es vorallem um die Serverkomponente.

More ...

[ FSyncMS ] Version 0.11 – Setup Page

Stefan war fleißig und hat eine Setup-Page für den FSyncMS
gebaut.
Daraus ist Version 0.11 des FSyncMS erwachsen.

More ...

[ FSyncMS ] auf Github

Eigentlich war es ja mal als, “hey ich füge hier drei Zeilen hinzu” Projekt gedacht, dieses FSyncMS.
Und so war das ganze auch angelegt,
aber nach und nach wurden es immer ein paar Zeilen mehr,
und es gab immer wieder Leute die hier und da geholfen oder anregungen hatten.
Um dem gerecht zu werden wandert die Entwiklung des Projekts auf Github.
Ich hoffe das es dadurch leichter wird, gemeinsam den FSyncMS Source aktuell und funktionsfähig zu halten und zudem zu erweitern.

More ...

[ Firefox Sync ] explizit einige Settings syncen

Ist es euch schon aufgefallen ?
Jetzt haben wir so einen schönen FSyncMS Server und dann irgendein tolles Plugin, und trotzdem Syncen die Einstellungen des Plugins nicht.
Firefox Sync synchronisiert nämlich nicht alle Werte eurer Firefox config,
sondern nur manche.

Manchmal will man aber spezielle Settings Syncen,
von Addons zum beispiel, hier kann abgeholfen werden:
Im Mozilla Developer Network (hier) steht wies geht.
Einfach unter about:config, rechtsklicken und einen neuen Bool-Wert anlegen.
Den Namen wie folgt festlegen,
services.sync.prefs.sync.<pref>
wollen wir z.B. das Setting keyword.url syncen so müssten wir
services.sync.prefs.sync.keyword.url
anlegen und auf True setzen.

More ...

Archiv