Skip to content

Instantly share code, notes, and snippets.

@terry-heinel
terry-heinel / file_io.scala
Created February 15, 2017 17:17 — forked from mistahenry/file_io.scala
Read file into List of lines in Scala
import scala.io.Source
val listOfLines = Source.fromFile("filename.txt").getLines.toList
@terry-heinel
terry-heinel / checkDockerDisks.sh
Created January 30, 2017 22:56 — forked from robsonke/checkDockerDisks.sh
This Bash script will loop through all running docker containers on a host and list the disk usage per mount. In case it's breaching the 65%, it will email you.
#!/bin/bash
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
host=$(hostname)
# loop through all containers
for container in $containers
do
echo "Container: $container"
@terry-heinel
terry-heinel / git-stop-tracking-remote-branch.md
Created December 21, 2016 23:48 — forked from magnusbae/git-stop-tracking-remote-branch.md
How to make Git stop track a remote branch without deleting the remote branch.

You don't have to delete your local branch.

Simply delete your remote tracking branch:

git branch -d -r origin/<remote branch name> (This will not delete the branch on the remote repo!)

See "Having a hard time understanding git-fetch"

there's no such concept of local tracking branches, only remote tracking branches.

@terry-heinel
terry-heinel / gist:d0f99b6e653906cde6dc241a01823b27
Created November 28, 2016 17:15 — forked from n00neimp0rtant/gist:9515611
simple squash without rebase
## within current branch, squashes all commits that are ahead of master down into one
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case)
## commit any working changes on branch "mybranchname", then...
git checkout master
git checkout -b mybranchname_temp
git merge --squash mybranchname
git commit -am "Message describing all squashed commits"
git branch -m mybranchname mybranchname_unsquashed
git branch -m mybranchname