linux

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.

mkBackup.sh

#!/bin/bash
 
# todo
# backup desktop (check for to big files)
# backup thunderbird
# backup firefox
# backup usb pen if connected
# add state function
 
DIRS="privat mr sts cd OpenVPN"
EXCLUDE="cd/neue_hp"
DATE=$(date -I)
TARGET="${HOME}/backup/${DATE}"
STATE=0
 
function state() {
	EXIT_CODE=$1
	FILE=$2
	if [ ! -z ${FILE} ]; then
		FILE_SIZE=$(du -sh ${FILE} | cut -f1)
	fi
 
	if [ $EXIT_CODE == 0 ]; then
		printf "%5s %5s\n" "[OK]" ${FILE_SIZE}
	else
		printf "%5s\n" "[ERROR]"
		STATE=$(($STATE + 1))
	fi
}
 
# create today backup directory
[ !

formatCamcard.sh

#!/bin/bash
 
DEVICE=/dev/sdc
LABEL=CAMCARD
 
# create partition
sudo umount ${DEVICE}1
sudo fdisk ${DEVICE} << EOF
o
n
p
1
 
 
a
1
t
6
w
EOF
 
# create filesystem
sudo umount ${DEVICE}1
sudo mkfs.vfat -F 16 -n ${LABEL} ${DEVICE}1
 
# sync changes
sudo sync
 
# create directory structure
#sudo mount ${DEVICE}1 /mnt
#mkdir -p /mnt/DCIM/100NIKON
#sudo umount ${DEVICE}1

LIRC

http://www.lirc.org/

Ati / Medion X10
http://forum.ubuntuusers.de/topic/inbetriebnahme-der-fernbedienung-x10-vom-aldi/

commands
irw - view pressed key

rm_m40v-57501
setserial /dev/ttyS0 uart none
modprobe lirc_serial
modprobe uinput

irrecord -d /dev/lirc0 rm_m40v-57501

/etc/init.d/lirc restart

wget dl.panticz.de/hardware/yamaha_dsp-ax1/rm_m40v-57501

mkdir /usr/share/lirc/remotes/mitsubishi/
cp rm_m40v-57501 /usr/share/lirc/remotes/mitsubishi/rm_m40v-57501

cat < /etc/lircd.conf

QEMU / KQEMU

create image
qemu-img create -f qcow2 xp.img 8G

install windows
qemu -hda xp.img -cdrom xppro.iso -boot d -net nic

run windows
qemu -hda xp.img -cdrom ../download/iso/xppro.iso -boot d -net nic -usb -usbdevice table

# optional
# test # -kernel-kqemu

Links
http://wiki.ubuntuusers.de/QEMU
http://qemu-buch.de/d/Netzwerkoptionen/_Netzwerkdienste/_PXE

Compile xserver-xorg-video-ati-6.6.3 under hardy

apt-get install -y dpkg-dev autoconf libtool fakeroot
mv /etc/apt/sources.list /etc/apt/sources.list.org
 
cat <<EOF>> /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ feisty main universe multiverse restricted
deb-src http://archive.ubuntu.com/ubuntu/ feisty main universe multiverse restricted
EOF
 
apt-get update
apt-get source xserver-xorg-video-ati
 
mv /etc/apt/sources.list.org /etc/apt/sources.list
apt-get update
 
sudo apt-get -y build-dep xserver-xorg-video-ati
 
cd xserver-xorg-video-ati-6.6.3
fakeroot ./debian/rules prepare
fakeroot ./debian/rules patch
faker

mkHomeBackup.sh

#!/bin/bash
 
for i in $(ls /home/); do
	if [ -d /home/${i} ]; then	
		echo ${i}
		tar -cjf /home/${i}.$(date -I).tar.bz2 /home/${i}
	fi
done

gbrainy - a brain teaser game

#!/bin/bash
 
sudo apt-get install gbrainy

Daily reboot Endian

cat <<EOF> /etc/cron.daily/reboot
#!/bin/sh
 
shutdown -r 1:30:00
EOF
 
chmod a+x /etc/cron.daily/reboot
 
 /etc/init.d/fcron restart

Backup and block data copy with dump device (dd)

# save partition / disk to image
dd if=/dev/hda bs=16065b | gzip -9 > hda_backup.dd.gz
 
# restore partition / disk from image
gunzip -dc hda_backup.dd.gz | dd of=/dev/hda bs=16065b
 
# copy over network
netcat -l -p 1234 | dd of=/dev/hdc bs=16065b
dd if=/dev/hda bs=16065b | netcat TARGET_IP 1234
 
# backup mbr
dd if=/dev/hda of=mbr.img bs=512 count=1 
 
# restore mbr (better will by bs=446)
dd if=bs.img of=/dev/hda bs=512 count=1 

Install stress test

# install
sudo apt-get install -y stress
 
stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 600s
 
# LINKS
http://packages.ubuntu.com/saucy/stress
Syndicate content