Skip to content

Instantly share code, notes, and snippets.

View johannesboyne's full-sized avatar
👨‍💻
Building.

Johannes Boyne johannesboyne

👨‍💻
Building.
View GitHub Profile
$ time cat sample_data/* | ./go_mapper | ./go_reducer
cat sample_data/* 0,02s user 0,52s system 5% cpu 10,299 total
./go_mapper 6,33s user 3,65s system 95% cpu 10,299 total
./go_reducer 3,27s user 3,02s system 59% cpu 10,335 total
$ time cat sample_data/* | \
awk '{print $7}' | sort | uniq -c | \
awk '{ x[$2] += $1 } END { for (w in x) { print x[w] " " w } }' | \
sort -rn | sed 20q
cat sample_data/* 0.01s user 0.19s system 0% cpu 26.875 total
tr -cs A-Za-z '\n' | \
tr A-Z a-z | \
sort | \
uniq -c | \
sort -rn | \
sed ${1}q
git log --all --pretty=format:%cN | sort | uniq | while read ll; do git log --all --since=2.days.ago --pretty=format:%h//%cN//%s//%ad --no-merges | awk -F// '{print "- " $2 " worked on " $3 " (" $1 ")" }' | egrep "$ll"; done
#even better
git log --all --since=2.days.ago --pretty=format:%h//%cN//%s//%ad | egrep -v -i 'merge branch' | awk -F// '{print $4 " " $1 "\t" substr($2,0,7) "\t " $3}'
awk '{pages += $3; bytes += $4} END {print pages, bytes}' pagecounts-20140501-110000 | awk '{gtp += $1; gtb += $2} END {print "Total # of Pages: " gtp, "Total # of Bytes requested: " gtb}'
grep -c ruby *.txt | sed 's/.*:/ /' | awk '{total += $1} END {print total}'
find *.txt | while read fn; do ./indexone.sh $fn ; done | awk -f indexmerge.awk | sort | head -10
find . -name "*.txt" -ls | awk '{total += $7} END {print total/1000000 " MB"}'
curl https://us-east.manta.joyent.com/manta/public/examples/shakespeare/ | egrep -o '"name":.*?[^\\]",' | sed 's/"name":/ /' | awk '{print $1}' | tr -d '"|,'
cat *.txt | tr -cs A-Za-z '\n' | tr A-Z a-z | sort | uniq -c | awk '{ x[$2] += $1 } END { for (w in x) { print x[w] " " w } }' | sort -rn | head -10