Debian

#
# Debian Squeeze
#
# Squeeze main
cat <<EOF> /etc/apt/sources.list.d/squeeze.list
deb http://archive.debian.org/debian/ squeeze main contrib non-free
deb-src http://archive.debian.org/debian/ squeeze main contrib non-free
EOF

# Squeeze security
cat <<EOF> /etc/apt/sources.list.d/squeeze-security.list
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free
EOF

# Squeeze LTS
cat <<EOF> /etc/apt/sources.list.d/squeeze-lts.list
deb http://archive.debian.org/debian/ squeeze-lts main contrib non-free
deb-src http://archive.debian.org/debian/ squeeze-lts main contrib non-free
EOF
echo "Acquire::Check-Valid-Until false;" > /etc/apt/apt.conf.d/10squeeze-lts-no-check-valid-until

# Squeeze backports
cat <<EOF> /etc/apt/sources.list.d/squeeze-backports.list
deb http://ftp.de.debian.org/debian-backports squeeze-backports main
deb-src http://ftp.de.debian.org/debian-backports squeeze-backports main
EOF


#
# Debian Wheezy
#
# Wheezy main
cat <<EOF> /etc/apt/sources.list.d/wheezy.list
deb http://http.debian.net/debian/ wheezy main contrib non-free
deb-src http://http.debian.net/debian/ wheezy main contrib non-free
EOF

# Wheezy updates
cat <<EOF> /etc/apt/sources.list.d/wheezy-updates.list
deb http://ftp.de.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.de.debian.org/debian/ wheezy-updates main contrib non-free
EOF

# Wheezy security
cat <<EOF> /etc/apt/sources.list.d/wheezy-security.list
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
EOF

# Wheezy backports
cat <<EOF> /etc/apt/sources.list.d/wheezy-backports.list
deb http://ftp.de.debian.org/debian wheezy-backports main
deb-src http://ftp.de.debian.org/debian wheezy-backports main
EOF


#
# Debian Jessie
#
cat <<EOF> /etc/apt/sources.list.d/jessie.list
deb http://http.debian.net/debian/ jessie main contrib non-free
deb-src http://http.debian.net/debian/ jessie main contrib non-free
EOF

# Jessie updates
cat <<EOF> /etc/apt/sources.list.d/jessie-updates.list
deb http://httpredir.debian.org/debian jessie-updates main contrib
deb-src http://httpredir.debian.org/debian jessie-updates main contrib
EOF

# Jessie security
cat <<EOF> /etc/apt/sources.list.d/jessie-security.list
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
EOF

# Jessie backports
cat <<EOF> /etc/apt/sources.list.d/jessie-backports.list
deb ftp://ftp.de.debian.org/debian/ jessie-backports main contrib non-free
deb-src ftp://ftp.de.debian.org/debian/ jessie-backports main contrib non-free
EOF

apt-get update && apt-get -y dist-upgrade

Upgrade squeeze to wheezy
sed -i 's|squeeze|wheezy|g' /etc/apt/sources.list
apt-get update
apt-get -y dist-upgrade

fix wget certificate errors
apt-get install -y ca-certificates

Debian Mirrors
http://www.debian.org/mirror/list

Netinstall CD
http://cdimage.debian.org/debian-cd/current/amd64/iso-cd/
http://ftp.debian.org/debian/dists/squeeze/main/installer-amd64/current/images/netboot/mini.iso - squeeze netinstall cd

Net install from PXE
mkdir -p /var/lib/tftpboot/debian/squeeze/amd64
wget -q http://ftp.debian.org/debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux -O /var/lib/tftpboot/debian/squeeze/amd64/linux
wget -q http://ftp.debian.org/debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz -O /var/lib/tftpboot/debian/squeeze/amd64/initrd.gz

cat < /var/lib/tftpboot/pxelinux.cfg/debian-squeeze.conf
label linux
menu label Debian Squeeze installer 64 bit
kernel debian/squeeze/amd64/linux
APPEND initrd=debian/squeeze/amd64/initrd.gz auto url=http://installit.googlecode.com/hg/preseed/debian-preseed.seed locale=en_US console-setup/layoutcode=en netcfg/choose_interface=eth0 debconf/priority=critical DEBCONF_DEBUG=developer --
IPAPPEND 2
EOF

echo "MENU INCLUDE pxelinux.cfg/debian-installer.cfg" >> /var/lib/tftpboot/pxelinux.cfg/default

Net install Debian (boot installer from HDD)
mount /dev/sda1 /mnt/
mount --bind /mnt/boot/ /boot/

mkdir /mnt/boot
grub-install --boot-director=/mnt/boot/ /dev/sda

# get boot files
mkdir /boot/debian-installer/

# stable
wget http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz -O /boot/debian-installer/initrd.gz
wget http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux -O /boot/debian-installer/linux

# testing
wget http://ftp.debian.de/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz -O /boot/debian-installer/initrd.gz
wget http://ftp.debian.de/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux -O /boot/debian-installer/linux

# Ubunut Trusty
wget http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz -O /boot/debian-installer/initrd.gz
wget http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux -O /boot/debian-installer/linux

# edit grub config
mv /boot/grub/grub.cfg /boot/grub/grub.cfg.org
cat < /boot/grub/grub.cfg
set timeout=3
menuentry 'Debian Installer' {
linux /boot/debian-installer/linux auto url=http://preseed.panticz.de/preseed/debian-ubuntu-ssh-install.seed priority=critical locale=en_US console-setup/layoutcode=us keyboard-configuration/xkb-keymap=us netcfg/choose_interface=auto
initrd /boot/debian-installer/initrd.gz
}
EOF

# remove user created during installation
userdel -f service

wheezy
http://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
http://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux

pxe
LABEL linux
MENU LABEL Debian Installer 64 bit wheezy [Preseed]
KERNEL debian-installer/wheezy/linux
APPEND initrd=debian-installer/wheezy/initrd.gz auto url=http://installit.googlecode.com/hg/preseed/debian-preseed.seed locale=de_DE console-setup/layoutcode=de netcfg/choose_interface=auto debconf/priority=critical DEBCONF_DEBUG=developer --
IPAPPEND 2

Disable service
update-rc.d apache2 disable

apt-config
apt-config dump

Lenny repository (/etc/apt/sources.list)
deb http://ftp.de.debian.org/debian-archive/debian/ lenny main contrib

Preseed
http://d-i.alioth.debian.org/manual/en.i386/apb.html