Linux Post Installation

Every time I install a fresh copy of Linux to one of my devices I have to think a long time what apps to install after the default install and what changes I normally do to config files etc. Since I'm sharing a very common problem to a whole lot of others (I'm getting older every day :-) I decided to write some kind of recipe to cook my own installation to save tons of time next time (what at poem, ain't it?! :-).

/etc/apt/apt.conf
/etc/apt/apt.conf.d/30proxy on newer systems (Ubuntu 16.04 and above)
Acquire::http { Proxy "http://proxy.mynet.local:1234/"; };

~/.bashrc
if [ "`id -u`" = "0" ]
then PS1='\n[\[\033[31m\]\u\[\033[00m\] @ \[\033[01;33m\]\h\[\033[00m\]] `pwd` (\t) \[\033[31m\]#\[\033[00m\] '
else PS1='\n[\[\033[32m\]\u\[\033[00m\] @ \[\033[01;33m\]\h\[\033[00m\]] `pwd` (\t) \[\033[32m\]$\[\033[00m\] '
fi
alias dir='ls -halF'
# map CAPS to left shift
xmodmap -e "keycode 66 = Shift_L"

/etc/profile
export HTTP_PROXY="http://proxy.mynet.local:1234/"
export FTP_PROXY="$HTTP_PROXY"
export HTTPS_PROXY="$HTTP_PROXY"
export http_proxy="$HTTP_PROXY"
export ftp_proxy="$HTTP_PROXY"
export https_proxy="$HTTP_PROXY"

/etc/default/grub
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=10
#GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_CMDLINE_LINUX_DEFAULT="nosplash"
GRUB_GFXMODE=1152x864
GRUB_GFXPAYLOAD_LINUX=keep

/etc/grub.d/05_debian_theme
set_default_theme(){
[...]
echo "${1}set menu_color_normal=yellow/blue"
echo "${1}set menu_color_highlight=white/green"

/etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254
broadcast 192.168.0.255
dns-nameserver 192.168.0.254
dns-search domain.test test lan home

/etc/init/tty1.conf
exec /sbin/getty --noclear -8 38400 tty1

For systemd:
vi /etc/systemd/system/getty@.service.d/noclear.conf
[Service]
TTYVTDisallocate=no
EOF
systemctl daemon-reload

/etc/init/tty12.conf
exec exec /usr/bin/htop > /dev/tty12 < /dev/tty12

Mandatory Packages:
sudo apt-get install gpm mc krusader kio kio-extras krename kdiff3 unace unrar unzip arj minicom krdc lsscsi openssh-server lhasa fbset htop inxi googler screen wakeonlan ffmpeg net-tools libpam-mount cifs-utils gddrescue pv sshfs rsync cryptsetup vmfs-tools testdisk dtach

Additional Packages:
sudo apt-get install libreoffice audacity vlc k3b wireshark dia krita kicad krfb lm-sensors xfce4-sensors-plugin lubuntu-restricted-extras pavucontrol handbrake asunder ghex flameshot thunderbird thunderbird-l18n-de gtkterm cutecom linssid thunderbird-locale-de wine xfce4-power-manager wine-stable icedtea-8-plugin project-x touchpad-indicator libreoffice-pdfimport printer-drivers-all openprinting-ppds

Additional Snaps:
sudo snap install skype nextcloud-client shotcut notepadqq

Fix snap packages not running for domain users
sudo snap connect notepadqq:network-manager :network-manager
sudo dpkg-reconfigure apparmor

and add

/home/DOMAIN/

Server Packages:
sudo apt-get install atftpd apache2 nfs-kernel-server

Optional Packages:
wine32:i386

Debian MultiArch:
sudo dpkg --add-architecture i386
sudo apt update

Install RDP-Server on Lubuntu:
apt-get install xrdp
vi /etc/xrdp/startwm.sh -> . /etc/X11/Xsession
vi /home/user/.xsession -> lxsession -e LXDE -s Lubuntu
systemctl restart xrdp

"Mixxx" is an open-source DJ-ing software. Forget about spending your hard earned money in Traktor, BPM-Studio etc., Mixxx is all you need!
sudo -E add-apt-repository ppa:mixxx/mixxx
sudo -E add-apt-repository ppa:mixxx/mixxxbetas
sudo apt-get update
sudo apt-get install mixxx

"XEN" is an open source virtualization software (in fact a hypervisor), it is not as easy and plug-and-play as VirtualBox for example, but definitely worth giving a try.
sudo apt-get install xen-hypervisor-amd64 xen-tools virt-manager ssh-askpass

"Touchpad-Indicator" is a superb utility to tweak your notebook's touchpad, mainly to get rid of that "Natural Scrolling" (who on God's earth invented that term??). Have a look here..

"Camera Monitor" is a nice tool if you own a web cam and you want to know it's status (especially for the ones built-in in netbooks/notebooks, they often have no power indicator!). Download the up-to-date package at Launchpad and then run

sudo apt-get install python-pyinotify
sudo dpkg -i cameramonitor-xyz.deb

or add the PPA and install from there.

"SAMBA4"is a possible replacement for Windows AD-DCs. Setting it up as DC is rather simple, just delete the standard smb.conf and run:

sudo samba-tool domain provision --use-ntvfs --realm=mydom.test --domain=MYDOM --server-role=dc --dns-backend=SAMBA_INTERNAL --adminpass="xxxxx"

Add these lines to /etc/samba/smb.conf to provide DNS services also to your clients:

dns forwarder = 8.8.8.8
# dns recursive queries = yes # not working, remove it

and run this command on your linux box:

net rpc rights grant 'SAMDOM\Domain Admins' SeDiskOperatorPrivilege -U'SAMDOM\administrator' -I dc1.samdom.example.com

To check the status, use:

net rpc rights list accounts -U'SAMDOM\administrator' -I dc1.samdom.example.com

Don't forget to add "winbind" to the passwd and group entries in /etc/nsswitch.conf !

"MySQL" database for ownCloud:

mysql -uroot -p

mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
mysql> CREATE DATABASE IF NOT EXISTS owncloud;
mysql> GRANT ALL PRIVILEGES ON owncloud.* TO 'username'@'localhost' IDENTIFIED BY 'password';

Wipe your hard disk with dd
dd if=/dev/zero of=/dev/sdX bs=1M &
while [ -e /proc/xxxxx ] ; do kill -USR1 xxxxx ; sleep 10 ; done

Repair broken boot loader
set prefix=(hd0,1)/boot/grub
set root=(hd0,2)
insmod linux
insmod normal
normal

Fix mscorefonts package not installing
wget ftp.de.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.6_all.deb
sudo dpkg -i ttf-mscorefonts-installer_3.6_all.deb

Get rid of this f**king systemd-resolved.service
systemctl disable systemd-resolved.service
service systemd-resolved stop
rm /etc/resolv.conf
apt install dnsmasq
systemctl disable dnsmasq.service
vi /etc/NetworkManager/NetworkManager.conf

Add "dns=dnsmasq" to [main] section.

Avidemux
sudo add-apt-repository ppa:ubuntuhandbook1/avidemux
sudo apt-get update
sudo apt-get install avidemux2.7-qt5 avidemux2.7-plugins-qt5

Update to 18.04 LTS breaks PHP support
sudo apt install apache2 php7.2 libapache2-mod-php7.2
sudo apt install php7.2-curl php7.2-xml php7.2-gd php7.2-mysql php7.2-zip php7.2-intl
a2dismod php7.0
a2enmod php7.2
systemctl restart apache2

Update 18.04 Hardware Enablement Stack
sudo apt install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04

Fix KiCad Mouse-Cursor Ghosting Problem with Ubuntu 18.04
sudo add-apt-repository ppa:js-reynaud/kicad-4
sudo apt-get update
sudo apt-get upgrade

Install Teamviewer 11 on Ubuntu 18.04

Maybe V7 performs better due to lack of "Device Management": https://download.teamviewer.com/download/version_7x/teamviewer_linux.deb

Empty password hash
openssl passwd -1 -salt XXxxXXxx

Disable automatic printer connection
systemctl stop cups-browsed && systemctl disable cups-browsed

"sudo -i" causes "HXproc_run_async: pmvarrun: No such file or directory" - add this to "/etc/security/pam_mount.conf.xml" :
   <pmvarrun>/usr/sbin/pmvarrun -u %(USER)</pmvarrun>
</pam_mount>