Things the world should know:
- My .vimrc
Another backup of know-how…
I created this example some years ago. Since my old wiki is replaced by this blog I’ll post it here.
It was very handy for me recently – when I had to creat a graph with Perl (again).
You need to create charts like this?
Git ist ein Werkzeug zur Versionsverwaltung von Projekten, vergleichbar mit SVN und CVS.
Git bringt so einiges an Power unter der Haube mit sich, die Details kann aber jeder selber nachlesen.
Ein paar Fakten die einen neugierig machen könnten:
Ich möchte hier einfach kurz notieren wie einfach ein Einstieg ist. (Viel weiter bin ich ja auch noch nicht, aber ich brauchs bis jetzt auch nicht)
Nachdem ich Git installiert habe kanns los gehen. (Unter den gängigen Linux-Distributionen eine Sache von Sekunden)
The situation was as following: I had to work myself into the opensource HR-program OrangeHRM, had plenty of free time, and wanted to try how it is to develop a GUI-application for Linux.
All this circumstances led to the development of a small program which I call orgcreator.
What the program actually does: It looks up the personnel data from OrangeHRM and creates a picture of the company structure.
Mehrere PDF’s zusammenfügen?
Das geht ganz einfach mit pdftk.
So habe ich z.B. für meinen Lebenslauf alle Zertifikate als PDF einzeln gescannt. Für den fertigen Lebenslauf kette ich alles zusammen in ein Dokument:
pdftk *.pdf cat output bewerbung.pdf
Vier Seiten auf eine? PDF um-formatieren für Handouts geht mit pdfnup aus dem Paket PDFJam, welches hilfreiche Scripts anbietet (hier gefunden).
pdfnup --nup 2x2 myfile.pdf
PDFJam enthält auch noch pdfjoin welches das gleiche macht wie oben und pdf90 zum rotieren.
Schnell und einfach, so haben wir es gerne!
Für Leute mit Shell-Erfahrung, ohne Worte!
Einfach, schnell und effektiv 🙂
for i in `mysql -B -h $HOST -u $USER -p $PW $DATABASE -e "show tables"| tail -n +2`;
do
echo "Dumping $i"
mysqldump -h $HOST -u $USER -p $PW $DATABASE $i > $i.sql
done
for i in `ls *.sql`
do
echo "Processing $i"
mysql $DATABASE -h $HOST -u $USER -p $PW < $i
done
Here is a script which shows how colors are used:
#!/bin/sh
############################################################
# Nico Golde <nico(at)ngolde.de> Homepage: http://www.ngolde.de
# Last change: Mon Feb 16 16:24:41 CET 2004
############################################################
for attr in 0 1 4 5 7 ; do
echo "----------------------------------------------------------------"
printf "ESC[%s;Foreground;Background - \n" $attr
for fore in 30 31 32 33 34 35 36 37; do
for back in 40 41 42 43 44 45 46 47; do
printf '\033[%s;%s;%sm %02s;%02s ' $attr $fore $back $fore $back
done
printf '\n'
done
printf '\033[0m'
done
Just run the script in your terminal and see the result.
The shown numbers can be used to color the background or foreground of output.
Ever wondered how to write a script that you can pipe stuff in? Here you go:
while read LINE;
do
echo $LINE
done
Basic stuff you’ll need if you write a script that uses arguments. Just try it to see what happens.
echo arglist: $*
echo amount: $#
echo scriptname: $0
echo arg1: $1
echo arg2: $2
Here’s an example how you can loop trough all arguments using $*.
for i in $*
do
#will echo all the variable passed as parameters
echo $i
done
I often need to look up the chapters here when I’m programming. Here I list all the daily perl-stuff that makes life much more easy.