Skip to content

Instantly share code, notes, and snippets.

View mlc's full-sized avatar

mike castleman mlc

View GitHub Profile
@mlc
mlc / README.md
Last active August 29, 2015 13:58
@mlc
mlc / gist:caf2ca1bd1261b908f14
Created June 21, 2014 05:25
testing form field escaping in multipart/form-data forms
<!DOCTYPE html>
<html>
<head>
<title>multipart test</title>
<meta charset='utf-8'>
</head>
<body>
<h1>multipart test</h1>
<form action='/test' enctype='multipart/form-data' method='post'>
<p>
@mlc
mlc / .XCompose
Created July 7, 2015 18:41
$HOME/.XCompose
# -*- coding: utf-8; mode: conf -*-
include "%L"
<Multi_key> <s> <h> <r> <u> <g>: "¯\\_(ツ)_/¯"
<Multi_key> <s> <a> <d>: "😿"
diff --git a/app/models/asset_terms.rb b/app/models/asset_terms.rb
index 7969cd8..78e2688 100644
--- a/app/models/asset_terms.rb
+++ b/app/models/asset_terms.rb
@@ -4,22 +4,28 @@ class AssetTerms < ActiveRecord::Base
define_index do
indexes :identifier
indexes :title
- indexes :subject
+ # indexes :subject
@mlc
mlc / gist:738742
Created December 13, 2010 07:12
wikileaks nameservers
mlc@palm:~$ dig @a.nic.ch -t NS wikileaks.ch
; <<>> DiG 9.7.1-P2 <<>> @a.nic.ch -t NS wikileaks.ch
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16048
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 4
;; WARNING: recursion requested but not available
@mlc
mlc / test-client.rb
Created December 20, 2010 19:45
Demonstrating using XREP/XREQ to talk to a specific client. An abuse of ØMQ?
#!/usr/bin/env ruby
require 'rubygems'
require 'ffi-rzmq'
unless ARGV.size == 1
$stderr.puts "please provide your client identifier on the command-line."
exit 1
end
@mlc
mlc / gist:760245
Created December 30, 2010 20:21
sample nginx config for proxying rails.
upstream thin {
server 127.0.0.1:9000;
server 127.0.0.1:9001;
server 127.0.0.1:9002;
}
server {
listen 80;
server_name pbcore.vermicel.li;
@mlc
mlc / gist:825106
Created February 13, 2011 20:49
it's now trivial to crash almost any application written in Java. http://blogs.oracle.com/security/2011/02/security_alert_for_cve-2010-44.html
mozilla's spidermonkey is written in C++ and has no problem:
mlc@palm:~$ smjs
js> "2.2250738585072012e-308" * 2
4.450147717014403e-308
js>
but try with rhino, which is written in Java:
mlc@palm:~$ units
2411 units, 71 prefixes, 33 nonlinear units
You have: tempC(22)
You want: USD
conformability error
295.15 K
1 US$
mlc@palm:~$ units
2411 units, 71 prefixes, 33 nonlinear units
You have: 40 rod / hogshead
You want: mi / gal
* 0.001984127
/ 504