Scramblings

Dev scratchpad. Digital garden

Linux - Ubuntu initial dev setup

Jul 24, 2020 | Reading Time: 4 min

I had to setup a fresh Ubuntu dev machine after quite some time. Given that this was a loaner machine, I wanted to make sure that I have a minimal viable dev setup ready as quickly as possible.

Below are the steps for the minimal things I need.

Upgrade packages

For a fresh setup it is better to first make sure that everything that is upgradable is up to date. If you have a specific version requirement for any package make sure you pin it at the package manager level.

Basic commands

1sudo apt update
2sudo apt upgrade
3sudo apt install software-properties-common apt-transport-https wget zsh git vim tree
4sudo apt autoremove

ZSH setup

  • ZSH is an extended Bourne shell.

  • Together with Oh-My-ZSH it provides a delight full dev experience.

  • I personally like to use the agnoster theme from ohmyzsh with the plugins git common-aliases zsh-syntax-highlighting zsh-autosuggestions

  • For Ubuntu terminal make sure you got to Terminal -> Preferences -> <Your Profile> -> Colors and uncheck the Use system colors option so that the theme colors are used in the terminal.

  • Ohmyzsh standard plugins do not require explicit installation. Community plugins require some installation. Plugins links and installation guides are:

My simple ~/.zshrc file:

 1# If you come from bash you might have to change your $PATH.
 2# export PATH=$HOME/bin:/usr/local/bin:$PATH
 3
 4# Path to your oh-my-zsh installation.
 5export ZSH="/home/username/.oh-my-zsh"
 6
 7ZSH_THEME="agnoster"
 8
 9# Which plugins would you like to load?
10# Standard plugins can be found in $ZSH/plugins/
11# Custom plugins may be added to $ZSH_CUSTOM/plugins/
12# Example format: plugins=(rails git textmate ruby lighthouse)
13# Add wisely, as too many plugins slow down shell startup.
14plugins=(git common-aliases zsh-syntax-highlighting zsh-autosuggestions)
15
16source $ZSH/oh-my-zsh.sh
17
18export HISTSIZE=100000
19export SAVEHIST=100000

SSH key-gen and add to repositories

Interacting with multiple hosted git repositories is much smoother when using SSH keys.

Specific git hosts provide their guides to do this, e.g: GitHub ssh key gen guide .

General setup includes:

  • Generate a ssh key pair on a machine.
  • Add it to your git host profile settings.
  • Test ssh access to git
1ssh-keygen -t ed25519 -C "email@example.com"
2ssh-keygen -t ed25519 -C "username@example.com"
3xclip -sel clip < ~/.ssh/id_ed25519.pub
4
5# Add your git host (GitLab/GitHub/BitBucket, etc) URL for git-example.com
6ssh -T git@git-example.com

Basic software install

  • VSCode. General post for VSCode helpers is here
  • Slack
  • Zoom
  • Hugo . Hugo is fantastic website building framework. Awesome for static sites.

Microsoft ergonomic keyboard setup (4000 and 2019 ergonomic keyboard)

  • All keyboard shortcuts can be configured using Settings > Keyboard > View and Customize shortcuts
  • Volume keys are generally enabled by default. Recheck under Sound and media
  • Favorite keys 1, 2 and 3 are already configured to Recent favorites of same number as Super + 1, ....
    • To modify them to an application you can follow instructions in this StackOverflow question . tl;dr: Install dconf-editor, modify app-hotkey-x at org.gnome.shell.extensions.dash-to-dock. Reboot/Relogin after any changes via dconf-editor
  • Media keys other than open media app (generally one that has right facing triangle inside a rectangle) can be configured using Sound and media
  • For open media app:
    • First disable the “Tools” key shortcut as mentioned in this StackOverflow question . tl;dr: Install dconf-editor, modify control-center-static at org.gnome.settings-daemon.plugins.media-keys. Reboot/Relogin after any changes via dconf-editor
    • If you want to open the default media app, you can now do that using Sound and media > Launch media player;
    • If you want to set a custom application you can do that via Custom shortcuts > + > {name; e.g music}, {your music apps cli command ; e.g: youtube-music}, {Tools}
  • For Calculator you can set it in Launchers.
  • Snipping is equivalent to PrtScn.
  • App switcher is equivalent to Activities or Tab switcher
  • Search is equivalent to Activities i.e (windows button)
  • Emoji needs to be set as a Custom shortcut > + > {Characters}, {gnome-characters}, {press the emoji button. It will come as Shift + Ctrl + Alt + Super + Space}. Office button can be set similarly to whatever you want.

Programming language settings

  • Go. Basic introductory primer is present here .
  • Python. Getting started link

Pull your code and go exploring :)