Skip to content

Instantly share code, notes, and snippets.

View aperiodic's full-sized avatar

Dan Lidral-Porter aperiodic

  • BlackBerry
  • Seattle, WA
View GitHub Profile
@aperiodic
aperiodic / gist:1225735
Created September 18, 2011 23:58
Node-canvas greyscale jpg bug example
/**
* Script to demonstrate node-canvas greyscale JPG bug
*
* example input: http://i.imgur.com/BrPWa.jpg
* example output: http://i.imgur.com/eg2Nc.png
*/
var Canvas = require('canvas')
, Image = Canvas.Image;
var fs = require('fs');
@aperiodic
aperiodic / syslog
Created November 1, 2011 19:48
Failed reduce task's logs
2011-11-01 11:12:59,373 WARN org.apache.hadoop.conf.Configuration: /mnt/data/hadoop/mapred/local/taskTracker/ubuntu/jobcache/job_201110251936_0044/job.xml:a attempt to override final parameter: mapred.system.dir; Ignoring.
2011-11-01 11:12:59,374 WARN org.apache.hadoop.conf.Configuration: /mnt/data/hadoop/mapred/local/taskTracker/ubuntu/jobcache/job_201110251936_0044/job.xml:a attempt to override final parameter: mapred.local.dir; Ignoring.
2011-11-01 11:12:59,374 WARN org.apache.hadoop.conf.Configuration: /mnt/data/hadoop/mapred/local/taskTracker/ubuntu/jobcache/job_201110251936_0044/job.xml:a attempt to override final parameter: mapred.tasktracker.reduce.tasks.maximum; Ignoring.
2011-11-01 11:12:59,415 WARN org.apache.hadoop.conf.Configuration: /mnt/data/hadoop/mapred/local/taskTracker/ubuntu/jobcache/job_201110251936_0044/job.xml:a attempt to override final parameter: mapred.tasktracker.map.tasks.maximum; Ignoring.
2011-11-01 11:12:59,416 WARN org.apache.hadoop.conf.Configuration: /mnt/data/hadoop/mapr
@aperiodic
aperiodic / mapred-site.xml
Created November 1, 2011 20:04
TT's mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>REDACTED (an ec2 internal DNS name):8021</value>
<final>true</final>
</property>
@aperiodic
aperiodic / gist:1357108
Created November 11, 2011 03:29
lazybot config.clj
(let [plugins #{"dictionary" "lmgtfy" "google" "translate" "eball" "utils" "leet"
"clojure" "login" "log" "brainfuck" "whatis" "shorturl" "haskell"
"mail" "timer" "fortune" "rss" "title" "operator" "seen" "sed" "help"
"load" "embedded" "karma" "yesno" "autoreply" "weather"}]
{:servers [REDACTED] ; A list of servers.
:prepends #{"@"} ; The character you want for a prepend. Currently set to @
:weather {:token ""} ; Wunderground token.
:dictionary {:wordnik-key "99c266291da87b231f40a0c8902040da0b568588c25526cff"} ; Wordnik API key.
:sed {:automatic? true}
:max-operations 3 ; The maximum number of operations that can be running at any given time.
@aperiodic
aperiodic / gist:1673171
Created January 24, 2012 22:36
Hanging Reduce Task Stack Dump
Deadlock Detection:
No deadlocks found.
Thread 10740: (state = BLOCKED)
- java.lang.Thread.sleep(long) @bci=0 (Interpreted frame)
- org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.run() @bci=116, line=2740 (Interpreted frame)
Thread 10739: (state = BLOCKED)
@aperiodic
aperiodic / gist:1673985
Created January 25, 2012 01:23
TT JStack (when reduce tasks are hanging)
Deadlock Detection:
No deadlocks found.
Thread 23966: (state = IN_NATIVE)
- java.lang.UNIXProcess.waitForProcessExit(int) @bci=0 (Interpreted frame)
- java.lang.UNIXProcess.access$900(java.lang.UNIXProcess, int) @bci=2, line=20 (Interpreted frame)
- java.lang.UNIXProcess$1$1.run() @bci=165, line=132 (Interpreted frame)
set -g prefix C-h
# double prefix flips between current and last window
bind-key C-h last-window
unbind p
bind-key C-p previous-window
unbind n
bind-key C-n previous-window
# vi copy-mode keys
OpenSSH_5.2p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/dlp/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to clojars.org [173.230.139.200] port 22.
debug1: Connection established.
debug1: identity file /Users/dlp/.ssh/id_rsa type 1
debug1: identity file /Users/dlp/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu7
debug1: match: OpenSSH_5.3p1 Debian-3ubuntu7 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
@aperiodic
aperiodic / .ssh*
Created March 12, 2012 07:23
clojars public key woes
drwxr-xr-x 2 ciel ciel 4096 2012-03-12 00:11 .
drwxr-xr-x 3 ciel ciel 4096 2012-03-12 00:09 ..
-rw-r--r-- 1 ciel ciel 401 2012-03-12 00:08 authorized_keys
-rw------- 1 ciel ciel 1679 2012-03-12 00:10 id_rsa
-rw-r--r-- 1 ciel ciel 390 2012-03-12 00:10 id_rsa.pub
-rw-r--r-- 1 ciel ciel 884 2012-03-12 00:11 known_hosts
@aperiodic
aperiodic / gist:2341911
Created April 9, 2012 06:13
Strange error when using quil with SimpleOpenNI
Exception in thread "Animation Thread" java.lang.ClassCastException: quil.applet.proxy$processing.core.PApplet$IMeta$c506c738 cannot be cast to clojure.lang.IDeref
at clojure.core$deref.invoke(core.clj:2078)
at quil_kinect.core$setup.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Var.invoke(Var.java:397)
at quil.applet$applet$setup_fn__2190.invoke(applet.clj:192)
at quil.applet$applet$fn__2265.invoke(applet.clj:290)
at quil.applet.proxy$processing.core.PApplet$IMeta$c506c738.setup(Unknown Source)
at processing.core.PApplet.handleDraw(Unknown Source)
at quil.applet.proxy$processing.core.PApplet$IMeta$c506c738.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)