tom's blog

Convert from VirtualBox to KVM/Qemu

Konverting from VirtualBox to KVM is actually quite easy.

If you use snapshots in VirtualBox, then you will first have to clone the current running state into a new VM (Right clickt -> Clone -> blah -> select only current state)

Then, if you use dynamic growing disks, convert them to raw format

VBoxManage clonehd --format RAW Win7.vdi Win7.raw

Now convert it to qcow2

SOHO Mailserver with Postfix + Postgresql + Dovecot + SpamAssassin + Roundcube

This HowTo describes my Home-Mailserver Setup. Basically this is a sum-it-all-up article from various resources on the net. 

Used Software:

  • Arch Linux OS
  • Postfix MTA
  • PostgreSQL database backend
  • Dovecot IMAP Server
  • Roundcube Webmail + Apache Webserver
  • Spamassassin junk filter
  • Server-side filtering with Sieve
  • fetchmail (for pulling all spread accounts in this one place)

Preconditions in my setup:

Comments should work now

Heck, some interesting and nice comments have been posted, and landed up in the approval queue. I never got a mail, and currently cannot yet figure out where to configure this in Drupal. Anyways comment approval is disabled now and I published all comments posted so far. Sorry for the confusion.

Project T5220, try 1: How NOT to configure a T5220 as a complete Oracle/Weblogic development environment

Currently I have to configure a Sun Enterprise T5220 as our new "developemnt environment", replacing our V440 (Oracle) and the T1000 (Weblogic). We chose a Sun CMT machine as we wanted to stay close to production in regards of architecture (processor type/OS etc).

The machine will have to run an Oracle instance, and some containers for the Weblogic environments (we have an integration env, daily build env + some development environments for projects). The new T5220 ist packed with a 1.4GHz T2 Niagara, 64GB of memory, 2x146GB for the OSes, and 6x300GB for the database and NFS.

Howto create a youtube video from mp3/ogg audio using a picture

If you want to create a youtube video from an audio file, here is how to do this.
All you need is the audio file, a single picture, and ffmpeg.

First find out the lenght of the audio file in seconds, you'll need it. Here is an example with a 420 seconds file:

ffmpeg -loop_input -i picture.jpg -vcodec mpeg4 -r 25.00 -qscale 2 -s 480x360 \
-i audiofile.mp3 -acodec libmp3lame -ab 128k -t 420 video.avi

This will create a Hi-Res MPEG-4 video with 128k audio. The trick here is to use that one picture and loop it for -t seconds.

Howto print text between tags or characters with awk or sed

Took me a while to figure out this one. All I wanted to do is to print the text between two tags/characters/strings.

The IMHO nicer Awk way:

$ echo "bla(foo)"|awk -F'[(|)]' '{print $2}'
foo
$ echo "bla=@@foo@@"|awk -F'[@@|@@]' '{print $3}'
foo

 and with sed:

$ echo "blah(foo)"|sed -n 's/.*(\([^ ]*\))/\1/p'
foo
echo "aaafoobbb"|sed -n 's/.*aaa\([^ ]*\)bbb/\1/p'
foo

Figured.

Howto control Tomcat using wget

I just had to restart a webapp in Tomcat without stopping a second app running in the same tomcat instance.

Usually this can be done easily via the Tomcat Manager, but in this case I was not able to access the Manager due to firewall rules. Though I was able to access the server using ssh, but there was no curl installed.

Luckily wget did the trick too!