Skip to content

Instantly share code, notes, and snippets.

@audrow
Last active January 5, 2022 23:37
Show Gist options
  • Save audrow/8535da34388128b8a55e4cf28490de16 to your computer and use it in GitHub Desktop.
Save audrow/8535da34388128b8a55e4cf28490de16 to your computer and use it in GitHub Desktop.
New Ubuntu Setup #process #open-robotics

New Ubuntu System Setup

Steps

This is a brief series of steps that I repeat when setting up a new Ubuntu 20.04 machine to work on.

  1. Set the keyboard to Dvorak
  2. All updates and upgrades
  3. Adjust settings
    1. In Displays, enable night light
    2. In Appearance, change to dark
    3. In Power, set blank screen to "Never"
  4. Setup core desktop programs
    1. Install the following from the Ubuntu Software app
      1. VS Code (code)
      2. Brave
    2. Set VS Code and Brave to be the only apps pinned
    3. Setup sync with Brave
    4. Login to password manager
    5. Connect VS Code to Github to sync settings
  5. Run the following in terminal
    sudo apt install -y curl git vim dconf-editor
  6. Switch capslock and escape (source)
    1. Run dconf-editor
    2. Go to org >> gnome >> desktop >> input-sources
    3. Set xkb-options to ['caps:swapescape']
  7. Install Deno
    # https://deno.land/
    curl -fsSL https://deno.land/x/install/install.sh | sh
    # Test with
    deno run https://deno.land/std/examples/welcome.ts
  8. Install Docker
    # https://get.docker.com/
    $ curl -fsSL https://get.docker.com | sh
    # Setup docker to run without sudo
    # https://docs.docker.com/engine/install/linux-postinstall/
    sudo groupadd docker
    sudo usermod -aG docker $USER
    newgrp docker
    # Test with
    docker run hello-world

Optional

  1. Setup VIM
  2. Setup Bashrc
    alias gb='git branch -a'
    alias gcb='git checkout -b'
    alias gd='git diff HEAD'
    alias gg='git gui'
    alias gl='git log --pretty=oneline --graph'
    alias gs='git status'
  3. Setup SSH key and connect to Github
  4. Setup Github's CLI
    # https://github.com/cli/cli/blob/trunk/docs/install_linux.md
    curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
    sudo apt update
    sudo apt install gh
    gh auth login
  5. Git config
    git config --global user.email "audrow@hey.com"
    git config --global user.name "Audrow Nash"

For Open Robotics

  • Add the following to your bashrc:
    alias gb='git branch -a'
    alias gcb='git checkout -b'
    alias gd='git diff HEAD'
    alias gg='git gui'
    alias gl='git log --pretty=oneline --graph'
    alias gs='git status'
    
    alias rh='cd $ROS_PATH'
    alias cdrr='cd /root/.local/share/rr/'
    alias cb='rh; colcon build --symlink-install'
    alias cbd='cb --cmake-args -DCMAKE_BUILD_TYPE=Debug'
    alias cbs='cb --packages-select'
    alias cbds='cbd --packages-select'
    alias cbu='cb --packages-up-to'
    alias cbdu='cbd --packages-up-to'
    alias code='code --user-data-dir /root/.visual_code/'
    alias ct='colcon test'
    alias ctl='ct --mixin linters-only'
    alias cts='ct --packages-select'
    alias ctls='ctl --packages-select'
    alias ctr='colcon test-result --verbose'
    alias ctra='colcon test-result --verbose --all'
    alias ctrd='colcon test-result --delete'
    alias gdb1='gdb --eval-command run --batch'
    alias vcscheckout='vcs custom --git --args checkout'
    alias STRESS='stress -c $(nproc) -m $(nproc) -i $(nproc) -d $(nproc)'
    function repeat { while \$1; do \$2:; done; }
    function repeatg { while gdb1 \$1; do \$2:; done; }
    function cbts { cbs $1 && cts $1 && ctr; }
  • Adding these to your bashrc if working with VIPER
    function kill_gazebo() {
    #killall gzserver
    pkill -9 gzserver > /dev/null 2>&1
    pkill -9 gzclient > /dev/null 2>&1
    pkill -9 python3
    }
    function kill_yamcs() {
    pkill -f "java.*YamcsServer" > /dev/null 2>&1
    }
    function kill_ros2() {
    ps -ef | grep 'rgsw_ws' | grep -v grep | awk '{print $2}' | xargs -r kill -9
    ps -ef | grep 'vipersim_ws' | grep -v grep | awk '{print $2}' | xargs -r kill -9
    ps -ef | grep 'ros2' | grep -v grep | awk '{print $2}' | xargs -r kill -9
    }
    function kill_rfsw() {
    pkill -9 qemu-system-ppc
    ps -ef | grep 'core-cpu' | grep -v grep | awk '{print $2}' | xargs -r kill -9
    }
    function kill_viper() {
    kill_gazebo
    kill_yamcs
    kill_ros2
    kill_rfsw
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment