Bookmarklet to highlight a tab after 30 minutes. Blinks the title when the timer has run out.
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
# 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 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 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 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 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 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 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
[0]theia:cdh5:hdfs(9781)$pwd | |
/Users/philip/src/smokes/hadoop/src/main/groovy/com/cloudera/itest/hadoop/hdfs | |
[0]theia:cdh5:hdfs(9782)$git log --oneline -n 1 HEAD | |
a7ff5ea CDH-16198: itests should accomodate name changes of CDK to Kite(Fixing the skipped morphline) | |
[0]theia:cdh5:hdfs(9783)$git grep -A1 '@Test' | grep public | sed -e 's!.*/!!' | sed -e 's/().*$//' | sed -e 's/ public void//' | sed -e 's/- /:/' | |
TestDFSAdmin.java:testBasic | |
TestDFSAdmin.java:testSafemode | |
TestDFSAdmin.java:testNamespace | |
TestDFSAdmin.java:testRefreshCommands | |
TestDFSAdmin.java:testUpgrades |
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
ls -1 /var/run/cloudera-scm-agent/process/ | \ | |
while read line; do | |
id=$(echo $line | cut -d "-" -f1) | |
process=$(echo $line | sed -e "s/^[0-9]*-//") | |
echo "$process $id" | |
done | sort -k1,1r -k2,2nr | \ | |
while read key value; do | |
if [ "$cur_key" = "$key" ]; then | |
echo -n ",$value" | |
else |
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
-- AppleScript to log into Cisco AnyConnect VPN | |
-- | |
-- Based on https://gist.github.com/andrewh/7135352 | |
-- | |
-- 1. Edit the "vpn" variable below. | |
-- 2. Add your VPN password into your keychain. Use | |
-- "security add-generic-password -a VPN_HOST -s VPN_HOST | |
-- from the command line, and then edit the password using | |
-- the Keychain Access application. | |
-- 3. From AppleScript Editor, use File...Export to export |