3 # need bzr and postfix for the setup below
4 DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends postfix openssh-server bzr python-paramiko apt-cacher-ng eatmydata
7 if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then
10 cp /home/martin/.ssh/id_rsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /root/.ssh/
13 # restore /etc bzr branch, rescue the files we do not want to restore
16 if [ ! -d /etc/.bzr ]; then
17 [ -e /backup-etc ] || bzr branch bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc
18 cp -av /backup-etc/* /etc/
19 cp -av /backup-etc/.bzr/ /etc/
21 chmod 600 /etc/ssh/ssh_*_key
22 chmod 700 /etc/ssl/private
23 chmod 640 /etc/ssl/private/ssl-cert-*
24 chown root:ssl-cert /etc/ssl/private/ssl-cert*
25 echo "none /tmp tmpfs defaults 0 0" >> /etc/fstab
28 # update postfix for new configuration
30 /etc/init.d/postfix restart
32 # remove packages that we do not need
33 killall apt-get || true # cronjob goo
34 apt-get install -y linux-signed-image-generic
35 apt-get purge -y --auto-remove hplip hplip-data printer-driver-hpcups brltty bluez-cups gnome-accessibility-themes gnome-orca onboard thunderbird deja-dup gnome-screensaver linux-headers-generic linux-generic || true
37 # install packages from network sources
38 killall apt-get || true
41 DEBIAN_FRONTEND=noninteractive eatmydata apt-get install --no-install-recommends -y --force-yes vim patchutils offlineimap diffstat gtimelog devhelp python3-doc manpages-dev weechat weechat-plugins weechat-scripts python-notify2 listadmin quilt mutt editmoin lintian ubuntu-dev-tools dput easytag texlive-lang-german texlive-latex-extra powertop qemu-kvm qemu-utils bzr-buildpackage git build-essential fakeroot devscripts libglib2.0-doc git-buildpackage d-feet libnotify-bin pastebinit lptools openvpn pdfjam sbuild schroot exiv2 gstreamer1.0-plugins-ugly gstreamer1.0-libav valgrind calibre autopkgtest
42 eatmydata apt-get install -y lxc lxd pandoc lmodern texlive-fonts-recommended pep8 pyflakes pssh network-manager-openvpn-gnome i3-wm i3status
44 # have schroot use tmpfs
45 rmdir /var/lib/schroot/unpack /var/lib/schroot/union/overlay/
46 ln -s /tmp /var/lib/schroot/unpack
47 ln -s /tmp /var/lib/schroot/union/overlay
50 echo "Setting up users"
52 if ! getent passwd joe > /dev/null; then
53 adduser --gecos "Joe" --encrypt-home joe
59 crontab -u martin - <<EOF
60 # m h dom mon dow command
61 05 * * * * \$HOME/bin/backup >/dev/null