Create XEN Hylafax domain

# redirect your ISDN card on dom0
http://www.panticz.de/xen_pci_delegation

# set domU parameter
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=fax
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:00:00:00:fa:fa
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=256Mb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=2Gb
[ -z $DOMAIN_PCI ] && DOMAIN_PCI=04:05.0

# create domU
http://www.panticz.de/DomU-Debian-Squeeze

# redirect avm usb card
echo "pci=['${DOMAIN_PCI}']" >> /etc/xen/${DOMAIN_NAME}
echo "extra = 'iommu=soft'" >> /etc/xen/${DOMAIN_NAME}

# start domU
xm create -c ${DOMAIN_NAME}

# install AVM FRITZ!Card PCI kernel moud

PCI Delegation in Xen (Xen Pci Passthrough)

#
# Debian 7
#
# add xen-pciback to initrd
echo "xen-pciback" >> /etc/modules
update-initramfs -u

# hide device (module and pciid have to be adapted)
cat < /etc/modprobe.d/xen-pciback.conf
install e100 modprobe xen-pciback; modprobe --first-time --ignore-install e100
options xen-pciback hide=(00:0c.0)
EOF

# test
xm pci-list-assignable-devices

# Links
http://wiki.xen.org/wiki/Assign_Hardware_to_DomU_with_PCIBack_as_module
http://debianforum.de/forum/viewtopic.php?f=32&t=139776
http://nixnote.blogspot.de/2012/03/xen-part-9-pci-passthrough.html
http://wiki.xen.org/wik

Create squashfs

#!/bin/bash

mount -t squashfs /cdrom/KANOTIX/KANOTIX /mnt/ -o loop
cp -a * /root/KANOTIX/
rm -rf 2.6.24-3-kanotix
cp -a /lib/modules/2.6.24-3-kanotix/ /root/KANOTIX/lib/modules/
umount /mnt
mksquashfs * ../KANOTIX.squa

Configure maildroprc

# /etc/courier/maildroprc

# Our shell
SHELL="/bin/bash"

# The default path
DEFAULT = "$HOME/Maildir"

# Our log file
logfile "/var/log/maildrop"

# Our verbosity in the log file
VERBOSE="5"

# This get's added above each entry in the log file.
# It's just a visual aid.
log "------------------------"

# If the Spam-Flag is YES, sort to Junk folder
if ( /^X-Spam-Flag: YES/)
{
to $DEFAULT/.SPAM/
}

if ( /^Subject: new_order/)
{
`/data/scripts/processOrder.sh`
to $DEFAULT/.ORDER
}

# FILES
# processOrder.sh - http://www.panticz.de/node/155

BASH

# and
if [ "$foo" == "a" ] && [ "$bar" == "b" ]; then

# or
if [ "$foo" == "x" ] || [ "$bar" == "y" ]; then

# both
if ( [ "$a" == "a" ] || [ "$a" == "b" ] ) && ( [ "$b" == "c" ] ); then

# enable color output systemwide for ls and grep
cat <> /etc/profile.d/alias.sh
alias ls='ls --color=auto'
alias grep='grep --color=auto'
EOF

# get exitcode prevoius command
${PIPESTATUS[0]}

# redirect stdout AND stderr to file
COMMAND &> file.out

# sequence
echo {,my-}host{1,{3..5},9,10}
echo $(seq 1 4)

# for loop
START=1
END=10
for ((i=START; i<=END; i++)); do
e

Check file name and set rights

#!/bin/bash

change_rights() {
for i in $(find $1 -perm 700); do
echo "set rights for $i"
chmod a+rw $i
done

for i in $(find $1 -perm 600); do
echo "set rights for $i"
chmod a+rw $i
done
}

change_name() {
for i in $(find $1 -name "*.JPG"); do
echo "rename $i ${i//.JPG/.jpg}"
mv "$i" "${i//.JPG/.jpg}"
done
}

for DIR in /data/bilder/300dpi /data/bilder/700dpi; do
change_rights $DIR
change_name $DIR
done