Chris Lamb has a good Debian installation checklist, from which I stole most of this list.

   1 # Configure sudo, adding my user to the sudo group so I don't get password prompts
   2 aptitude install sudo
   3 adduser xjjk sudo
   4 echo '%sudo ALL=NOPASSWD: ALL' > /etc/sudoers.d/No-Passwords-for-sudo-Group
   5 chmod 0440 /etc/sudoers.d/No-Passwords-for-sudo-Group
   6 
   7 # Disable installation of recommended packages
   8 echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/90recommends
   9 
  10 # Configure locales to prevent harassment about it later
  11 aptitude install locales
  12 dpkg-reconfigure -plow locales
  13 # …or install all locales so they don't need to be configured/reinstalled
  14 aptitude install locales-all
  15 
  16 # Enable log compression with date suffixed extension
  17 cat /etc/logrotate.conf | sed "s/#compress/compress\ndateext/" > /etc/logrotate.conf.tmp
  18 mv /etc/logrotate.conf.tmp /etc/logrotate.conf
  19 
  20 # Prevent PAM from allowing easily-crackable passwords
  21 aptitude install libpam-cracklib
  22 
  23 # Install essential utilities
  24 sudo aptitude install \
  25 openssh-server screen \
  26 rsync \
  27 atool lzma rzip xz-utils \
  28 htop dstat iotop \
  29 manpages manpages-dev \
  30 strace tcpdump lsof \
  31 moreutils \
  32 dnsutils \
  33 chrony \
  34 vim less \
  35 bash-completion \
  36 sysfsutils procps \
  37 vnstat \
  38 unattended-upgrades \
  39 ncurses-term \
  40 cpufrequtils powertop \
  41 molly-guard
  42 
  43 # Enable automatic security updates (careful!) (TODO: this is interactive; how to pass "yes"?)
  44 sudo dpkg-reconfigure -plow unattended-upgrades
  45 
  46 # HDD Temperature/SMART monitoring utilities
  47 aptitude install hddtemp smartmontools
  48 sed -i 's/^#start_smartd=yes/start_smartd=yes/' /etc/default/smartmontools
  49 /etc/init.d/smartmontools start
  50 
  51 # Configure rsyslog for daily archival logging
  52 cat << EOF > /etc/rsyslog.d/51-cron.conf
  53 # Enable cron logging
  54 cron.* /var/log/cron.log
  55 EOF
  56 cat << EOF > /etc/rsyslog.d/99-archive.conf
  57 \$template DailyLogs,"/var/log/archive/%\$YEAR%%\$MONTH%/%\$YEAR%%\$MONTH%%\$DAY%.log"
  58 # Archive logging
  59 *.* -?DailyLogs
  60 EOF
  61 cat << EOF > /etc/cron.daily/rsyslog-archive
  62 #!/bin/sh
  63 # Compress *.log-files not changed in more than 24 hours
  64 find /var/log/archive -type f -mtime +1 -name "*.log" -exec xz '{}' \;
  65 EOF
  66 chmod +x /etc/cron.daily/rsyslog-archive
  67 
  68 # Async logging for rsync (commit every 30m)
  69 cat << EOF > /etc/rsyslog.d/98-async.conf
  70 \$OMFileFlushInterval 1800
  71 \$OMFileASyncWriting on
  72 EOF
  73 
  74 # Use tmpfs for /var/run and /var/lock (may break some buggy packages), like Ubuntu
  75 cat << EOF >> /etc/default/rcS
  76 RAMRUN=yes
  77 RAMLOCK=yes
  78 EOF
  79 
  80 # Allow running X11 apps remotely
  81 sudo aptitude install xbase-clients