Ubuntu 19.04

Update system

apt update && apt upgrade && apt dist-upgrade

apt install unattended-upgrades apt-transport-https && dpkg-reconfigure unattended-upgrades

Dotfile management through chezmoi

First, install chezmoi through Snap (snap install chezmoi --classic) or manually (curl -sfL https://git.io/chezmoi | sh) if that is not available. It can later be upgraded by running chezmoi upgrade.

Chezmoi setup

Chezmoi needs to be setup before it can be used (see 1).

# Initialize chezmoi. This only has to be done on the *first* system.
chezmoi init
chezmoi cd
git remote add origin git@github.com:baltpeter/dotfiles.git
git push -u origin master # There needs to be some commit to do that first.

# Initialize chezmoi from my existing dotfiles repo. This has to be done on all subsequent systems.
chezmoi init git@github.com:baltpeter/dotfiles.git
chezmoi diff
chezmoi apply # Or run `chezmoi -v -n apply` for a dry-run that doesn't modify anything yet.

Managing config files

See: 1, 2, 3

Updating local configs from the repo

# To pull the latest changes from the repo:
chezmoi update

# To preview first:
chezmoi source pull -- --rebase && chezmoi diff

Adding a new file to the repo

chezmoi add [file.ext]

Editing an existing file

# It is important to only make the changes in chezmoi's directory (~/.local/share/chezmoi), not to the
# 'actual' files. Otherwise, the changes won't be persisted and overwritten on the next update.
chezmoi edit [file.ext]

# After editing, the changes can be comitted regularly.
chezmoi cd
git add .
git commit -m [commit message]
git push
# This can also be done through the alias as described below.
cmua

Other

Maintenance

  • Check for problems: chezmoi doctor (1)
  • Local and remote have different changes: chezmoi merge (2)

Aliases

  • cmua: Commit and push all pending configuration changes sh alias cmua='chezmoi source add . && chezmoi source commit && chezmoi source push'

Firefox

Install the 1Password X Firefox addon and login.

Next, signin to Firefox Sync.

Go into the Firefox preferences. Under General and Browsing, select Use autoscrolling (or set general.autoScroll to true in about:config).

Note for the future: If scrolling becomes laggy, try this solution.

Configure the following settings in about:config:

Setup environment

Get rid of the Amazon integration by running: apt purge ubuntu-web-launchers

Shell

apt install zsh

Then run the following both as root and user:

wget -O ~/.zshrc https://git.grml.org/f/grml-etc-core/etc/zsh/zshrc && wget -O ~/.zshrc.local https://git.grml.org/f/grml-etc-core/etc/skel/.zshrc && chsh -s /bin/zsh

In the Terminal, go to Edit and Preferences. Under the unnamed profile and the Command tab, check Run a custom command instead of my shell and enter /bin/zsh.

Gnome

  • Switch the Alt-Tab view: Go into the Keyboard preferences and change the Switch windows option to Alt + Tab. Further set Switch applications to Super + Tab.
  • Install the Gnome Tweak Tool: apt install gnome-tweak-tool
  • In the Gnome Tweak Tool, under Top Bar, select Weekday, Seconds, and Week Numbers. Under Windows, deselect Attach Modal Dialogs. Under Workspaces, select Workspaces om primary display only. :(
  • Disable the dock: gsettings set org.gnome.shell.extensions.dash-to-dock autohide false && gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed false && gsettings set org.gnome.shell.extensions.dash-to-dock intellihide false
  • In the settings dialog, under Devices and Mouse & Touchpad, bump the Mouse Speed to the maximum value. Under Search, disable Passwords and Keys and Ubuntu Software. Under Devices and Displays, enable Night Light. Under Privacy and Usage & History, disable Recently Used.
  • In the gedit preferences, under View, select Display line numbers, Highlight current line and Highlight matching brackets. Under Editor, set the Tab width to 4 and select Insert spaces instead of tabs and Enable automatic indentation. Under Fonts & Colors, select Solarized Dark as the Color Scheme. Under Plugins, enable Quick Highlight.

GPG

Mitigate SKS key server problems:

  1. In ~/.gnupg/gpg.conf, ensure there is no line starting with keyserver. If there is, remove it.
  2. Add the line keyserver hkps://keys.openpgp.org to the end of ~/.gnupg/dirmngr.conf.

TODO: Investigate parcimonie.sh.

SSH

Generate an SSH key using ssh-keygen -o -a 100 -t ed25519 (see here). Upload the corresponding public key to: GitLab, GitHub

Import the SSH key from Seafile.

Install the SSH server: apt install openssh-server and set the following directives in /etc/ssh/sshd_config:

PermitRootLogin no
PasswordAuthentication no
UseDNS no

In /etc/ssh/ssh_config, comment out the following directive to disable forwarding the locale to remote servers:

#   SendEnv LANG LC_*

and disable known_hosts hashing:

HashKnownHosts no

Then, restart the SSH server: service ssh restart

Gnome extensions

Install the Firefox addon and make sure the shell integration is installed: apt install chrome-gnome-shell

Install the following extensions:

Configure Dash to Panel as follows: Under Position and Multi-monitor options, enable Isolate monitors and disable Display favorite applications on all monitors. Under Style, set the Panel Size to 40. Under Behavior, disable Show favorite applications, disable Show Applications button, enable Isolate Workspaces and enable Ungroup applications. Under the Window preview options, set Time (ms) before showing to 1000. Under Fine-Tune, disable Animate switching applications and Animate launching new windows and enable Activate panel menu buttons (e.g. date menu) on click only. These settings can also be imported from the file configs/dash-to-panel.

Gnome theme

In the Gnome Tweak Tool, under Appearance, select Adwaita-dark for Applications and Yaru for all other theme options.

In a terminal, go into Edit and Preferences. Under the unnamed profile and Colors, uncheck Use colors from system theme and select Tango Dark under Built-in schemes.

Maybe consider also styling QT in the future.

Install software

Essential

dpkg --add-architecture i386

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | tee /etc/apt/sources.list.d/sublime-text.list
add-apt-repository ppa:stebbins/handbrake-releases
curl https://build.opensuse.org/projects/home:manuelschneid3r/public_key | apt-key add -
echo 'deb http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_18.10/ /' > /etc/apt/sources.list.d/home:manuelschneid3r.list
wget -qO- https://dl.winehq.org/wine-builds/winehq.key | apt-key add -
apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ cosmic main'
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | apt-key add -
echo "deb https://download.virtualbox.org/virtualbox/debian disco contrib" | tee /etc/apt/sources.list.d/virtualbox.list
curl -s https://syncthing.net/release-key.txt | apt-key add -
echo "deb https://apt.syncthing.net/ syncthing stable" | tee /etc/apt/sources.list.d/syncthing.list
add-apt-repository ppa:bit-team/stable
apt update

apt install curl telegram-desktop vlc sublime-text audacity gimp inkscape flatpak xdg-desktop-portal xdg-desktop-portal-gtk ffmpeg handbrake-gtk gnome-boxes virtualbox-6.0 albert units gparted nodejs yarn imagemagick pandoc wireshark gnome-sushi nfs-common wngerman syncthing build-essential backintime-qt4 whois gnome-contacts evolution exa
apt install --install-recommends winehq-stable winetricks
snap install spotify whatsdesk
snap install hugo --channel=extended
snap install skype --classic
flatpak install flathub org.gnome.FeedReader
yarn global add tldr

curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
chmod a+rx /usr/local/bin/youtube-dl

wget -O - https://raw.githubusercontent.com/laurent22/joplin/master/Joplin_install_and_update.sh | bash

Optional

add-apt-repository ppa:sebastian-stenzel/cryptomator
add-apt-repository ppa:x2go/stable
add-apt-repository ppa:unit193/encryption
add-apt-repository ppa:peek-developers/stable
apt update

apt install keepassxc cryptomator blender x2goclient chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra mediathekview binwalk hashcat steam peek qtcreator qt5-default
apt install texlive texlive-lang-german texlive-latex-extra texlive-generic-extra latexmk texlive-xetex
snap install insomnia veracrypt
flatpak install --from https://tabos.gitlab.io/project/rogerrouter/roger.flatpakref

lpadmin -p Roger-Router-Fax -m drv:///sample.drv/generic.ppd -v socket://localhost:9100/ -E -o PageSize=A4

Calendar and contact sync with Nextcloud

In the settings dialog under Online Accounts, add a Nextcloud account. If 2FA is enabled for Nextcloud, create a new app password before.

Legacy

Note: These instructions are not necessary anymore. Instead, follow the steps above.

Gnome Calendar and Contacts can sync with CalDAV and CardDAV servers, they just don’t expose that functionality through their UI. Instead, the servers need to be added to Evolution. (1)

To add the CalDAV server (for use in Gnome Calendar), open Evolution and in the File menu under New, click Calendar. Select the type CalDAV. Enter the calendar’s Name and select a Color. Then enter the calendar’s link for the URL and specify the User. Click Apply. (2)
If 2FA is enabled for Nextcloud, create a new app password to use.

To add the CardDAV server (for use in Gnome Contacts), open Evolution and in the File menu under new, click Address Book. Select the type CardDAV. Specify a Name and the URL.

Backups

Back In Time

TODO: Currently not in use.

Run Back In Time as root. Under General, set Where to save snapshots to /mnt/backintime and set the schedule to Repeatedly (anachron) and every hour. Under Include, add /. Under Auto-remove, enable Smart remove with the default settings.

Vorta

TODO: Backup to backup1 using Vorta.

Syncthing

TODO: Syncthing is currently not in use.

Set Syncthing to start automatically:

mkdir -p ~/.config/systemd/user
wget https://raw.githubusercontent.com/syncthing/syncthing/master/etc/linux-systemd/user/syncthing.service -O ~/.config/systemd/user/syncthing.service
systemctl --user enable syncthing.service
systemctl --user start syncthing.service

Increase the inotify limit: echo "fs.inotify.max_user_watches=204800" | tee -a /etc/sysctl.conf

The web UI is then available at http://127.0.0.1:8384/.