Install and configure AVM Fritz!Card USB driver

#!/bin/bash
 
# If you use Ubuntu Gutsy you don´t need to compile the fcusb2 driver at self, follow this howto
# it will automaticly download and configure all needed files
 
# be sure that you running this script as root
if [ "$USER" != "root" ]; then
	sudo $0
	exit 0
fi
 
# install needed packages
apt-get install -y avm-fritz-firmware linux-restricted-modules-$(uname -r) wget
 
# install avm firmware
#wget http://www.avm.de/files/cardware/fritzcrdusb.v20/linux/suse.93/fcusb2-suse93-3.11-07.tar.gz -P /tmp
#tar -xzf /tmp/fcusb2-suse93-3.11-07.tar.gz -C /tmp
#mkdir /usr/share/isdn/

Compile AVM Fritz!Card USB driver for Ubuntu (fcusb2.ko)

#!/bin/bash
 
# note
# successfully tested on Ubuntu Gutsy 7.10, this driver currently dont work with Hardy 8.04
 
apt-get install -y wget rpm build-essential linux-headers-$(uname -r) avm-fritz-firmware
 
wget http://opensuse.foehr-it.de/rpms/10_3/src/fcusb2-0.1-0.src.rpm -P /tmp
cd /tmp
rpm2cpio fcusb2-0.1-0.src.rpm | cpio -i --make-directories
 
if [ $(uname -m) == "x86_64" ]; then
	# amd64
	tar -xzf fcusb2-suse93-64bit-3.11-07.tar.gz
	cd /tmp/fritz/src/
	patch -p2 < /tmp/fritz-usb.diff
	patch -p2 < /tmp/fritz_init_work.diff
	patch -p2 < /tmp/fritz_urb.diff
	patch -p2 < /tmp/f

Ubuntu LiveCD PXE boot (Ubuntu Live CD boot from network)

DEFAULT_URL=http://releases.ubuntu.com/releases/12.04/ubuntu-12.04-desktop-i386.iso
NFS_SERVER=192.168.1.9
 
if [ ! -z $1 ]; then
        FILE=$1
 
        if [ !

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 <<EOF> /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

Compile Ubuntu kernel

apt-get install fakeroot build-essential makedumpfile ncurses-dev
 
cd /usr/src
?? apt-get build-dep linux-image-$(uname -r)
apt-get source linux-image-$(uname -r)
 
?? apt-get build-dep linux-ubuntu-modules-$(uname -r)
??

processOrder.sh

#!/bin/bash
 
FILE=/tmp/newOrder_$(date -I)_$$
IN=$(cat /dev/stdin)
 
# write file
echo "${IN}" > ${FILE}
 
# execute_another_app ${FILE}
 
exit 0

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

instalPicasa.sh

#!/bin/bash
 
sudo su
 
echo "deb http://dl.google.com/linux/deb/ stable non-free" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install picasa 

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 <<EOF>> /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
Syndicate content