Skip to content

Instantly share code, notes, and snippets.

View willis7's full-sized avatar
🏠
Working from home

Sion Williams willis7

🏠
Working from home
View GitHub Profile
@willis7
willis7 / clean-node.sh
Created March 13, 2017 21:46
Delete all node_modules folders recursively on Mac
find . -name "node_modules" -exec rm -rf '{}' +

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@willis7
willis7 / chef-cheat-sheet.md
Last active February 24, 2017 10:54
Chef cheat sheet

Typing chef from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common chef Commands

Test kitchen

Command Description
@willis7
willis7 / conda-cheatsheet.md
Last active April 13, 2017 07:06
Conda cheat sheet

Typing condafrom the command line will display a list of all available commands.

Common Conda Commands

  • conda create -n lab python=3.5 -- create a new environment by name lab which uses python 3.5
  • conda env update --prune --quiet --name monkey --file environment.yml -- create or update env from .yml

Tips

  • conda env export > environment.yml -- export an environment for reuse

Housekeeping

@willis7
willis7 / update-index-chmod.sh
Created February 8, 2017 08:43
How to change file premissions in Git on Windows
# inspect file permissions
$ git ls-tree HEAD
# set executable bit
$ git update-index --chmod=+x script.sh
# commit the change
$ git commit -m "Changing file permissions"
@willis7
willis7 / clientDoGzip.go
Created January 13, 2017 13:52 — forked from mrosset/clientDoGzip.go
Client.Do will not uncompress response body
package main
// run this file with `go run clientDoGzip.go, and then file tmp.out to verify body is gzipped
import "compress/gzip"
import "net/http"
import "fmt"
import "io"
import "log"
import "os"
@willis7
willis7 / docker-cheat-sheet.md
Last active August 6, 2018 10:27
Docker cheat sheet

Typing docker or docker-machine from the command line will display a list of all available commands.

Common Docker Commands

Command Description
docker exec -it CONTAINER_ID /bin/bash run a command in an already running container
docker tag 7d9495d03763 maryatdocker/docker-whale:latest tag a local image
docker login login to docker hub
docker push maryatdocker/docker-whale:latest push your tagged image to Docker Hub
docker stats <container_name> runtime stats for a given container

Common Brew Commands

  • brew cleanup - remove old objects used by brew
  • brew outdated - list all outdated installs
  • brew switch go 1.8 - switch version
@willis7
willis7 / git-cheat-sheet.md
Last active May 30, 2017 07:38
Git cheat sheet

Common Git Commands

Command Description
git remote -v list the remotes
git pull --rebase rebases your local changes on top of your teammates' without creating a merge commit
git rebase --interactive rewrites commits but gives you a chance to modify them as they are reapplied onto the new base

History

| Command | Description |

@willis7
willis7 / kubectl-cheat-sheet.md
Last active January 10, 2017 08:59
Kubernetes Cheat Sheet

Common Kubectl Commands

Tips

  • kubectl delete pods,services -l name=myLabel -- delete pods and services with label name=myLabel.
  • kubectl config use-context minikube -- switch to a different Kubernetes context (minikube in this case)