bash

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

syncTs.sh

#!/bin/bash
 
EXCLUDES="--exclude=pxelinux.cfg/default --exclude=settings.* --exclude=t5 --exclude=t6 --exclude=t7 --exclude=hwprofile/aktuellesprofil --exclude=sn"
 
for IP in {31..33}; do
	echo $IP
	for DIR in www scripts tftpboot number; do 
		rsync -av ${EXCLUDES} /media/${DIR}/ root@192.168.1.${IP}:/media/${DIR}/
	done
done

Automatically move photos from memory card to hard drive with udev

# create udev rule
cat <<EOF> /etc/udev/rules.d/70-persistent-dcim.rules
KERNEL=="sd*1",SUBSYSTEM=="block",ATTR{partition}=="1",ACTION=="add",RUN+="/usr/sbin/mvdcim.sh \$KERNEL"
EOF
 
# create mvdcim.sh script
cat <<EOF> /usr/sbin/mvdcim.sh  
#!/bin/bash
 
DEVICE=/dev/\${1}
SOURCE=/mnt/DCIM/100NIKON
TARGET=/home/hafr/dcim
 
mount \${DEVICE} /mnt
if [ -d \${SOURCE} ]; then
        mv \${SOURCE}/*.jpg \${TARGET}         
        chmod 666 \${TARGET}/*.jpg
        eject \${DEVICE}
else
        umount /mnt
fi
EOF
chmod +x /usr/sbin/mvdcim.sh
 
 
# monitor changes (optional)
ud

mkEbook.sh

#!/bin/bash
 
# check parameter
if [ $# -lt 1 ]; then
	echo "USAGE: $0 LIST_NO"
	exit
else
	LISTID=$1
fi
 
 
function create_pdfmark() {
cat <<EOF> /tmp/pdfmarks
[ /Author (panticz.de)
/Creator (panticz.de)
/Producer (panticz.de)
/Keywords ($1, panticz.de)
/Title (panticz.de ${LISTID} - $1)
/Subject (panticz.de ${LISTID})
/DOCINFO pdfmark
EOF
}
 
 
for DIR in *
do	
	if [ -d "${DIR}" ]; then
		# convert to lowercase
		OUT=$(echo ${DIR} | tr "[:upper:]" "[:lower:]")
 
		# filter	
		OUT="${OUT// /_}"	# replace " " with "_"
		OUT="${OUT//ä/ae}"	# replace "ä" with "ae"
 

rebootAllPhones.sh

#!/bin/bash
 
for IP in {210..217}; do
	echo Rebooting ${IP}
	wget -q -O /dev/null -o /dev/null http://192.168.1.${IP}/confirm.htm?REBOOT=yes &
done

getUniqueFirstLetter.sh

#!/bin/bash
 
FILE=/tmp.$$.out
 
for i in $(ls); do
	echo ${i:0:1} >> ${FILE} 
done
 
cat ${FILE} | sort | uniq
rm ${FILE}

/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 [ ! $?

Rsync SSH backup script

cat <<EOF> ~/privat/scripts/backup.ssh.sh
#!/bin/bash
 
nice -n 20 rsync -avze ssh --delete --exclude-from=/home/pako/.gvfs /home/pako pako@fs:/mnt/pakonb
EOF

UmountMemoryCard.sh

#!/bin/bash
 
# add to /etc/sudoers
# USER_NAME ALL=NOPASSWD:/bin/umount /media/USER_NAME/usbdisk-sdb1
 
DEVICE=usbdisk-sdb1
 
# clean
rm /media/${USER}/${DEVICE}/dcim/100nikon/*.jpg
sync
 
# umount
sudo /bin/umount /media/${USER}/${DEVICE}

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