#!/bin/sh echo 1 > /proc/sys/net/ipv4/ip_forward INET=”wlp3s0″ INETIP=”$(ifconfig $INET | sed -n ‘/inet addr/{s/.addr://;s/ .//;p}’)” iptables -t nat -A POSTROUTING -o $INET -j SNAT –to-source $INETIP
Tag Archives: Linux
Kivy
http://kivy.org Python-library based crossplatform development with focus on native input protocols and OpenGL Support. The even have a sort of my target ready made: https://github.com/stocyr/IcarusTouch
linux multitouch qt5 ubuntu 12.10
Literature https://wiki.ubuntu.com/Multitouch/Testing http://askubuntu.com/questions/182348/how-to-get-touchscreen-working-on-lenovo-ideacentre-a720 http://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt http://gabrbedd.wordpress.com/2012/07/10/getting-multitouch-qt-on-ubuntu-12-04/ How I got multitouch working with qt5 and ubuntu 12.10 on a Acer Netbook (Aspire 1825PTZ): Installed qt5-sdk-rc1 from http://releases.qt-project.org/qt5.0/rc2/qt-linux-opensource-5.0.0-rc2-x86-offline.run git clone git://gitorious.org/qt/qt5.git qt5 cd qt5/qtbase/src/platformsupport/input/evdevtouch/ edit evdevtouch.pri, uncomment DEFINES += USE_MTDEV compile qt5 according to instructions in http://qt-project.org/wiki/Building_Qt_5_from_Git Installation/replace current libs: cd ~/Qt5.0.0-rc1/5.0.0-rc1/gcc mv lib lib.no_mtdev ln -s ~/qt5/qtbase/lib/ […]
etherwake
sudo etherwake -b 00:26:6c:17:c4:2c
access sound server
The sound server has the adress 172.31.40.30 and is reachable within the VMK Network or trough vpn from remote. Copy sound files to the server This is done on the command line using the secure copy command scp. This will copy any file from your local harddisk into the home directory of the user vmk […]
mount iso image (loop) in fstab
root@files2010:~# cat /etc/fstab … /root/images/clonezilla-live-1.2.10-14-i686-pae.iso /liveiso/1 udf,iso9660 user,loop 0 0 /root/images/ubuntu-11.10-desktop-i386.iso /liveiso/2 udf,iso9660 user,loop 0 0 /root/images/ubuntu-11.10-desktop-amd64.iso /liveiso/3 udf,iso9660 user,loop 0 0
Nagios Client for RAID / OpenVZ without sudo
apt-get install nagios-nrpe-server nagios-plugins wget http://www.lsi.com/downloads/Public/SATA/SATA%20Common%20Files/cli_linux_10.2.1_9.5.4.zip unzip cli_linux_10.2.1_9.5.4.zip mv x86_64/tw_cli /usr/local/sbin/ root@vz2010:~# cat /etc/nagios/nrpe_local.cfg command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 command[check_raid]=/bin/cat /tmp/3ware command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 10M -c 20M -p /dev/sda1 command[check_vz]=/usr/lib/nagios/plugins/check_vz_ubc root@vz2010:~# grep observer /etc/nagios/nrpe.cfg allowed_hosts=observer.vmk.zhdk.ch root@vz2010:~# crontab -l * * * * * cat /proc/user_beancounters > /tmp/user_beancounters * * * * * /usr/lib/nagios/plugins/check_3ware.pl -d c2 >/tmp/3ware […]
Skript zur Auswertung der UBC
Das folgende Skript liefert für jeden UBC-Parameter/VE den Wert: maxheld/limmit. Man sieht so, welche Resourcen von welcher VE am stärksten in Anspruch genommen werden. Gut zu erkennen ist das in folgendem ODS-Diagram (Skriptausgabe Copy/Paste ins Openoffice): VE-Parameters.ods #!/usr/bin/perl $params=`vzsplit -n 20`; @lines=split(/\n/,$params); foreach(@lines) { next if(/^#/); @cols=split(/[“:=]/); foreach(@cols) { $barrier{lc($cols[0])}=$cols[2]; […]
download webpage, subpages and linked mp3 files
wget -r -l 2 -p -k -erobots=off http://www.website.de/page -r : recursive -l 2: max depth 2 -p: download site prerequisites (background images etc.) -k: convert links for local reading -erobots=0: ignore robots.txt
rm -r für 1001 Nacht
Es war einmal ein Sysadmin, der hatte schon 1000 mal als root den Befehl “rm -r” ausgeführt. Das war gefährlich aber manchmal unabdingbar. Beim 1001ten mal dachte er – nach einem ‘ls /mnt/vz2’ – er sei bereits im Verzeichnis vz2. Aber er war ein Verzeichnis höher. Als er plötzlich die Fehlermeldung sah, “cannot delete /proc/23422… […]