Debian

<?php
$URL="https://raw.githubusercontent.com/panticz/scripts/master/debian/repositories.sh";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

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