Skip to content

Instantly share code, notes, and snippets.

@PureForm
PureForm / colors.json
Created October 21, 2011 01:35
colors mapping
{
"colors": {
"_source": {
"compress": true
},
"properties": {
"user_id_loves": {
"type": "integer"
},
"tags": {
@PureForm
PureForm / _cluster-nodes.json
Created October 21, 2011 01:38
_cluster/nodes
{
"cluster_name": "cl_es",
"nodes": {
"nFKPpKkVQQ-CytCdJvNiOQ": {
"name": "Aardwolf",
"transport_address": "inet[/192.168.1.23:9300]",
"attributes": {},
"http_address": "inet[/192.168.1.23:9200]",
"os": {
"refresh_interval": 1000,
@PureForm
PureForm / index-info.json
Created October 21, 2011 01:41
index info
{
"cluster_name": "cl_es",
"master_node": "nFKPpKkVQQ-CytCdJvNiOQ",
"blocks": {},
"nodes": {
"nFKPpKkVQQ-CytCdJvNiOQ": {
"name": "Aardwolf",
"transport_address": "inet[/192.168.1.23:9300]",
"attributes": {}
}
@PureForm
PureForm / gist:1302913
Created October 21, 2011 01:45
JRE 1.6 crash
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000161b727, pid=4532, tid=3944
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# J org.apache.lucene.store.MMapDirectory$MMapIndexInput.readByte()B
#
@PureForm
PureForm / gist:1302916
Created October 21, 2011 01:48
JRE 1.7 crash
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000184b981, pid=8832, tid=8440
#
# JRE version: 7.0_01-b08
# Java VM: Java HotSpot(TM) 64-Bit Server VM (21.1-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# J org.apache.lucene.index.TermBuffer.read(Lorg/apache/lucene/store/IndexInput;Lorg/apache/lucene/index/FieldInfos;)V
#
CM.CheckboxRangeCheck = function (formID,checkboxIdPrefix,checkboxIdRegex) {
var lastCheckboxClickedID = "";
$("#" + formID + " input[type=checkbox]").on("click",function(e) {
if (e.shiftKey && (lastCheckboxClickedID !== "") && $(this).prop("checked") && $("#" + lastCheckboxClickedID).prop("checked")) {
var startIndex = parseInt(checkboxIdRegex.exec(lastCheckboxClickedID)[1],10);
var endIndex = parseInt(checkboxIdRegex.exec($(this).prop("id"))[1],10);
if (endIndex < startIndex) {
var tmp = startIndex;
root@chris-server:~# traceroute facebook.com
traceroute to facebook.com (66.220.149.11), 30 hops max, 60 byte packets
1 192.168.1.1 (192.168.1.1) 0.471 ms 0.754 ms 0.841 ms
2 73.94.124.1 (73.94.124.1) 9.335 ms 9.437 ms 9.632 ms
3 te-0-0-0-1-ur03.troutdale.or.bverton.comcast.net (68.85.148.1) 9.579 ms 13.075 ms 13.006 ms
4 ae-4-0-ar03.beaverton.or.bverton.comcast.net (68.87.216.13) 14.032 ms be-1-ur04.troutdale.or.bverton.comcast.net (68.85.243.170) 12.861 ms ae-4-0-ar03.beaverton.or.bverton.comcast.net (68.87.216.13) 14.095 ms
5 ae-1-0-ar03.troutdale.or.bverton.comcast.net (68.87.218.162) 13.669 ms ae-4-0-ar03.troutdale.or.bverton.comcast.net (68.85.243.253) 12.446 ms 12.208 ms
6 pos-2-0-0-0-cr01.seattle.wa.ibone.comcast.net (68.86.95.89) 20.274 ms pos-2-2-0-0-cr01.seattle.wa.ibone.comcast.net (68.86.95.97) 17.522 ms 17.626 ms
7 pos-1-14-0-0-cr01.sacramento.ca.ibone.comcast.net (68.86.85.201) 30.528 ms 30.528 ms 30.582 ms
8 pos-0-7-0-0-cr01.sanjose.ca.ibone.comcast.net (68
@PureForm
PureForm / gist:3545631
Created August 30, 2012 23:53
TROGDOR! THE BURNINATOR!
:::
:: :::.
\/, .:::::
\), \`-._ :::888
/\ \ `-. ::88888
/ \ | .( ::88
/,. \ ; ( ` .:8888
), \ / ;`` :::888
/_ \ __/_(_ :88
`. ,`..-' `-._ \ / :8
@PureForm
PureForm / gist:5340738
Created April 8, 2013 21:38
Add this to the end of `os.py`. This fixes the "from os import urandom as _urandom ImportError: cannot import name urandom" issue.
if not _exists("urandom"):
def urandom(n):
"""urandom(n) -> str
Return a string of n random bytes suitable for cryptographic use.
"""
try:
_urandomfd = open("/dev/urandom", O_RDONLY)
except (OSError, IOError):
require 'rubygems'
require 'base64'
require 'openssl'
require 'sinatra'
# The Shopify app's shared secret, viewable from the Partner dashboard
SHARED_SECRET = 'my_shared_secret'
helpers do