Setting up Linux systems is a frequent activity for me. Whether it is configuring a Docker image, setting up a new SDCard for a Raspberry Pi or migrating from one laptop to another. This README is an ongoing record of installation snippets that I copy and paste.
md ~/dev
md ~/temp
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
sudo apt-get install -y curl \
unzip \
git \
zsh \
python2.7 \
apt-transport-https \
ca-certificates \
software-properties-common
git config --global user.email "troy.forster@gmail.com"
git config --global user.name "Troy Forster"
Download the latest Hyper from their website. Manually install by double-clicking.
xdg-open https://releases.hyper.is/download/deb
Install some useful hyper plugins.
hyper i hyper-pane
hyper i hyper-tabs-enhanced
hyper i hyper-night-owl
Open hyper so we can work in it for the remainder: hyper
. Don't forget to pin to favourites if using Ubuntu Desktop.
ZSH is a great alternative to bash and supports a multitude of useful plugins for developers
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
chsh -s `which zsh`
zsh
Configure my preferred theme by copying and pasting the following...
local ret_status="%(?:%{$fg_bold[green]%} :%{$fg_bold[red]%} )"
PROMPT='%{$fg[cyan]%}%d%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
...into nano ~/.oh-my-zsh/themes/tforster.zsh-theme
.
Create ~/.zshrc
export ZSH="/home/tforster/.oh-my-zsh"
ZSH_THEME="tforster"
plugins=(
git docker vscode aws
)
source $ZSH/oh-my-zsh.sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
# Add Python packages/scripts to path
alias python=python3
alias pip=pip3
export PATH=$PATH:$(python3 -m site --user-base)/bin
# tabtab source for packages
# uninstall by removing these lines
[[ -f ~/.config/tabtab/__tabtab.zsh ]] && . ~/.config/tabtab/__tabtab.zsh || true
unalias l
function l() { ls -la --color "$@" | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'; }
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
Download and install latest node nvm install node
npm config set init.author.name "Troy Forster"
npm config set init.author.email "troy.forster@gmail.com"
npm config set init.author.url "http://www.tforster.com"
npm config set init.license "MIT"
npm config set init.version "1.0.0"
Check https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ to ensure the key and multiverse lines are the latest.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo /usr/bin/python2.7 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Edit the credentials and config files in ~/.aws/.
xdg-open https://code.visualstudio.com/
to open and download the latest .deb file. Once installed, open VSCode and install the code-settings-sync extension. Press alt+shift+d
and follow the prompts to sync down the latest extensions and personal settings.
snap install postman
snap install slack
snap install spotify
- Trust the logitech Ultratouch Thin Mouse by following instructions at https://ubuntuforums.org/showthread.php?t=2390542
- To get a second monitor recognized on the Dell XPS 13 try
xrandr --auto
See https://docs.docker.com/engine/installation/linux/ubuntu/ for additional details and confirm the latest apt-key.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update -y
sudo apt-get install docker-ce -y
Docker Windows for 10 Home uses Docker Toolbox. To use Docker in Windows and Windows Sub System for Linux (WSL) the Docker daemon must run under Windows. The docker and docker-compose clients will work under WSL as TCP is available between hosts.
-
Run the .msi on https://docs.docker.com/toolbox/toolbox_install_windows/
-
Install Docker for Ubuntu as per instructions above, inside Linux Subsystem for Windows aka Bash
-
Install docker-compose for Ubuntu using sudo apt-get install docker-compose
-
Run Docker toolbox interactive shell
-
docker-machine env
-
Edit the output to convert cert path from Windows format to Linux format to get something like...
export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/mnt/c/Users/tforster/.docker/machine/machines/default/" export DOCKER_MACHINE_NAME="default" export COMPOSE_CONVERT_WINDOWS_PATHS="true"
... then copy and paste into Windows Bash and test with
docker run hello-world
For convenience symlink the WSL dev folder ln -s /mnt/c/Users/tforster/dev ~
Cleanup and existing Crouton chroot sudo rm -rf /usr/local/chroots/<chroot-name>/
. Note that this will be deprecated soon when Google releases Crostini.
Create a lightweight Crouton chroot for with XFCE desktop sudo sh ~/Downloads/crouton -r trusty -t xiwi,xfce
Install the ARM version of Visual Studio Code from https://code.headmelted.com/ with . <( wget -O - https://code.headmelted.com/installers/apt.sh )
sudo apt-get install jq
git clone joy followed by npm i, then install jq dep
download cascadia font, unzip and move mv *.ttf /usr/share/fonts/truetype