Skip to content

Instantly share code, notes, and snippets.

@josephabrahams
Last active September 6, 2018 18:28
Show Gist options
  • Save josephabrahams/1ee0386dd7555e6a36f7326e58cab242 to your computer and use it in GitHub Desktop.
Save josephabrahams/1ee0386dd7555e6a36f7326e58cab242 to your computer and use it in GitHub Desktop.

Revisions

  1. josephabrahams revised this gist Sep 6, 2018. No changes.
  2. josephabrahams created this gist Sep 6, 2018.
    20 changes: 20 additions & 0 deletions c_init.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    !/bin/sh

    # only require sudo password once during this script
    sudo -v
    while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &

    # remove need for typing sudo password in the future
    echo -e "\nubuntu ALL=(ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers

    # allow access to vm shared folders
    sudo usermod -aG vboxsf ubuntu

    # install SSH
    sudo apt-get update
    sudo apt-get -y install openssh-client=1:6.6p1-2ubuntu1
    sudo apt-get -y install openssh-server
    mkdir -pm 700 ~/.ssh

    # install GDB dashboard
    wget -P ~ git.io/.gdbinit