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" '

Artificial Intelligence A.I.

Ubuntu 24.04 LTS headless server
NVIDIA Tesla P4
Issues with an Ubuntu 24.04 server VM "downtraining" PCI-E 3.0 Gen3 to PCI-E 3.0 Gen1 after the driver loads.

ii  nvidia-compute-utils-580-server       580.126.09-0ubuntu0.24.04.1             amd64        NVIDIA compute utilities
ii  nvidia-dkms-580-server                580.126.09-0ubuntu0.24.04.1             amd64        NVIDIA DKMS package
ii  nvidia-driver-580-server              580.126.09-0ubuntu0.24.04.1             amd64        NVIDIA Server Driver metapackage
ii  nvidia-firmware-580-server-580.126.09 580.126.09-0ubuntu0.24.04.1             amd64        Firmware files used by the kernel module
ii  nvidia-kernel-common-580-server       580.126.09-0ubuntu0.24.04.1             amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-580-server       580.126.09-0ubuntu0.24.04.1             amd64        NVIDIA kernel source package
ii  nvidia-utils-580-server               580.126.09-0ubuntu0.24.04.1             amd64        NVIDIA Server Driver support binaries
echo "options nvidia NVreg_EnablePCIeGen3=3" > /etc/modprobe.d/nvidia-pci-fix.conf
echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nouveau.conf
update-initramfs -u
  • Status Script
cat /usr/local/sbin/nvidia-status.sh 
#!/bin/bash
nvidia-smi -q | grep -A4 "PCIe Gener"
lspci -vvv -s $(lspci | grep -i 'NVIDIA' | awk '{print $1}')
nvidia-status.sh | grep -A5 LnkCap