Listed on FindOpenSourceSupport.com

December 20, 2007 by ugob

I’m listed here!

Need a rocket? (Mentos + diet Coke will do!)

December 14, 2007 by ugob

Really Awesome!

vzdump –snapshot revisited

November 29, 2007 by ugob

[root@svr~]# vzdump --snapshot 101 /dev/cdrom: open failed: No medium foundstarting backup for VPS 101 (/vz/private/101)Thu Jul 12 06:53:52 2007 creating backup for  VPS 101 failed(0.00 minutes): unable to dump into snapshot(use option --dumpdir) at /usr/bin/vzdump line 450.

What is going on?

Here is the answer

Prepare a stock centos HN to do vzdumps using LVM snapshots

November 28, 2007 by ugob

Situation:

- Stock Centos 4 system with OpenVZ kernel + utilities installed. One big /vz partition, using LVM.

Trying to make a backup using:


vzdump --dumpdir /var/ --snapshot 101

Error message received:

Insufficient free extents (1) in volume groupVolGroup00: 16 required

What does that mean?

It means that you don’t have enough free space in the VG (Volume Group) to create an LVM snapshot.

What is the solution? Reduce the size of one partition, then resize one LV (logical volume). This is easily done if you don’t have only one big / partition. I usually always make a separate partition for /var and for /vz.

To determine what logical volume needs to be resized, you can use the df -h command. Mine showed:

/dev/mapper/VolGroup00-LogVol05
119G 16G 99G 14% /vz

To resize it:

  1. Make backups of your VM to be sure
  2. Stop the vz service (service vz stop)
  3. umount /vz
  4. e2fsck -f /dev/VolGroup00/LogVol05
  5. Use resize2fs /dev/VolGroup00/LogVol05 110G
  6. Use lvresize to reduce the LV sizey by 2 GB:lvresize –size -2G /dev/VolGroup00/LogVol05

Optionnaly, you can resize your FS to match the size of the LV, using no size arguments to ext2resize:

  1. e2fsck -f /dev/VolGroup00/LogVol05
  2. resize2fs /dev/VolGroup00/LogVol05

I have not re-tested this procedure itself from the beginning (I don’t have a test system here), but it should be pretty safe. Please leave comments if you try this.

If you need to know how big are your LV : lvdisplay.
If you need to know how big are our VG: vgdisplay. This also tells the free space in the VG.

You can not try to use lvm snapshots with vzdump.

A little mail server admin joke

November 28, 2007 by ugob

I was trying to debug someone by e-mail and I think he was a little “slow”. Then I thought, silently:

His brain returned “452 4.3.1 Insufficient system resources”

BarricadeMX: The ultimate spam-fighting app, server-side

September 5, 2007 by ugob

Hi,

I have tried FSL’s BarricadeMX software at two of my client’s site. This piece of software is a giant step in the battle against spam.

What is it?

It is an SMTP proxy, which does many, many tests during the SMTP transaction in a very efficient way. If one test fails, it rejects the message with a 5xx SMTP reply, so the sender should be notified. Il also implements Greylisting in a more intelligent manner than most current Greylisting implementations.

I installed and configured it for 2 clients which are in a different situation: One is a high-volume, multiple servers setup, and the other is a smaller setup with only 1 scanning server.

On the big setup, it allowed this client to stop the delays they were experiencing and the spam-catching rate is a lot higher. It also simplfied management.

On the smaller setup, I enabled BarricadeMX’s clamd and spamd support. This way, viruses are blocked at the MTA level, and any spam that scores over a defined parameter. In this case, I chose to block anything that gets a spamassassin score over 15.
It is a lot easier to manage than the previous setup (FSL has a yum repository, so updating is very simple). I also got rid of the quarantine, and now every false positive gets notified.

I strongly recommend BarricadeMX to anyone who has a Unix/Linux server on hand. It will eventually even run on Microsoft Exchange!

You can try BarricadeMX for 30 days for free. I suggest you ask for the pricelist at the same time, because once you’ve tried it, you won’t be able to let it go!

Sysadmin joke…

July 26, 2007 by ugob

I just thought I should create a new command. Every linux/unix sysadmin knows chmod, to change the permissions on a file, so I thought having a chmood. So for days like today I’d like to use my new command to be slightly more enthusiastic…

Yeah, I thought of that by doing a typo when I was trying to do a chmod

SSH tunnel tutorial

July 20, 2007 by ugob

Hi,

I created a tutorial with Wink that shows how to create an SSH tunnel. In this example, I’ll be connecting, using ssh, to a host called server.mydomain.com. Through the tunnel, I’ll connect to “destinationhost” on port 8080. This can be usefull if destinationhost only allows connection on port 8080 from the server I’m connecting to using SSH.

To setup the tunnel, I simply open the SSH connection. When I want to access the web site located at destinationserver.other.com:8080, I simply enter “localhost:8081″ in my browser.

Here is the wink tutorial.

An SSH tunnel can be used for many reasons:

  • Send or read your e-mails using an insecure protocol (POP3/IMAP/SMTP), through an encrypted tunnel
  • Encrypt your HTTP traffic while in an internet cafe, using a tunnel and a proxy (like squid)
  • Access a host that is behind a firewall (as long as you have access via SSH to another host behind this firewall

BTW, this may be against the policy of the organization, so please check with the sysadmin before doing that.

May 9, 2007 by ugob

Virtualization makes another thing easier: complete, bare-metal backups. With this contributed package (vzdump), it is very easy to make backups of complete VE, sometimes with only little distruption.

Features:

  • Can send an e-mail when finished
  • Can compress the resulting tarball
  • Can selectively back up individual VE, or just all of them
  • Can use different method to make sure the snapshot is consistent (stop the VE, suspend the VE, LVM snapshot)
  • Restoring is very easy and the VEID can be different than the original
  • Can do differential backup using xdelta (not tested myself)

Steps to setup my asterisk server in an OpenVZ VE

May 9, 2007 by ugob
  • Set the VE up
  • Install asterisk
    • wget ftp://ftp.digium.com/pub/asterisk/asterisk-1.2-current.tar.gz
    • tar -xzf asterisk-1.2-current.tar.gz
    • cd asterisk-1.2.18/
    • yum install glibc-devel ncurses-devel gcc openssl-devel zlib-devel
    • make
    • make mpg123
    • make install
    • make config
    • Edit /usr/sbin/safe_asterisk to comment out the line about TTY 9
  • Start asterisk
  • Copy asterisk config files (/etc/asterisk/*)
  • Copy moh mp3’s (/var/lib/asterisk/mohmp3/)
  • Copy custom sounds (IVR)
  • Copy voicemail directory
  • Get french sounds :
    • wget ftp://ftp.digium.com/pub/telephony/sounds/asterisk-core-sounds-fr-wav-current.tar.gz
    • tar -xzf asterisk-core-sounds-fr-wav-current.tar.gz
    • Use the script “install_french.sh” (must be run in /var/lib/asterisk/sounds/fr) (see below for script)
  • Change DNS records
  • Test!
  • Create backups (with vzdump)

install_french script:

#!/bin/bash

# Script creant des liens symboliques permetannt l'utilisation des fichiers audios plus rapidement## Clod Patry (removed e-mail address)# Version 1.0 05/5/2006 (happy birthday mom)

SOUNDS_ABS=/var/lib/asterisk/soundsLANGUAGE=fr

#rootif [ ! -e $SOUNDS_ABS ]; thenecho "Le repertoire $SOUNDS_ABS ne semble pas exister. Installez asterisk ou corriger le \$SOUNDS_ABS";exit;fi

DIR=dictateCUR=$PWD/$DIRif [ ! -e $SOUNDS_ABS/$DIR/$LANGUAGE ]; thenif [ ! -e $CUR ]; then              echo "Le repertoire $CUR ne semble pas exister.";      else              ln -s $CUR $SOUNDS_ABS/$DIR/$LANGUAGE      fielseecho "Impossible de creer $SOUNDS_ABS/$DIR/$LANGUAGE , il existe deja."fi

DIR=digitsCUR=$PWD/$DIRif [ ! -e $SOUNDS_ABS/$DIR/$LANGUAGE ]; then      if [ ! -e $CUR ]; then              echo "Le repertoire $CUR ne semble pas exister.";      else              ln -s $CUR $SOUNDS_ABS/$DIR/$LANGUAGE      fielse      echo "Impossible de creer $SOUNDS_ABS/$DIR/$LANGUAGE , il existe deja."fi

DIR=lettersCUR=$PWD/$DIRif [ ! -e $SOUNDS_ABS/$DIR/$LANGUAGE ]; then      if [ ! -e $CUR ]; then              echo "Le repertoire $CUR ne semble pas exister.";      else              ln -s $CUR $SOUNDS_ABS/$DIR/$LANGUAGE      fielse      echo "Impossible de creer $SOUNDS_ABS/$DIR/$LANGUAGE , il existe deja."fi

DIR=phoneticCUR=$PWD/$DIRif [ ! -e $SOUNDS_ABS/$DIR/$LANGUAGE ]; thenif [ ! -e $CUR ]; then echo "Le repertoire $CUR ne semble pas exister.";else       ln -s $CUR $SOUNDS_ABS/$DIR/$LANGUAGEfielse      echo "Impossible de creer $SOUNDS_ABS/$DIR/$LANGUAGE , il existe deja."fi