How To Notes - tnballo/notebook GitHub Wiki

Reference for those little tasks that are just uncommon enough to forget the steps involved.

Mount a USB drive


  1. List block storage devices:

    • sudo blkid
  2. Within the list, find the find the entry corresponding to the USB drive you want to mount.

    • Example entry: /dev/sda1: LABEL="WIN7ISO" UUID="AABE-7CAA" TYPE="vfat" PARTUUID="c3072e18-01
  3. Create a new mount point, if one doesn't already exist:

    • sudo mkdir /mnt/usbdrive
  4. Mount the USB drive, mapping the device (from the list entry) to the mount point:

    • sudo mount /dev/sda1 /mnt/usbdrive

Change System Timezone


  1. Check current timezone:

    • timedatectl
  2. List availible US timezones:

    • timedatectl list-timezones | grep "America"
  3. Set new timezone:

    • timedatectl set-timezone Zone/SubZone

Record screen to GIF


Recording duration in seconds:

  • byzanz-record --duration=30 my_screen_thirty_sec.gif 2>/dev/null & clear

Create a Temporary Python Virtualenv for Legacy Package Installs


  1. Create a new python2 virtualenv in the current directory, then activate it:

    • virtualenv -p /usr/bin/python2 py2env
    • source py2env/bin/activate
  2. When inside this environment, you should see (py2env) preceeding the normal terminal prompt. Now install the legacy package required with version explcitly specified:

    • pip install dpkt==1.8.5
  3. When done running the legacy scripts, deactivate and remove the virtualenv:

    • deactivate
    • rm -rf py2env/

Install Python 3.X with PyEnv


  1. Install pyenv pre-requisite packages to avoid build problems:

    • sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
  2. Install pyenv as described here (be sure to update .bashrc as prompted):

    • curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
    • pyenv update
  3. Install a python3 version, this may take a while:

    • pyenv install 3.6.6
  4. Verify that command pyenv versions show output similar to the below (use pyenv global <version> to set active):

  system
* 3.6.6 (set by /home/username/.pyenv/version)
⚠️ **GitHub.com Fallback** ⚠️