Gnome15 Russo79 project site offline

At the moment the server from Russo79 (https://projects.russo79.com/projects/gnome15) for the gnome15 project is offline.
That’s why I decided to publish and upload the gnome15 files I’ve found. I hope its useful for somebody…

gnome15-0.9.7.tar.gz
gnome15-driver-g15direct-0.9.8-1-any.pkg.tar.xz
gnome15-driver-kernel-0.9.8-1-any.pkg.tar.xz
gnome15_debs.tar.gz for Ubuntu/Debian
lg4l-gnome15-0.14-11-x86_64.pkg.tar.xz
pyinputevent-0.1c.tar.gz

If you are building gnome15 on Gentoo Linux, just disable the cairo USE Flag because I didn’t found the required file named cairoplot-gnome15-1.1b.tar.gz

Join #gnome15 channel on irc.freenode.org for any support

Zabbix Agent init script

Zabbix Agent init script for Debian with config argument:

More info: Zabbix Website
Manual: Zabbix Manual

Download the file here: zabbix_agent

Enable automatic start/stop of Zabbix Agent:
update-rc.d zabbix-agent defaults

#! /bin/bash
#
# Zabbix agent start/stop script
# Adjusted: Remo Staeuble
# Date: 15.11.2012
# Version: 2.0.3
# Copyright (C) 2000-2012 Zabbix SIA
#
# To get more information about Zabbix visit http://www.zabbix.com
# ####################################################################
#
### BEGIN INIT INFO
# Provides: zabbix_agentd
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $time $network $syslog iptables firehol shorewall ipmasq arno-iptables-firewall
# Should-Stop: $network $syslog iptables firehol shorewall ipmasq arno-iptables-firewall
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop Zabbix Agent
# Description: Start/stop Zabbix Agent
### END INIT INFO

NAME=zabbix_agentd
DAEMON=/usr/local/sbin/${NAME}
CONFIG=/etc/zabbix/zabbix_agent.conf
DESC=”Zabbix agent daemon”
PID=/var/run/zabbix/$NAME.pid

test -f $DAEMON || exit 0

case “$1” in
start)
echo “Starting $DESC: $NAME with config from $CONFIG”
start-stop-daemon –start –oknodo –pidfile $PID –exec $DAEMON — -c $CONFIG
;;
stop)
echo “Stopping $DESC: $NAME”
start-stop-daemon –stop –quiet –pidfile $PID –retry=TERM/10/KILL/5 && return 0
start-stop-daemon –stop –oknodo –exec $DAEMON –name $NAME –retry=TERM/10/KILL/5
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
N=/etc/init.d/$NAME
echo “Usage: $N {start|stop|restart|force-reload}” >&2
exit 1
;;
esac

exit 0

Connect to Remote Database with PhpMyAdmin

on Database Server:
apt-get install mysql-server mysql-client

Backup original configuration:
cp /etc/mysql/my.cnf /etc/mysql/my.cnf_orig

Let mysql server listen on all interfaces:
grep -l bind-address /etc/mysql/my.cnf | xargs sed -i -e 's/bind-address/#bind-address/'

Restart mysql server
/etc/init.d/mysql restart

Check if MySQL binds on every interface
netstat -tap

it should look like this:
tcp 0 0 *:mysql *:* LISTEN 2487/mysqld

Now give root user logon permission from Webserver where phpmyadmin is running
mysql -u root -p
mysql> use mysql;
mysql> update user set host=’WEBSERVER-IP’ where host=’127.0.0.1′ and user=’root’;
mysql> flush privileges;

Restart mysql server
/etc/init.d/mysql restart

On Webserver:
apt-get install apache2 php5 phpmyadmin

Edit /etc/phpmyadmin/config-db.php and set the variables
$dbuser='root';
$dbpass='R00tPassW0rd';
$dbname='mysql';
$dbserver='DBSERVER-IP';
$dbport=''; // leave blank if mysql runs on default port

Open your Browser and point to http://yourwebserver/phpmyadmin

Xen: Device xxx (x) could not be connected. Failed to find an unused loop device

If you are using Xen and get an error Device xxxxx (xxx) could not be connected. Failed to find an unused loop device when you try to create a guest. This is because you are out of loop devices.

Run this on command line:
echo "options loop max_loop=32" > /etc/modprobe.d/xen

With the value 32 you are able to run 16 Guests on your host, assuming you aren’t using loop devices for other purposes. Use a number suitable for your needs.

Shutdown your guests and run this on command line:
rmmod loop && modprobe loop

Show all loop devices:
ls -l /dev/ | grep loop

Kubuntu 11.04 install Kernel 3.0.1

Kernel version 3.0.1 stable was just released a week ago. I’m a lazy guy, so I install the precompiled .deb packages.

Get the linux-headers-*-all.deb, linux-headers-*-generic-*.deb, and finally linux-image-*.deb from http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0.1-oneiric/
Install the .deb Packages in this Order:
dpkg -i linux-headers-*-all.deb
dpkg -i linux-headers-*-generic-*.deb
dpkg -i linux-image-*.deb

Restart your machine, enter the grub menu by typing shift and boot the new kernel. Its possible that u get in trouble while booting the new kernel – just restart and take an older one. Remove linux-headers-3 and linux-image-3 if it didn’t work.

Maybe u need module-init-tools 3.13 where u can get here https://launchpad.net/ubuntu/oneiric/amd64/module-init-tools/3.13-1ubuntu1

Other precompiled Kernel versions http://kernel.ubuntu.com/~kernel-ppa/mainline/

Update ProFTPd to 1.3.3d

Use the newest ProFTPd Version! Compilation for 1.3.3e is the same as for 1.3.3d

Cause of some security issues I’ve decided to upgrade my ProFTPd Service from 1.3.1 to 1.3.3d.

Do a Backup of your current proftpd configuration Directory /etc/proftpd
cp -rfp /etc/proftpd /var/backups/etc/

Then purge the actual proftpd installation
apt-get purge proftpd-basic proftpd-mod-mysql

I’m running proftpd with virtual users on a mysql database with mod_quota, so we have to install the needed libraries for the compilation of the proftpd.

apt-get install libssl-dev libmysqlclient-dev libmysqlclient15-dev libwrap0-dev

get the stable and newest version of proftpd
cd /tmp
wget ftp://ftp1.at.proftpd.org/ProFTPD/distrib/source/proftpd-1.3.3d.tar.gz
tar -xf proftpd-1.3.3d.tar.gz
cd proftpd-1.3.3d.tar.gz

at this point, we’re beginning with the compilation of the proftpd version 1.3.3d. Copy the content of this file in your command line and press enter. U see, that it generates a run.sh file. Run chmod 777 on run.sh

Now run it:
./run.sh

after run.sh has finished, go on with make…
make

if there were no errors, add the user proftpd and then install it
useradd proftpd
make install

if the install has finished, copy the content of this file to /etc/default/proftpd

Cause we used the same configurations like the official Debian package, we can now use their init script.
copy the content of this file to /etc/init.d/proftpd and make it runnable (chmod 755 /etc/init.d/proftpd)

copy the backup from /var/backups/etc/proftpd back to /etc/proftpd and try to start the service.

Post your log files, if your proftpd won’t start.

Disk klonen mittels dd_rescue

“dd_rescue” ist als Erweiterung von dd ein einfaches, aber mächtiges Tool zur Datenrettung das man auf der Konsole bedient. Weiter ist es in der Lage, clusterweise von hinten nach vorne auszulesen.

Disk klonen:
dd_rescue /dev/source /dev/target

Image von Disk / Partition erstellen:
dd_rescue /dev/source /home/exit/backup/image.img

Zu finden ist das Tool hier.

Realtime CLI Netzwerkmonitoring auf Linux

jnettop:
apt-get install jnettop


Usage: jnettop [-hv] [-i interface] [-d filename]
-h, --help display this help message
-v, --version display version information

-c, --content-filter disable content filtering
-d, --debug filename write debug information into file (or syslog)
--display type type of display (curses, text, uia)
-f, --config-file name reads configuration from file. defaults to ~/.jnettop
--format format list of fields to list in text output
-i, --interface name capture packets on specified interface
--local-aggr arg set local aggregation to none/host/port/host+port
-n, --no-resolver disable resolving of addresses
-p, --promiscuous enable promisc mode on the devices
--remote-aggr arg set remote aggregation to none/host/port/host+port
-s, --select-rule rule selects one of the rules defined in config file
by it's name
-t, --timeout sec timeout in seconds after which jnettop ends (text display)
-x, --filter rule allows for specification of custom filtering rule
this follows tcpdump(1) syntax. don't forget to
enclose the filter in quotes when running from shell

Format variable can be CSV (comma separated values), TSV (tab separated values)
or completelly custom format string, where the following identifiers are subst-
ituted when surrounded by '$':
src, srcname, srcport, srcbytes, srcpackets, srcbps, srcpps,
dst, dstname, dstport, dstbytes, dstpackets, dstbps, dstpps,
proto, totalbytes, totalpackets, totalbps, totalpps, filterdata

example:
jnettop --display text -t 5 --format CSV
jnettop --display text -t 5 --format '$srcname$,$srcport$,$dstname$,$dstport$,$totalbps$'

iptraf
apt-get install iptraf

iptraf [ -f ] [ -u ] [ { -i iface | -g | -d iface | -s iface | -z iface |
-l iface } [ -t timeout ] [ -B ] [ -L logfile ] [-I interval] ]

Issue the iptraf command with no parameters for menu-driven operation.
These options can also be supplied to the command:

-i iface - start the IP traffic monitor (use "-i all" for all interfaces)
-g - start the general interface statistics
-d iface - start the detailed statistics facility on an interface
-s iface - start the TCP and UDP monitor on an interface
-z iface - shows the packet size counts on an interface
-l iface - start the LAN station monitor ("-l all" for all LAN interfaces)
-B - run in background (use only with one of the above parameters)
-t timeout - when used with one of the above parameters, tells
the facility to run only for the specified number of
minutes (timeout)
-L logfile - specifies an alternate log file for any direct invocation
of a facility from the command line. The log is placed in
/var/log/iptraf if path is not specified.
-I interval - specifies the log interval for all facilities except the IP
traffic monitor. Value is in minutes.
-f - clear all locks and counters. Use with great caution.
Normally used to recover from an abnormal termination.

-u - allow use of unsupported interfaces as ethernet devices.

IPs mittels Iptables blockieren

Heute hab ich bemerkt, dass wiedermal ein Bot an einem meiner Server klebt und beim Ftp Service standart Users durch probiert. Dies generiert, auch wenn nur eine sehr geringe Menge, unnötigen Traffic und unnötig endlose Logfiles … Obwohl ich fail2ban am laufen hab, was sehr zu empfehlen ist, hab ich Ihn dann doch noch manuell per iptables ausgesperrt.

Oft schon standart mässig installiert:
apt-get install iptables

Anzeigen von bestehenden Chains:
iptables -L
iptables -L CHAIN

Blockieren einer bestimmten source IP auf allen Ports:
iptables -A INPUT -s 11.22.33.88 -j DROP

Herausnehmen der blockierten IP aus Chain:
iptables -D INPUT -s 11.22.33.88 -j DROP

Anlegen einer eigenen Chain:
iptables -N CHAINNAME

Der Nachteil an diesen manuell gesetzen Einträgen ist, dass sie nach einem Neustart verloren gehen. Daher empfiehlt sich, für eine fixe Lösung die iptables Einträge zum Beispiel in der /etc/iptables.conf abzulegen.
echo "iptables -A INPUT -s 11.22.33.88 -j DROP" >> /etc/iptables.conf

Danach in der /etc/network/interfaces zum loopback Interface eine pre-up Zeile hinzufügen:

auto lo
iface lo inet loopback
pre-up /sbin/iptables-restore < /etc/iptables.conf

Diese Lösunge reicht für unseren gebrauch föllig aus, birgt aber trotzdem einige Nachteile. Zudem kann man die Rules nicht einfach aus/einschalten, dafür müsste man sich ein eigenes Init-Script schreiben oder ein bestehendes umschreiben, was mir aber für diese Situation zu aufwenidig wäre.

Wer ausführlich mehr über iptables wissen will Iptables Tutorial 1.2.2@frozentux.net