Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
Last active May 18, 2020 17:05
Show Gist options
  • Save jfeilbach/7865e459f5d80d7de75695e02ef3e26c to your computer and use it in GitHub Desktop.
Save jfeilbach/7865e459f5d80d7de75695e02ef3e26c to your computer and use it in GitHub Desktop.
Setup Ubuntu 20.04/19.10 steps

Steps to recover Ubuntu Dev desktop

Install OS

  • Create user

Login

  • Add online accounts as needed
  • Google
  • Ubuntu One

Patch

  • sudo apt update
  • sudo apt upgrade
  • sudo reboot
  • Firefox login to sync extensions and bookmarks. Passwd is in Bitwarden.

Install software

  • sudo apt-get install chrome-gnome-shell gnome-tweaks vim curl python3-pip xdg-desktop-portal xdg-desktop-portal-gtk flatpak gir1.2-gtop-2.0 gir1.2-nm-1.0 gir1.2-clutter-1.0 gnome-keyring-daemon imagemagick libheif1 libheif-examples jq

Flatpack

  • sudo apt install flatpak
  • flatpak install flathub org.gnome.FeedReader
  • sudo add-apt-repository ppa:alexlarsson/flatpak
  • sudo apt install gnome-software-plugin-flatpak
  • flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

MS Teams

  • curl -O https://aka.ms/get-teams-linux
  • sudo apt install teams_1.3.00.958_amd64.deb

Gnome setup

Grub config

  • sudo vim /etc/default/grub
    • add mitigations=off
    • run sudo update-grub
    • sudo reboot (at some point)

Remove desktop icons

  • run gnome-tweaks
  • go to extensions
  • go to Desktop Icons
  • disable Show the trash icon in the desktop

Mouse

  • Go to Settings
  • Then go to Devices
  • then go to Mouse & Touchpad
  • Enable Natural Scrolling

Bash settings

  • curl https://gist.githubusercontent.com/jfeilbach/bcc72c4a1e74f4bea06963321ae35d04/raw/b6abf66b2f7f79bb2c0999d0d4ed534f1e58cae5/.bashrc > ~/.bash_aliases
  • curl https://gist.githubusercontent.com/jfeilbach/ > ~/.bash_profile
  • sudo update-alternatives --config editor

More software

AWS Tools

  • curl -O https://gist.githubusercontent.com/jfeilbach/455d6f75ceacec7bb3b63c777cdd1d0c/raw/acfc84f41ccd3c914feede2a057dbf2fad70eb3c/awscli.gpg.pub
  • gpg --with-fingerprint --import-options show-only --import < awscli.gpg.pub
  • gpg --import awscli.gpg.pub
  • curl -o awscliv2.sig https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip.sig
  • `cd ~/Downloads ; awsurl='https://awscli.amazonaws.com' ; file='awscli-exe-linux-x86_64.zip' && curl -O "${awsurl}/${file}"
  • key='Primary key fingerprint: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C' ; gpg --verify awscliv2.sig awscli-exe-linux-x86_64.zip && echo ${key}
  • unzip ${file} && cd ~/Downloads/aws && ./install -i ~/.local/aws-cli -b ~/.local/bin
  • I you are not using virtualenv, to install globally: sudo pip install awscli
  • Tab completion setup
    • bash:
      • complete -C aws_completer aws
    • zsh:
      • For zsh please refer to bin/aws_zsh_completer.sh. Source that file, e.g. from your ~/.zshrc, and make sure you run compinit before: $ source bin/aws_zsh_completer.sh
      • The bash compatibility auto completion (bashcompinit) is used. For further details please refer to the top of bin/aws_zsh_completer.sh

Update AWS CLI version 2

sudo ~/Downloads/aws/install --bin-dir /home/jason/.local/aws-cli --install-dir /usr/local/aws-cli --update

AWS Setup

  • aws ec2 authorize-security-group-ingress --group-name MySecurityGroup \ --ip-permissions '{"FromPort":22,"ToPort":22,"IpProtocol":"tcp","IpRanges":[{"CidrIp": "0.0.0.0/0"}]}'

Set default editor

  • sudo update-alternatives --config editor

HP printer Drivers

Fed tool

  • Be sure you already have run aws configure before setup of fed cli tool
  • Download from confluence
  • sudo cp -v ~/Downloads/fed-linux-amd64/fed /usr/local/bin/fed && sudo chmod -v 755 /usr/local/bin/fed
  • username="[USAC ID]"
  • Build an AWS CLI profile
    • fed --username <username> list
  • Get the AWS account ARN(s) for profile
    • fed --username <username> list
    • This is the ARN(s) from the above output
  • Store the profile
  • fed -u <username> add -p <profile name> <ARN>
  • Inspect your ~/.aws/credentials file
  • Do this for each profile you want added to your AWS configuration
  • There no remove command. Manually edit ~/.aws/credentials
  • Generate access key, secret access key, and session token
    • fed -u <username> up <profile>
  • Edit credentials file as needed
    • Optional: add "region = us-east-1"
    • Optional: increase timeout, maximum is 12 hours, add "fed_role_duration = 43200" Otherwise the default value is one hour. I never was able to get this to work.
  • Store Username as env var
  • If your your localhost username does not match your PIN you can set and environment variable called 'FED_USERNAME'
    • You can now simply run: fed up <profile>, e.g. fed up di
  • Set Default profile
  • If you spend time in a particular AWS profile you might want to set the environment variable called 'AWS_DEFAULT_PROFILE'
  • e.g. export AWS_DEFAULT_PROFILE='di'
  • Test each profile
    • export CONFIG_FILE="$HOME/.aws/credentials" ; fed up <profile> ; cat ~/.aws/credentials ; for profile in $(awk '/^[/ { gsub("]", ""); print $2 }' < $CONFIG_FILE); do aws ec2 --profile $profile" done

Login screen background

  • sudo update-alternatives --config gdm3.css

Install Backup Browser (Chrome)

  • curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
  • sudo apt install google-chrome-stable_current_amd64.deb
  • rm -vf google-chrome-stable_current_amd64.deb

Uninstall Google Chrome

  • sudo apt purge google-chrome-stable
  • rm -rvf ~/.config/google-chrome/

Subllime Text

  • wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
  • sudo apt-get install apt-transport-https
  • Channel
    • Stable
      • echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
    • Dev
      • echo "deb https://download.sublimetext.com/ apt/dev/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
  • Update apt sources and install Sublime Text
    • sudo apt-get update
    • sudo apt-get install sublime-text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment