This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sense of puppet circular dependency error messages. | |
# Tags: graphviz, puppet | |
# See output at http://i41.tinypic.com/b6yeqv.jpg | |
$ cat circular.pp | |
node default { | |
exec { "/a": require => Exec["/b"] } | |
exec { "/b": require => Exec["/c"] } | |
exec { "/c": require => Exec["/a"] } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Python code for http://www.cloudera.com/blog/2009/06/17/analyzing-apache-logs-with-piganalyzing-apache-logs-with-pig/ | |
import sys | |
import math | |
def rescale(values, low=0, high=4095): | |
"""Linearly rescales values to be strictly between low and high.""" | |
maxval = max(values) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $unixtime 1354232717 | |
# local Thu 29 Nov 2012 03:45:17 PM PST utc Thu 29 Nov 2012 11:45:17 PM GMT | |
unixtime () | |
{ | |
gawk "BEGIN { print \"local\", strftime("'"'"%c"'"'", $1), \"utc\", strftime("'"'"%c"'"'", $1, 1) ; }" | |
} | |
# Alternately, | |
# $date -d @1354298146 | |
# Fri Nov 30 09:55:46 PST 2012 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dot -Tpng -o out.png <(cat stacks.txt | awk '/^Thread/ { cur = $2 } /Blocked by/ { print "t"cur, "->", "t"$3 } BEGIN { print "digraph G {"} END { print "}" }') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -n "Max core file size=unlimited:unlimited" > /proc/$(pgrep -f some_name)/limits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hadoop jar /usr/lib/hadoop-0.20-mapreduce/contrib/streaming/hadoop-streaming-2.0.0-mr1-cdh4.3.0-SNAPSHOT.jar -input /user/philip/single_line -output $(mktemp) -mapper 'touch /tmp/philip_was_here' -jobconf mapred.reduce.tasks=0 -jobconf mapred.map.tasks=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Apache License | |
# | |
# $python impala.py 'select "hello", "there"' | |
# ['hello\tthere'] | |
import sys | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps hax -o rss,vsz,command | awk '{ if ($1 > 0) { print $2/$1, $3 } }' | sort -n | tail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jmap -histo:live $pid > old.jmap | |
sleep $((60*60)) | |
jmap -histo:live $pid > new.jmap | |
cat old.jmap | awk 'BEGIN { OFS="|" } /:/ { print $2, $3, $4 }' > old.txt | |
cat new.jmap | awk 'BEGIN { OFS="|" } /:/ { print $2, $3, $4 }' > new.txt | |
sqlite3 | |
sqlite> create table new(count, bytes, class); | |
sqlite> create table old(count, bytes, class); | |
sqlite> .import new.txt "new"; | |
sqlite> .import old.txt "old"; |
OlderNewer