This file contains hidden or 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
| $paste <(xpath -q -e '//testcase/@name' $(find . -name 'TEST-*.xml') ) <(xpath -q -e '//testcase/@classname' $(find . -name 'TEST-*.xml') ) <(xpath -q -e '//testcase/@time' $(find . -name 'TEST-*.xml') ) | tr '=' ' ' | tr -d '"' | awk '{ print $6, $4, $2 }' | sort -n > testtimes |
This file contains hidden or 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
| for x in *.rpm; do mkdir ${x%%.rpm}; cd ${x%%.rpm}; rpm2cpio ../$x | cpio -idmv; cd ..; done |
This file contains hidden or 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
| # License: Public Domain | |
| # | |
| # Usage: git-above [ref] | |
| # | |
| # ref defaults to "origin/master" if not specified. | |
| # | |
| # Returns the commit directly after that commit. Useful for pushing | |
| # the "bottom" of your stack of changes above master. | |
| # | |
| # Is there a better way? |
This file contains hidden or 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
| // License: Public Domain | |
| // | |
| // Java Puzzler: what does this print? | |
| public class TernaryBoxing { | |
| public static void main(String[] args) { | |
| Long nullLong = null; | |
| try { | |
| takesLong(true ? nullLong : 1); | |
| } catch (NullPointerException e) { | |
| System.out.println("1"); |
This file contains hidden or 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
| for x in $(curl 'http://reviewboard/api/review-requests/?status=pending&from-user=philip&last-updated-to=2013-06-01' | jsonpipe | grep links/self/href | awk '{ print $2 }' | grep -v pending | tr -d \"); do | |
| curl -u "philip:$(cat /tmp/pass)" -v -XPUT $x -Fstatus=submitted; | |
| done |
This file contains hidden or 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
| # License: Public Domain | |
| $crontab -l | |
| #6 * * * * /home/philip/bin/reservation.sh | |
| ########################################################################### | |
| $cat bin/reservation.sh | |
| #!/bin/sh | |
| if curl -s http://rez.urbanspoon.com/reservation/start/2086 | grep -q 'Unfortunately'; then | |
| exit |
This file contains hidden or 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"; |
This file contains hidden or 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 hidden or 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 hidden or 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 |