Skip to content

Instantly share code, notes, and snippets.

@musemby
musemby / install_docker.sh
Created August 29, 2017 05:45
Docker installation script
# installs the latest version of docker-stable and edge
# from https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository
# TODO: enable optional installation of specific versions
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@musemby
musemby / branch.sh
Last active August 29, 2017 05:40
Show the current git branch you are working on
# indicates which git branch one is currently working on
# e.g musemby@server:~/scripts/ (fix-weird-bug)$ (currently on the fix-weird-bug branch)
# paste this into the .bashrc file and source it
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0m\]"
LIGHT_CYAN="\[\033[0;96m\]"
@musemby
musemby / ohshitgit.md
Last active April 20, 2017 15:16
Git commands to fix common blunders

Resetting HEAD to some commit in time do either:

  1. git reset HEAD@{index}
  2. git reset --hard <commit-index>

Add to a commit a file change you had left out:

  • git add <file-name>/ <.>
  • git commit --amend // Use this to just ammend the last commit message

Reverse a commit to master and move into a new branch

(while in master do:)