8 # Post-installation reduction. (Answer "no" to GRUB question.)
9 dpkg-query -Wf '${Package} ${Priority}\n' | grep ' required' | sed 's/ required//' > list_white_unsorted
10 echo 'ifupdown' >> list_white_unsorted
11 echo 'isc-dhcp-client' >> list_white_unsorted
12 sort list_white_unsorted > list_white
13 dpkg-query -Wf '${Package}\n' > list_all_packages
14 sort list_all_packages > foo
15 mv foo list_all_packages
16 comm -3 list_all_packages list_white > list_black
17 apt-mark auto `cat list_black`
18 echo 'APT::AutoRemove::RecommendsImportant "false";' > /etc/apt/apt.conf.d/99mindeps
19 echo 'APT::AutoRemove::SuggestsImportant "false";' >> /etc/apt/apt.conf.d/99mindeps
20 DEBIAN_FRONTEND=noninteractive apt-get -y --purge autoremove
21 rm list_all_packages list_white_unsorted list_white list_black
22 echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf.d/99mindeps
23 echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf.d/99mindeps
25 # Call dhclient on startup.
26 cat > /etc/systemd/system/dhclient.service << EOF
28 Description=Ethernet connection
31 ExecStart=/sbin/dhclient eth0
34 WantedBy=multi-user.target
36 systemctl enable /etc/systemd/system/dhclient.service
38 # Package management config, system upgrade.
39 echo 'deb http://ftp.debian.org/debian/ jessie main contrib non-free' > /etc/apt/sources.list
40 echo 'deb http://security.debian.org/ jessie/updates main contrib non-free' >> /etc/apt/sources.list
41 echo 'deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free' >> /etc/apt/sources.list
44 apt-get -y dist-upgrade
47 apt-get -y install man-db manpages less
49 # Don't clear boot messages on start up.
50 sed -i 's/^TTYVTDisallocate=yes$/TTYVTDisallocate=no/g' /etc/systemd/system/getty.target.wants/getty\@tty1.service
53 echo 'Europe/Berlin' > /etc/timezone
54 cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
57 apt-get -y install locales
58 echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
61 # Clone git repository.
62 apt-get -y install ca-certificates
63 apt-get -y install git
64 git clone http://github.com/plomlompom/config
67 # Add user. Remove old user's config/ if it exists.
68 useradd -m -s /bin/bash plom
69 rm -rf /home/plom/config
70 su - plom -c 'git clone http://github.com/plomlompom/config /home/plom/config'
71 su plom -c '/home/plom/config/symlink.sh server'
74 apt-get -y install vim
76 su plom -c 'mkdir -p /home/plom/.vimbackups/'
78 # Set up openssh-server.
79 apt-get -y install openssh-server
82 apt-get -y install irssi
84 # Set up mail client system.
85 apt-get -y install getmail4 procmail mutt
86 su plom -c 'mkdir -p /home/plom/mail'
87 su plom -c 'mkdir -p /home/plom/mail/inbox/{cur,new,tmp}'
90 rm jessie_start_server.sh
92 # Set password for user.