Reinstalling my workstation

Disclaimer

THIS IS NOT A BEST PRACTICE ON HOW TO INSTALL A LINUX BOX!
This document serves as a reminder to myself, on what needs to be done when reinstalling my workstation, and I have put it here to have it conveniently at hand. Because of this, the document may not be of any help to anybody but me. The last month I’ve had 3 failing harddrives, one new and 2 used ones, so this makes me want to document the process, at least in an overall fashion…

Installing dependencies

  • I have a script listing all my script dependencies and all software I always want installed, so this part is easy:
mydeps |awk '/FAILED/ {print $1}' >/tmp/deps

 

  • Massage the format of the file:
perl -p -ie 's,n, ,g' /tmp/deps

 

  • Resyncronize package content and package index:
apt-get update ; apt-file update

 

  • Download and install dependencies:
apt-get install `cat /tmp/deps`

 

Configuring Privoxy

  • Change listen port for privoxy by editing /etc/privoxy/config:
listen-address  localhost:8080

 

  • Restart privoxy:
/etc/init.d/privoxy restart

 

Configuring Tripwire

  • Change permissions on tripwire directory:
chmod 700 /etc/tripwire/

 

  • Restore policy file from backups and add/change entries if necessary:
cp twpol.txt  /etc/tripwire/twpol.txt

 

  • Install new tripwire policy file:
twadmin -m P /etc/tripwire/twpol.txt

 

  • Initialize the database:
tripwire -m i

 

 

Setting up mail server

  • Edit /etc/aliases and add forward of root’s mail:
root: YourUsername

 

  • Activate new mail alias:
newaliases

 

  • Test local e-mailing
  • Test remote e-mailing (forwarding and direct)

 

Setting up crontab

  • Replace the tripwire crontab script:
rm /etc/cron.daily/tripwire
cp ~/bin/twcheck /etc/cron.daily/

 

  • Add the corresponding crontabs to /etc/cron.hourly/, /etc/cron.daily/, /etc/cron.weekly/ and /etc/cron.monthly/ directories

 

  • Add user crontab:
crontab ~/documents/cronjobs.txt

 

Configuring printer

  • Set up printing with hplip (run as a regular user):
hp-setup

 

Configuring Rsyslogd

  • Edit /etc/rsyslog.d/50-default.conf and uncomment the desired logfiles.
  • Restart rsyslogd
/etc/init.d/rsyslogd restart

 

Configuring power management

  • Edit /etc/acpi/powerbtn.sh and add the following lines:
#  don't ѕhutdown if busy...
if [ -e /home/eek/bin/functions-bash ]; then
. /home/eek/bin/functions-bash
dontShutdown
fi

 

  • Restore script for restarting openvpn when waking up from suspend:
cp ~/bin/pm-resume-openvpn  /etc/pm/sleep.d/50-pm-resume-openvpn

 

  • Configure visudo with the following lines TOWARDS THE END of the file:
YourUsername ALL = NOPASSWD: /usr/bin/dbus-send
YourUsername ALL = NOPASSWD: /usr/sbin/pm-hibernate
YourUsername ALL = NOPASSWD: /usr/sbin/pm-suspend
YourUsername ALL = NOPASSWD: /etc/init.d/openvpn restart

 

  • Testing sleep and wake up
power sleep

 

Configuring Resolvconf

  • Edit /etc/resolvconf/resolv.conf.d/head and add nameserver:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.2

 

  • Edit /etc/resolvconf/resolv.conf.d/base and add domain:
domain monkey7.se

 

  • Restart resolvconf:
/etc/init.d/resolvconf restart

 

  • Verify the content of /etc/resolv.conf:
cat /etc/resolv.conf

 

  • Test name resolution

 

Setting up OpenVPN

  • restore files from backup:
cp m* ca.crt /etc/openvpn/

 

  • Restart openvpn:
/etc/init.d/openvpn restart

 

  • Verify interfaces:
ifconfig

 

  • Verify /etc/resolv.conf once more:
cat /etc/resolv.conf

 

  • Verify name resolution once more

 

 

Setting up NFS

  • Verify/add NFS exports:
vim /etc/exports

 

 

Setting up NTP

  • Verify/add servers in /etc/ntp.conf:
vim /etc/ntp.conf

 

 

Installing Java

  • Download the latest Java JRE (32-bits)
  • Find out what directories to use:
set |grep JAVA
JAVACMD=/usr/share/java-oracle/bin/java
JAVA_HOME=/usr/share/java-oracle

 

  • Extract the tar ball:
cd /usr/share ; tar -xvzf ~/download/java/jre-<version>-linux-i586.tar.gz

 

  • Create symlink to installed version:
ln -s jre<version> java-oracle

 

  • Testing the binary
$JAVACMD -version

 

Managing APT sources

  • Restore extra apt sources to the /etc/apt/sources.list.d/ directory:
  • Add missing public keys:
apt-importkey

 

Configuring  lm-sensors

Configure the sensors:

sensors-detect

Unless you have the latest mainboard with a new and unsupported chipset, pressing Enter to accept the defaults is usually enough. The last question should be answered by typing yes to save you the hassle of manually editing /etc/modules:

Do you want to add these lines automatically to /etc/modules? (yes/NO)

 

The installation suggest running kmod with a start parameter to load the kernel modules:

service kmod start

 

Verify that your sensors are working:

sensors

 

Finally, update the desktop widget if necessary.

 

Configuring Munin node

  • Add an allow statement in /etc/munin/munin-node.conf for the munin server:
allow ^192.168.1.2$

 

  • Restart munin node:
/etc/init.d/munin-node restart

 

Managing kernel updates

  • Install Ksplice Uptrack:
apt-get install ksplice-uptrack

 

  • The Ksplice Manager will start automatically

 

 

This lists of steps needed to get back on track will probably grow, but this is a good start.

 

 

 

 

This entry was posted in Linux and tagged , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

1 Response to Reinstalling my workstation

  1. Pingback: Using smartmontools to test a Motorola VIP1963 disk | apeekaboo:s wonderful world of Linux

Leave a Reply

Your email address will not be published. Required fields are marked *