Ubuntu Server Setup

From Hurlster Wiki
Jump to navigation Jump to search

This page defines all the services that I run on my home server. This is mainly a recovery guide in the case that it poops itself.

How to clean up(purge) uninstalled packages

dpkg --purge $(dpkg --list | grep ^rc | awk '{ print $2; }')

Find best apt repos

pip install apt-select
apt-select -t 3

Pin Kernel

This is allow apt-get upgrades without upgrading kernel versions

  • /etc/apt/preferences
Package: linux-generic linux-headers-generic linux-image-generic linux-restricted-modules-generic
Pin: version 3.2.0.29.31
Pin-Priority: 1001
  • apt-cache policy linux-generic

How to set default kernel using GRUB2

#grep menuentry /boot/grub/grub.cfg 
menuentry 'Ubuntu, with Linux 2.6.38-12-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.38-12-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.38-11-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.38-11-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.38-8-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.38-8-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
  • If the following command outputs a submenu, then you have to prepend "Previous Linux versions>" ahead of your kernel name
#grep submenu /boot/grub/grub.cfg
submenu "Previous Linux versions" {
  • /etc/default/grub
GRUB_DEFAULT="Previous Linux versions>Ubuntu, with Linux 2.6.38-11-generic-pae"

if you don't set the Previous Linux versions, it doesn't go through the menu to find it..

# update-grub

Network Performance fix

# echo 'net.core.wmem_max=12582912' >> /etc/sysctl.conf
# echo 'net.core.rmem_max=12582912' >> /etc/sysctl.conf
# sysctl -p
  • PathTest download links

http://www.appneta.com/resources/pathtest-files/Windows_32-bit.zip
http://www.appneta.com/resources/pathtest-files/Linux_64-bit.zip
http://www.appneta.com/resources/pathtest-files/Linux_32-bit.zip

Speed testing

wget https://www.dropbox.com/s/afsvduxtyi5emth/bench.sh -O - -o /dev/null|bash

Network Performance Test


http://netalyzr.icsi.berkeley.edu/

Bash aliases

alias apt-get='apt-get -o Acquire::ForceIPv4=true'
alias dmesg='dmesg -T'
alias wget='wget -4'
alias curl='curl -4'
alias sudo='sudo env PATH=$PATH XBMC_HOME="/opt/plexhometheater/share/XBMC" '