Skip to content

Instantly share code, notes, and snippets.

View skeptomai's full-sized avatar
🐒
Monkeying around

Christopher Brown skeptomai

🐒
Monkeying around
View GitHub Profile
@skeptomai
skeptomai / auth-headers.el
Last active December 10, 2015 01:08
creates Opscode authorization headers from a signature string
(defun auth-headers (sig-str)
(let* ((sig-len (length sig-str))
(sig-segs (1- (fceiling (/ sig-len 60.0) ) )))
(loop for x from 0 to sig-segs
for start = (* 60 x)
for stop = (+ (min 60 (- sig-len start) ) start)
collect (concat "X-Ops-Authorization-" (number-to-string (1+ x) ) ": " ( substring sig-str start stop )) )))
@skeptomai
skeptomai / gist:3628738
Created September 5, 2012 01:06
Goodreader sync files
196200_A Programming Language.pdf
1996-The Log-Structured Merge-Tree (LSM-Tree).pdf
6.05.HowToBeCreative.pdf
A tour of Scheme in Gambit.pdf
ABCDs of Paxos.pdf
AMQP Spec 0.8.pdf
Abstract Computing Machines.pdf
Adam's Advice and Reading List for High Tech Startup Entrepeneurs.pdf
Advanced Programming in the Unix Environment.pdf
Advanced encryption standard.PDF
@skeptomai
skeptomai / ruby-ohai.json
Created August 23, 2011 20:26
Ruby plugin for ohai in Common Lisp
{"gem_bin":"\/System\/Library\/Frameworks\/Ruby.framework\/Versions\/1.8\/usr\/bin\/gem","platform":"universal-darwin11.0","version":"1.8.7","release_date":"2010-01-10","target":"i686-apple-darwin11.0","target_cpu":"i686","target_vendor":"apple","target_os":"darwin11.0","host":"i686-apple-darwin11.0","host_cpu":"i686","host_os":"darwin11.0","host_vendor":"apple","bin_dir":"\/System\/Library\/Frameworks\/Ruby.framework\/Versions\/1.8\/usr\/bin","ruby_bin":"\/System\/Library\/Frameworks\/Ruby.framework\/Versions\/1.8\/usr\/bin\/ruby"}
(require 'json)
(defun file->filename (file)
(cdr (assoc 'filename (cdr file))))
(defun file->content (file)
(cdr (assoc 'content (cdr file))))
(defun gist-to-buffers (gist-buffer)
(interactive "bGist Buffer: ")
@skeptomai
skeptomai / http-twiddle.el
Created May 19, 2011 21:37
Sending signed requests to the Opscode Platform with Emacs and http-twiddle-mode
;;; http-twiddle.el -- send & twiddle & resend HTTP requests
;; This program belongs to the public domain.
;; Author: Luke Gorrie <luke@synap.se>
;; Maintainer: Hasan Veldstra <h@vidiowiki.com>
;; Created: 1 Feb 2006
;; Adapted-By: Hasan Veldstra
;; Adapted-By: Christopher Brown <cb@opscode.com>
;; Version: 1.0
log_level :info
log_location STDOUT
node_name 'skeptomaijun21'
client_key '/Users/cb/.chef/cb-user.pem'
chef_server_url 'https://api.opscode.com/organizations/skeptomaijun21org/'
cache_type 'BasicFile'
cache_options( :path => '/Users/cb/.chef/checksums' )
validation_client_name "skeptomaijun21org-validator"
validation_key "/Users/cb/.chef/skeptomaijun21org-validator.pem"
@skeptomai
skeptomai / gist:756291
Created December 27, 2010 16:58
Creating passwords of length 20 with OpenSSL random bytes and base64 encoding
# Another take on passwords with OpenSSL, from http://www.tech-recipes.com/rx/1264/generate-passwords-with-openssl/
require 'openssl'
require 'base64'
Base64.encode64(OpenSSL::Random::random_bytes(18))[0..19]
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 2, col 11: ` revision: 5ade3a82545fd290cbd7a94b60f325d96b9f05b3' (ArgumentError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:144:in `load_file'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:143:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:143:in `load_file'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.25/lib/bundler/definition.rb:16:in `from_lock'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.25/lib/bundler.rb:112:in `definition'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.25/lib/bundler.rb:105:in `runtime'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.25/lib/bundler.rb:99:in `load'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.25/lib/bundler.rb:76:in `setup'
{sub_dirs, ["apps/mochiweb",
"apps/ibrowse",
"apps/org_app",
"rel"]}.