Script to generate /etc/network/interfaces file on Ubuntu/Debian

Wednesday, September 30th, 2009

#!/bin/bash
ifile=/etc/network/interfaces
echo -n “Insert IPstart:”
read ipstart
echo -n “Insert IPend:”
read ipend
echo -n “Insert Gateway:”
read gw
#echo -n “Insert Subnet: ”
#read subnet
echo -n “Insert Netmask: ”
read net
echo -n “Insert aliast to start: ”
read ali

firstIp=`echo “${ipstart%.*}”`
lastIpStart=`echo “${ipstart##*.}”`
lastIpEnd=`echo “${ipend##*.}”`
dif=`echo $(($lastIpEnd-$lastIpStart))`

ip=$lastIpStart
for ((i=$ali;i<=$ali+$dif;i++)){
echo "auto eth0:$i" >>$ifile
echo “iface eth0:$i inet static” >>$ifile
echo “address $firstIp.$ip” >>$ifile
echo “network $subnet” >>$ifile
echo “netmask $net” >>$ifile
echo “gateway $gw” >> $ifile
echo ” ” >> $ifile
let ip++
}

Installing perl audio converter

Wednesday, August 5th, 2009

Download the latest version of pacpl from:

Download PACPL from http://pacpl.sourceforge.net/

install cpan, either with yum,apt..

Install these cpan modules:

cpan install Ogg::Vorbis::Header
cpan install Inline::MakeMaker
cpan install MP3::Tag
cpan install Audio::FLAC::Header
cpan install MP4::Info
cpan install Audio::WMA
cpan install Audio::Musepack
cpan install CDDB_get

Untar the pacpl source and move the binary into /usr/bin and the share/pacpl files into /usr/share/pacpl, also the config file (pacpl.conf) should be in /etc/pacpl/

To convert from .caf to mp3 use:

pacpl –to mp3 file.caf

Xen howto create domU on Debian

Saturday, June 13th, 2009

Centos :

xen-create-image –lvm=lvm1 –hostname=hostname –install-method=rinse –dist=centos-5 –arch=amd64 –ip=ip –netmask=255.255.255.0 –gateway=gw –force –size=80Gb –swap=1024Mb –memory=1024

Debian:

xen-create-image –lvm=lvm1 –hostname=vm01 –install-method=debootstrap –arch=amd64 –ip=ip –netmask=255.255.255.0 –gateway=gw –force –size=80Gb –swap=1024Mb –memory=1024