Useful Commands for New Systems
Ubuntu Server
Set Timezone to US/Denver
Resize the Boot Volume
Sometimes the Ubuntu installer does not utilize the entire boot disk.
Run these commands to expand the logical volume and the ext4 filesystem on top of it to the maximum size of the storage device.
Boot in Text/Console Mode
Disable Ubuntu Pro Message
LVM
Create a Logical Volume
This creates an LV using all of the free space on the storage device. It uses optimal track alignment.
Apt
Force Upgrade Packages
When apt won't upgrade packages during an apt upgrade
run with messages like this:
You can force-upgrade the packages with:
Or, you can do it one-by-one with:
SSH
Generate an Ed25519 KeyPair
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "[email protected]"
Shell Enhancements
colorls
screenrc
Put this in ~/.screenrc
for a nicely decorated GNU Screen session.
Linux
vbell off
backtick 1 60 60 awk '{if ($1=="MemTotal:") mt = $2; if ($1=="MemFree:") mm = $2; if ($1=="Buffers:") mb = $2; if ($1=="Cached:") mc = $2} END {printf ("%2.1f"), ((mt-(mm+mb+mc)) * 100 / mt);print "%M"}' /proc/meminfo
backtick 2 60 50 awk '{if ($1=="SwapFree:") fs = $2; if ($1=="SwapTotal:") ts = $2} END {printf ("%2.1f"),((ts-fs) * 100 / ts );print "%S"}' /proc/meminfo
defscrollback 30000
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m/%d %{W}%c %{R} %l %{G} %1` %2`]'