Archive for the ‘Uncategorized’ Category

this is my final posting on wordpress as i migrated to http://www.branchable.com/. my primary motivation was:

  • write articles offline
  • all articles/images and other files are managed using git
  • all articles written using markdown syntax
  • the blog stylesheet is based on templates also accessible via git
  • finally branchable offers hosting for a very good price without adds and the webinterface is not based on php

just vist http://blog.lastlog.de

Read Full Post »

problem description

when filing a telephone or email ticket often several recipients are contacted via email. dependent on the otrs configuration this is done in sync, so that a user gets success or fail for message sending in realtime. that means if no local mailserver is used it can be quite time consuming.

for example: filing a ticket here for say the ‘inhouse support crew’ would issue 5 emails and using an external mailserver that means:

  • 5x 1,2 seconds ~= 5-8 seconds

where the otrs-GUI is frozen for the user after clicking ‘create’. dependent on how busy the remote email server is this can hinder usability quite fast.

so this post might be interesting for everyone who wants to use otrs but does not also operate a in-house mailserver.

my setup

  • otrs 3.0.6
  • windows server 2008 r2
  • no local mailserver

the solution

windows server 2008 has support for a  local smtp server (smart host setup or satellite system setup) which can be used as relay. this setup is very easy is much better than using an external mailserver directly because the microsoft smtp relay server has also a local queue so messages won’t get lost if there is a partial network failure.

so basically i used [1], [2], [3], [4] to create the setup.

important points where:

  • using smtp.mail.emea.microsoftonline.com
  • tls encryption
  • user/pass authentification
after the configuration is final:
test the setup using: ‘telnet localhost 25’ and type the commands as found in [5].

the ms smtp relay queue

one should keep an eye on the queue which is in: c:\inetpub\mailroot\Queue

the otrs configuration

use the webinterface and login as root@localhost:
in otrs one has to login, go to admin->sysconfig->type smtp into the search bar, then ‘Core::Sendmail’, in there configure:
  • SendMailModule -> SMTP
  • SendMailModule::Host -> localhost
  • SendMailModule::Port -> 25
  • disable AuthUser/AuthPassword
finally you are done and should file a ticket (which is known to produce an email as a side-effect) and check if that mail is sent.
Note: i like that this smtp relay has a local queue, that is what i’ve been missing on linux for ages… (which is quite sad)


[1] http://www.itsolutionskb.com/2008/11/installing-and-configuring-windows-server-2008-smtp-server/

[2] http://www.petri.co.il/configure_iis_to_be_a_smart_host_for_exchange.htm

[3] http://www.cmsconnect.com/praetor/webhelpg2/chapter_2_-_pre-installation_considerations/Configuring_the_SMTP_Server.htm

[4] http://www.geeksengine.com/article/php-microsoft-smtp.html

[5] http://www.astahost.com/info.php/Sending-Mail-Telnet_t3325.html

Read Full Post »


running nix os [1] on a hetzner [2] platform using:

  • hetzner: root server x2
  • virtualbox: to extract all needed files
    Note: my host computer is a ‘core 2 duo’ and the hetzner target system is a ‘amd’ system
  • hetzner: robot and rescue system
  • nix os: Minimal installation CD, 64-bit Intel/AMD (x86_64-linux)

extracting the ‘nix os installation’ using a virtualbox machine

  1. create a new virtual machine in virtualbox
  2. use the ‘nix os minimal installation cd’ iso image and boot it
  3. follow the nixos installation guide at [3] (no need for any raid setup here!)
  4. (DON’T FORGET TO ENABLE SSHD IN /mnt/etc/nixos/configuration.nix before doing nixos-install)
    services.sshd.enable = true;
  5. the mountPoint can be set using labels:
    { mountPoint = “/”;
  6. in case you want to use a different version of grub you can add a  line like this to configuration.nix:
    nixpkgs.config.packageOverrides = pkgs : rec { grub2 = pkgs.grub198; };
  7. if the ‘grub’ installation step failed this is not critical (at this point)
    we don’t need a bootable virtualbox image; we only need the files!

after the installation finished, don’t reboot (extract the files instead)

  1. /mnt contains the installation, so we are now creating a tar.gz from that installation
  2. conveniently one can use ssh to create a tar.gz on the host system, so:
  3. start sshd on the host system and check that the virtualbox networking is working, then
  4. tar zcvf – /mnt | ssh root@ “cat > /root/nixos-2011-05-08.tar.gz

now you ‘could’ remove the virtualbox image, we don’t need it anymore.

root server configuration

let’s create the raid and prepare the system for file deployment:

  1. start the rescue system and login using ssh
  2. remove all raids (the default debian installation uses md0/md1/md2)
  3. (maybe reboot to reflect the changes)
  4. create one partition per device:
    fdisk /dev/sda -> create one giant /dev/sda1 partition
    fdisk /dev/sdb -> create one giant /dev/sdb1 partition
  5. create a new raid (raid1):
    mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
  6. (maybe wait until the raid finished syncing, see ‘cat /proc/mdstat’)
  7. create a filesystem (see nix os manual):
    mkfs.ext4 -O dir_index -j -L nixos /dev/md0
    using nix os the /dev/md0 is often named /dev/md127
  8. mount it on /mnt:
    mount LABEL=nixos /mnt

copy the files to the prepared raid:

  1. mount LABEL=nixos /mnt
  2. cd /mnt
  3. wget http://lastlog.de/misc/nixos-2011-05-08.tar.gz
    i copied this file (created earlier in this documentation) to my other root-server, don’t use it: USE YOUR OWN FILES
  4. tar xzf nixos-2011-05-08.tar.gz

and all needed files are there.

Note: there are no /dev; /sys; or /proc files contained in the tar file! this is intentional

Note: in case you don’t have a place to put that nixos-*.tar.gz you can copy it to your machine using scp

install the bootloader manually:

the rescue image is based on debian and therefore we can use apt-get to install grub2!

  1. apt-get install grub2
  2. grub-install –no-floppy –root-directory=/mnt /dev/sda
  3. grub-install –no-floppy –root-directory=/mnt /dev/sdb

final setup step:

add your public ssh key to /mnt/root/.ssh/authorized_keys

  1. mkdir /mnt/root/.ssh
  2. vi /mnt/root/.ssh/authorized_keys
  3. copy’n’paste your pubkey
    create a key pair if you don’t have already: ssh-keygen

software-raid using mdadm

it’s wise to disable the hard-drive write caches to avoid data loss on a power fail, so add this to your /etc/nixos/configuration.nix:

powerManagement.powerUpCommands=”/var/run/current-system/sw/sbin/hdparm -W 0 /dev/sda /dev/sdb”;

note: this can reduce throughput but i think it’s totally worth it.

client machine ssh setup

one the client machine (which is used to connect to the hetzner nix os installation later) configure ~/.ssh/config:

Host nixos
User root
IdentityFile ~/.ssh/id_rsa_nixos

finally type:

ssh nixos

and you should get a nixos shell!

to debug the setup you can use tools like:

  • ping
  • ssh -v <- add the -v to the parameter list of ssh
  • read the logs of the nixos installation using /mnt/var/log/messages


[1] http://nixos.org/

[2] http://www.hetzner.de/

[3] http://hydra.nixos.org/build/1082174/download/1/nixos/manual.html#id418003

Read Full Post »