Create Xen DomU Mailserver

# set domU parameter
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=mx
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:11:22:7E:7E:7E
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=512Mb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=4Gb
 
# create domU
##http://www.panticz.de/Xen-domU-ubuntu-jaunty
http://www.panticz.de/DomU-Debian-Wheezy
 
# add to autostart (optional)
ln -s /etc/xen/${DOMAIN_NAME} /etc/xen/auto
 
# create lvm for home
lvcreate --name ${DOMAIN_NAME}-home --size 128G vg0
mkfs.ext4 /dev/vg0/${DOMAIN_NAME}-home
 
# configure domU
vi /etc/xen/${DOMAIN_NAME}
(add)
'phy:/dev/vg0/mx-home,sda3,w'
 
# post config dom

Install email server (Postfix, Courier, SASL, fetchmail, maildrop, amavisd-new)

# ToDo
# configure antivirus
# configure antispam
# configure secure connections
 
#
# configure timezone and locale
#
# dpkg-reconfigure tzdata
# locale-gen de_DE
 
# install Postfix
http://www.panticz.de/Install-Postfix
 
# install Dovecot
http://www.panticz.de/Install-Dovecot
 
#
# SASL
#
# install
apt-get install -y sasl2-bin
 
# post-configure
cp /etc/default/saslauthd /etc/default/saslauthd.$(date -I)
sed -i 's|START=no|START=yes|g' /etc/default/saslauthd
#sed -i 's|OPTIONS="-c -m /var/run/saslauthd"|OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"|g' /etc/defaul

Fileserver (Samba and DHCP)

#!/bin/bash
 
# set domU name
DOMAIN_NAME=srv
 
# install vm
xen-create-image --hostname=$DOMAIN_NAME --dhcp --mac=00:11:cc:ab:cd:ef \
--lvm=vg01 --dist=jaunty --mirror=http://archive.ubuntu.com/ubuntu/ --size=4Gb --memory=1Gb --swap=1Gb
 
# rename config file
mv /etc/xen/${DOMAIN_NAME}.cfg /etc/xen/${DOMAIN_NAME}
 
# add to autostart
ln -s /etc/xen/${DOMAIN_NAME} /etc/xen/auto
 
# create lvm for home
lvcreate --name ${DOMAIN_NAME}-media --size 200G vg01
mkfs.ext3 /dev/vg01/${DOMAIN_NAME}-media
 
# configure domU
vi /etc/xen/${DOMAIN_NAME}
(add)
'phy:/dev/vg01/srv-media,xvda3,

Update debootstrap

# update debootstrap
wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/xen/master/scripts/update_debootstrap.sh -O - | bash -
 
#
# OLD?
#
# create recipe
cd /usr/lib/xen-tools/
[ ! -f  lucid.d ] && ln -s karmic.d lucid.d
[ ! -f  maverick.d ] && ln -s karmic.d maverick.d
[ ! -f  natty.d ] && ln -s karmic.d natty.d
[ ! -f  oneiric.d ] && ln -s karmic.d oneiric.d
[ ! -f  precise.d ] && ln -s karmic.d precise.d
[ ! -f  quantal.d ] && ln -s karmic.d quantal.d
[ ! -f  raring.d ] && ln -s karmic.d raring.d
[ ! -f  precise.d ] && ln -s karmic.d trusty.d
[ !

Add proposed repository

#!/bin/bash
 
cat <<EOF>> /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-proposed main restricted universe
EOF

Configure network bridge

#!/bin/bash
 
# backup original network config
mv /etc/network/interfaces /etc/network/interfaces.org
 
# configure network bridge for xen
cat <<EOF> /etc/network/interfaces
auto lo
iface lo inet loopback
 
# eth0 (internal lan)
auto eth0 eth1 xenbr1
iface eth0 inet static
        address 192.168.1.111
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.5
        #post-up ethtool -K eth0 tx off
 
# eth1 (DSL)
iface eth1 inet manual
        up ifconfig eth1 0.0.0.0 promisc up
 
# xenbr1 (bridge between second nic

Create Webform in Drupal

# project page
http://drupal.org/project/webform
 
# download
# old # http://ftp.drupal.org/files/projects/webform-6.x-2.8.tar.gz
http://ftp.drupal.org/files/projects/webform-6.x-2.9.tar.gz
extract
copy webform to /sites/all/modules
 
# enable module
Administer > Modules
/admin/build/modules
check: Webform
 
# (optional, disable display post information)
Site building > Themes > Configure
/admin/build/themes/settings
checkout: Webform
 
 
# Site configuration > Languages
# admin/settings/language
 
# Translate interface
# /admin/build/translate/search
 
 
# String contains: 

Hitachi Feature Tool over PXE

#!/bin/bash
 
URL=http://www.hitachigst.com/hdd/support/downloads/ftool_215_install.IMG
 
# download dft image
wget ${URL} -O /var/lib/tftpboot/hitachi_ftool.img
 
# create config for pxe boot
cat <<EOF> /var/lib/tftpboot/pxelinux.cfg/hitachi_ftool.cfg
LABEL linux
   MENU LABEL Hitachi Feature Tool
   kernel memdisk
   append initrd=hitachi_ftool.img
EOF
 
# add config to default config
echo "MENU INCLUDE pxelinux.cfg/hitachi_ftool.cfg" >> /var/lib/tftpboot/pxelinux.cfg/default
 
 
# LINKS
# http://www.hitachigst.com/hdd/support/download.htm

Hitachi Drive Fitness Test over PXE

#!/bin/bash
 
URL=http://www.hitachigst.com/hdd/support/downloads/dft32_v414_b00_install.IMG
 
# download dft image
wget ${URL} -O /var/lib/tftpboot/hitachi_dtf.img
 
# create config for pxe boot
cat <<EOF> /var/lib/tftpboot/pxelinux.cfg/hitachi_dtf.cfg
LABEL linux
   MENU LABEL Hitachi Drive Fitness Test
   kernel memdisk
   append initrd=hitachi_dtf.img
EOF
 
# add config to default config
echo "MENU INCLUDE pxelinux.cfg/hitachi_dtf.cfg" >> /var/lib/tftpboot/pxelinux.cfg/default
 
 
# LINKS
# http://www.hitachigst.com/hdd/support/download.htm

extractEbook.sh

#!/bin/bash
 
# install
# apt-get install pdftk
 
FILE=$1
PAGES=$2
OUT=$3
 
COVER=/media/lagerliste/vorlagen/ebook/cover.pdf
 
# check if file already exists
if [ -f ${OUT} ]; then
	echo "${OUT} already exists"
	exit 0
fi
 
# get pages
pdftk A=${COVER} B="${FILE}" cat A1 B${PAGES} output /tmp/pdftk.out.pdf
 
# reduce image resolution
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -sOutputFile="${OUT}" -f /tmp/pdftk.out.pdf
 
# view
if [ -n ${DISPLAY} ]; then
	evince "${OUT}"
fi
 
 
# USAGE
# ./mkEbook.sh s02_s201.pdf 1-3  ../ebook/l83_1.1_antike.pdf
Syndicate content