Skip to content

Instantly share code, notes, and snippets.

View ahgittin's full-sized avatar

Alex Heneveld ahgittin

View GitHub Profile
# displays a summary list of commits in your current repo vs upstream branch and upstream master,
# and of working tree changes Added, Modified, Deleted, or not in index ("??")
THIS_COMMAND="$0 $@"
while true; do
case $1 in
-o|--offline)
OFFLINE=true
@willurd
willurd / web-servers.md
Last active July 22, 2024 15:25
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ahgittin
ahgittin / pss
Last active October 10, 2015 18:47
script to quickly list find and kill processes
#/bin/bash
help() {
echo "pss [command [option]]+ -- quickly list, find and kill processes"
echo "commands:"
echo " h -- help"
echo " g X -- grep X"
echo " gi X -- grep -i X (ignore case)"
echo " gv X -- grep -v X (show non-matching)"
echo " g2 X Y -- grep for X or Y (also g3, g4)"
echo " k -- kill"
@ahgittin
ahgittin / jstack-active
Created September 16, 2012 22:19
script to run jstack but just show those threads which are active ... a poor man's profiler, or how to make eclipse beach ball slightly more exciting :)
#!/bin/bash
jstack $@ | awk '
function onTraceBegin() {
onTraceEnd()
data["lineCount"]=0
data["head"]=$0
}
function onTraceEnd() {
if ("head" in data) {
@ahgittin
ahgittin / mvnf
Created March 29, 2012 18:40
"maven-fast" script to run maven across multiple directories easily: `mvnf -h` for help
#!/bin/bash
export DIRS=""
export ARGS="-o clean install -DskipTests"
if [[ -z $1 || $1 = "-h" || $1 == "--help" ]] ; then
echo
echo "MVNF: a simple script for building multiple maven directories"
echo
echo "usage: mvnf [ -x \"install -Dxxx\" ] dir1 [ dir2 [ ... ]]"
echo
echo "This will do a maven build in each directory specified, in order, "