Backup Raspberry SD Card with MacOS
sudo dd if=/dev/disk2 of=/Volumes/example/raspberry.img bs=1m
Compress the file
gzip raspberry.img
gzip -dc ~/Desktop/pi.gz | sudo dd of=/dev/rdisk1 bs=1m
How to create a MySQL Dump
mysqldump -h localhost -u root -ppassword -c --add-drop-table --add-lock --all --quick --lock-tables [database_name] > sqldump.sql
Case insensitive BeanComparator
Transformer transformer = new Transformer() {
public Object transform(Object arg) {
return ((String)arg).toLowerCase();
}
};
Comparator comparator = new TransformingComparator(transformer);
Collections.sort(list, new BeanComparator("field", comparator));
http://www.opensubscriber.com/message/commons-user@jakarta.apache.org/2094876.html
Bash: execute commands in sequence
One command after another. An error will not stop the sequence: ;
cd /home/tipp/ ; ls
An error will stop the sequence:
cd /home/tipp/ && ls
All commands run at the same time
cd /home/tipp/ & ls
Backgrounded commands:
jobs
Also, handy commands:
bg
, fg
Ubuntu 12.04 TLS Update. Problem with JNI
After upgrading to Ubuntu 12.04, the location of the JNI library changed.
To solve this problem I removed the jni library:
apt-get purge libsvn-java
and reinstalled it:
apt-get install libsvn-java
After that I updated the following property in eclipse.ini:
-Djava.library.path=/usr/lib/x86_64-linux-gnu/jni
Maybe only the property in eclipse.ini should be changed.
Installing TEX and its tools on MacOS
TEX is a typesetting system that allows to produce high-quality books and provides a system that gives the same result on all computers. LATEX is the markup language used in the TEX typesetting system.
Steps to install it on MacOS:
- Download the Mac distribution, or the smaller distribution.
- After installing it, run the following commands:
sudo bash
PATH=/usr/local/texlive/2011basic/bin/universal-darwin:$PATH; export PATH
texhash
sudo tlmgr paper $PAPER
sudo fmtutil-sys --all
Where$PAPER
is either «letter» or «a4».
With the tool tlmgr
is possible to manage the TEX packages: update, install and remove them.
SSH Connect Timeout
Es ist etwa unbequem, wenn die ssh Verbindung nach 2 Minuten getrennt wird. Um das zu vermeiden, muss man die ssh_config Datei bearbeiten, in dem man die key ConnectTimeout
zu 0
setzt.
Virtual Box Virtual Image kopieren
VBoxManage clonevdi Origen.vdi Copia.vdi
Tomcat unter MacOS installlieren
1. Tomcat herunterladen.
2. Das Packet entpacken: $ tar -xzf apache-tomcat-6xxxx
3. Zu /user/local
schieben: $ mv apache-tomcat-6xxxx /usr/local
4. Für zukünftige Aktualisierungen man kann ein symbolisches Link erstellen: sudo ln -s /usr/local/apache-tomcat-6xxxx /usr/local/tomcat
5. Umfeld Variablen erstellen. In /etc/profile die folgende Befehle hinzufügen:
export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/usr/local/tomcat
Cron – Linux
Jobsteuerung von Linux, die wiederkehrende Aufgaben automatisch zu einer bestimmten Zeit ausführen kann.
Ein Nutzer kann cron nutzen wenn er in der Datei /etc/cron.allow
aufgelistet ist.
Crontab
Um die Crontab Datei zu bearbeiten:
VISUAL=vim crontab -e
Crontab Datei Format:
Minute Stunde Tag Monat Wochentag Befehl