Skip to content

Stress your webserver

If you wonder how many requests you need to collapse your webserver – siege is a wonderful tool finding that out.

Install:

# yaourt -Sy siege

Running siege from the console outputs: Continue reading ›

Installing nagios on archlinux

Nagios is one of the most used softwares for monitoring servers. Hint: Icinga itself is a fork of nagios. Many of the used steps to install nagios are also needed for a icinga installation, but I focus on installing nagios.

What have to be done before:
1. Installation of yaourt
2. Installation of apache2 (httpd)

First install find and install nagios:

# yaourt -Ss nagios
...
aur/nagios 4.0.2-1 [installed] (168)
    Nagios is an open source host, service and network monitoring program.
aur/nagios-plugins 1.5-1 [installed] (111)
    Plugins are scripts and programs that perform host and service checks.
...
# yaourt -S nagios nagios-plugins

Before moving on we need to create a password for the user “nagiosadmin” to be able to access the webinterface. Continue reading ›

Quicktip: How to install yaourt on archlinux

1. become root
2. edit file
3. run pacman
4. install yaourt
5. done

# sudo -s 
# cp /etc/pacman.conf /etc/pacman.conf.bak
# echo "[archlinuxfr] >> /etc/pacman.conf
# echo "Server = http://repo.archlinux.fr/x86_64" >> /etc/pacman.conf
# pacman -Syy
# pacman -Sy yaourt
# exit
# yaourt -Version
yaourt 1.3
homepage: http://archlinux.fr/yaourt-en
#

Snippet: Visualize your vnstat output with a PHP frontend

You want some fance graphics instead of boring numbers for your vnstat-statistics? No problem. Bjorge Dijkstra developed some time ago a small php script. You need a running apache (httpd) or another webserver with php-abilities. Get the tar-archive from Bjorges website, extract it and see what happened.

# su -
# cd /sev/http
# wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz
# tar xfz vnstat_php_frontend-1.5.1.tar.gz
# mv vnstat_php_frontend-1.5.1.tar.gz vnstat
# cd vnstat
# ls -al
insgesamt 148
-rw-r--r-- 1 5000 5000  2505 15. Jan 20:35 config.php
-rw-r--r-- 1 5000 5000 18038 17. Mär 2010  COPYING
-rw-r--r-- 1 5000 5000 10590 17. Mär 2010  graph.php
-rw-r--r-- 1 5000 5000 12055 17. Mär 2010  graph_svg.php
-rw-r--r-- 1 5000 5000  6095 17. Mär 2010  index.php
drwxr-xr-x 2 5000 5000  4096 15. Jan 20:32 lang
-rw-r--r-- 1 5000 5000   261 17. Mär 2010  localize.php
-rw-r--r-- 1 5000 5000  1624 17. Mär 2010  README
drwxr-xr-x 6 5000 5000  4096 17. Mär 2010  themes
-rw-r--r-- 1 5000 5000 58716 17. Mär 2010  VeraBd.ttf
-rw-r--r-- 1 5000 5000  5954 17. Mär 2010  vera_copyright.txt
-rw-r--r-- 1 5000 5000  6549 17. Mär 2010  vnstat.php

Just one step left:
edit the config.php – look for the following lines and edit that they fit your needs. If you don’t speak netherlands you may change ‘nl’ to ‘en’.
There are some other translations you can use else then nl and en. Check them out within the lang folder.

    $locale = 'en_US.UTF-8';
    $language = 'en';

    // list of network interfaces monitored by vnStat
    $iface_list = array('enp4s0');

I created a german translation [1]. Copy it into the lang-folder extract it and edit your config.php in the parent folder to use the “de”-translation.
[1] de.taz

How to monitor your bandwith on a single client with vnstat

Sometimes you wonder how much traffic you just used to stream a music video or just checking out some repositories. In some cases it is good to know how much you just used (i.e. some contracts with limited bandwidth promisises – like mobilephones). vnstat is a little piece of software which periodically captures your foodprints on your local client. It listens to a (or more) specific network devices.

To install this nead software just type:

# su - 
# pacman -Sy vnstat

Continue reading ›

Howto check old (floppy) disks for physical damages (bad sectors)

Using badblocks
Run “badblocks” as root

# badblocks

gives you the following output:

Aufruf: badblocks [-b Blockgröße] [-i Eingabedatei] [-o Ausgabedatei] [-svwnf]
        [-c Blöcke_auf_einmal] [-d Verzögerungsfaktor_zwischen_Lesedurchgängen]
        [-e maximale_Bad_Blocks] [-p Anzahl_Durchgänge]
        [-t Testmuster [-t Testmuster [...]]]
        Gerät [letzter_Block [Startblock]]

To scan an old disk for errors/badblocks type:

# badblocks -v /path/to/drive

“-v” for verbose output. Entering the path to the device worked for me. As always you can redirect the output by using the “>” character.

My working command was:

# sudo badblocks -v /dev/sdi

chrome/chromium won’t load some domains

Sometimes chrome/chromium refuses to load some pages (in my case ironically google.de (not .com) and youtube.com). You’ll get a timeout.

What is the problem? Since the affected domains do load in different browsers, I held some kind of DNS-cache responsible. A little research confirmed my suspicion. Typing  into the chromium adress bar

chrome://net-internals/#dns

and hitting enter brings you into a DNS menu. Click onto “Clear host cache” and viola the affected domains are loading fine again.

edit: it seems to be a bigger problem. I discovered an over a year old bug with the internal DNS caching. It seems to be resolved but I do have the same issues described within that ticket.

Had to resolve it temporaly by entering chromium settings. Typing

chrome://flags/

in chromium adressbar and search for DNS then deactivate it.

[snippet] HowTo – activate trim on a dm-crypt encrypted lvm

Just a short snippet on how to activate the TRIM-capability of your SSD (archlinux).
Warning: this can compromise your systems security (more)

# nano /etc/default/grub

Edit line:

GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sda4:archlinux-lvm"

to

GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sda4:archlinux-lvm:allow-discards root_trim=yes ADDITIONAL KERNEL PARAMETER LIST"

After that you need to recreate your grub.cfg:

# grub-mkconfig -o /boot/grub/grub.cfg

Reboot your system.

Try running (as root) fstrim -v /
You should see an output like

645354208 Bytes was trimmed

“root_trim=yes” is only needed on encrypted devices.

Ubucon 2011 in Leipzig – ein Rückblick

Das erste Mal ist immer etwas besonderes. Ubucon – Das Ubuntu-Communitiytreffen. Dorthin, genauer in die Räume der Universität Leipzig, zog es mich am Wochenende der 41. Kalenderwoche im Jahre 2011. Das Programm war umfangreich. So wurden die einzelnen Beiträge nach ihrer Art unterteilt. Es gab Tutorials, Diskussionen und Vorträge.

Besonders hat mich die Vorstellung des Leipziger Sublabs, ein Hackerspace in Leipzig, interessiert. Neben ein paar (leider recht allgemein gehaltenen) Informationen gab es bis auf einen kleinen Aufkleber nicht viel mehr Informationen. Um es kurz zusammenzufassen: Das Sublab ist ein Hackerspace in Leipzig mit einem eigenen Trägerverein; Gründungsmitglieder sind u.a. die Freifunk-Initiative und noch viele andere. Dort ist eigentlich immer was los, Vereinsmitglieder haben 24/7 Zugang. Man findet vom Löteguru, über Tastenquäler bis hin zum Multitalent alle möglichen Persönlichkeiten die einen mit offenen Armen entfangen.
Continue reading ›

Howto repair a non-booting linux-system

A list of commands on how to get into an non-booting linux-system

1. Use a current linux-live-CD/USB thumbdrive
2. boot the repair-disc, change into console.
3. Identify with blkid which (encrypted) disk you want to open (luks-cryptsetup Open /dev/BLA).
4. Scan with for an LVM volume and activate it with vgchange -ay.
5. chroot into the decrypted system:

# su -
# mount /dev/sda2 /mnt
# mount /dev/sda3 /mnt/boot
# mount -o rbind /dev /mnt/dev
# mount -t proc proc /mnt/proc
# mount -t sysfs sys /mnt/sys
# chroot /mnt /bin/bash

6. Beginn repair (bootloader/kernel/configuration/fstab/crypttab etc.)
7. reboot and cross your fingers that all is now working again. In not: go back to step one.