Reboot all Phones

#!/bin/bash

cp /etc/asterisk/sip_notify.conf /etc/asterisk/sip_notify.conf.back.$(date -I)

cat <> /etc/asterisk/sip_notify.conf
[reboot-snom]
Event=>reboot
Content-Length=>0
EOF

cat < /etc/asterisk/extensions.reboot.conf
exten => 666,1,System(/usr/sbin/asterisk -rx "sip notify reboot-snom pako sip2 sip3")
exten => 666,n,Hangup()
EOF

add "#include extensions.reboot.conf" to /etc/asterisk/extensions.conf

# Links
http://www.voip-info.org/wiki/view/Asterisk+phone+snom
http://das-asterisk-buch.de/2.1/telefone-snom.html

Default Debian DomU

# configure domU
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=lenny
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:00:00:00:aa:bb
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=512Mb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=4Gb

# create domU
xen-create-image --hostname=${DOMAIN_NAME} --dhcp --mac=${DOMAIN_MAC} \
--lvm=vg01 --dist=lenny --role=udev --size=${DOMAIN_HDD} --memory=${DOMAIN_RAM} --swap=${DOMAIN_RAM}

# rename vm config
mv /etc/xen/${DOMAIN_NAME}.cfg /etc/xen/${DOMAIN_NAME}

# post config domU
mount /dev/vg01/${DOMAIN_NAME}-disk /mnt/
sed -i 's|tty1|hvc0|g' /mnt/etc/inittab
chroot /mnt/ sh -c "echo root:terc

Ubuntu DVD-RAM

apt-get install dvd+rw-tools udftools

cat <> /etc/fstab
/dev/pktcdvd/0 /media/dvdram udf defaults,noauto,user 0 0
EOF

cat < /etc/default/udftools
DEVICES="/dev/sr0"
UDEV=true
NEWINT=true
EOF

/etc/init.d/udftools restart

/etc/init.d/udftools stop
#mkudffs --udfrev=0x0150 --media-type=dvdram /dev/sr0
sudo mkudffs --udfrev=0x0150 --media-type=dvdram --vid=mr_300dpi_1 --lvid=vid=mr_back_300_1 /dev/sr0
/etc/init.d/udftools start
eject

mount /dev/sr0 /mnt/

chmod 777 /mnt/

# format dvd-ram (optional)
dvd+rw-format -force=full -ssa=default /

Kino

# grab dv tape
apt-get install -y dvgrab
dvgrab -opendml -size 0 -autosplit -t

# install kino
sudo apt-get install kino ffmpeg

# fix export scripts
wget http://surfnet.dl.sourceforge.net/project/kino/kino/1.3.4/kino-1.3.4.tar.gz -P /tmp
tar xzf /home/pako/Desktop/kino-1.3.4.tar.gz -C /tmp
sudo mv /usr/share/kino/scripts/exports/ /usr/share/kino/scripts/exports.old
sudo mv /tmp/kino-1.3.4/scripts/exports/ /usr/share/kino/scripts/

# links
https://launchpad.net/ubuntu/+source/kino/+bugs

/etc/init.d/fiXorg.sh

#!/bin/sh

if [ $(date +%H) -gt 18 ]; then
echo "activate Xorg ATI"
ln -sf /etc/X11/xorg.conf.ati /etc/X11/xorg.conf
else
echo "activate Xorg NVIDIA"
ln -sf /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf
fi

exit 0

# chmod +x /etc/init.d/fiXorg.sh
# update-rc.d fiXorg.sh defaults 20

syncStore.sh

#!/bin/bash

SERVER=YOUR_STORE.COM
MAIL=YOU@YOUR_DOMAIN.COM

function create_item_description() {
# set java classpath
export CLASSPATH=/media/programme/java/classpath/RitterDefault_lin.jar:/media/programme/java/classpath/ojdbc14.jar

# export descriptions from db
for i in 2 3 7; do
java LagerlisteCreator -q "Webshop" "${SERVER}_${i}" > /tmp/${SERVER}_${i}.out

if [ ! $?

Windows scripts

# exportDB.cmd
for /f "tokens=2" %%i in ('date /t') do set date=%%i
set timestemp=%date:~6,4%-%date:~3,2%-%date:~0,2%
d:\ORANT\BIN\exp80.exe system/manager file="e:\%timestemp%.dmp" full="y"

# add_at_job_windows_nt.cmd
at 20:00 /every:Mo,Di,Mi,Do,Fr,Sa "\\fs\scripte\windows\exportFullDatabase.cmd"