scripts

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"
 

getUniqueFirstLetter.sh

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

updUbuntuPxeFiles.sh

### NEW VERSION
# http://www.panticz.de/sites/default/files/scripts/updateUbuntuPxeFiles.sh
 
 
 
#MIRROR=http://archive.ubuntu.com/ubuntu/dists/SUITE-proposed/main/installer-ARCH/current/images/netboot/ubuntu-installer/ARCH
MIRROR=http://archive.ubuntu.com/ubuntu/dists/SUITE/main/installer-ARCH/current/images/netboot/ubuntu-installer/ARCH
TFTPDIR=/var/lib/tftpboot/ubuntu/SUITE/ARCH
 
download() {
	SUITE=$1
        ARCH=$2
	FILE=$3
 
	echo -n "    - $3"
 
	MIRROR1=${MIRROR//SUITE/$SUITE}
	MIRROR_TMP=${MIRROR1//ARCH/$ARCH}
 
	TFTPDIR1=${TFTPDIR//SUITE/$SUITE}
	TFTPDIR_TMP=${TFTPDI

Do you like this page? Then support it. Please click the AD below and visit the sponsor. Thank you!


Syndicate content