Skip to content

Instantly share code, notes, and snippets.

View jim80net's full-sized avatar

Jim Park jim80net

  • Scribd
  • San Francisco, CA
  • 02:32 (UTC -07:00)
  • X @jim80net
View GitHub Profile
@lukebayes
lukebayes / ERBResolver
Created October 21, 2009 16:55
A Rake Task that makes it stupid-easy to render ERB templates to disk
##################################
# MIT LICENSE
# Copyright (C) 2012 Luke Bayes
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@stevebourne
stevebourne / Gemfile
Created April 15, 2012 19:28
Add facebook auth to a Clearance app, using omniauth-facebook
gem 'omniauth'
gem 'omniauth-facebook'
gem 'clearance'

on the guest SmartOS VM

pkg_add http://pkgsrc.joyent.com/sdc6/2012Q1/i386/All/smtools
# note this is going to shut down the VM
sm-prepare-image

on the global zone

@hcoyote
hcoyote / ops::install_file.pp
Created September 19, 2012 15:59
general puppet define to install a templated file somewhere.
# this define allows us to inject a file into the catalog so it
# transfers over to the client in one big blog, instead of the client having to
# hit up the puppet file server for each file (meaning, 1 additional HTTP request
# per file)
define ops::install_file(
$ensure = present,
$filetype = "bin",
$module = $module_name,
$filename = $name,
@hcoyote
hcoyote / ops::mysql_scripts
Created September 19, 2012 16:02
example usage of ops::install_file
# this calls ops::install_file to install each file in our directory defined in
# ops::install_file ... in our case, /usr/local/ops/bin by default.
class ops::mysql_scripts {
ops::install_file{[
"mye",
"mysql-init",
"mysql-vars",
]:}
@benweint
benweint / gdb-stuck-ruby.txt
Created April 16, 2013 14:55
An example of how to gather C and Ruby backtraces from a stuck Ruby process using gdb.
# Here's the script I'll use to demonstrate - it just loops forever:
$ cat test.rb
#!/usr/bin/env ruby
loop do
sleep 1
end
# Now, I'll start the script in the background, and redirect stdout and stderr
@jim80net
jim80net / vmigrate.sh
Last active November 20, 2023 14:19
Use this script to migrate a SmartOS guest to a target. ./vmigrate.sh UUID TARGETIP - or - ./vmigrate.sh UUID TARGETIP migration-snapshotdate # specify the initial snapshot timestamp to increment the snapshot on the target
#!/bin/bash
# Use this to send and receive files
# Dependencies:
# SSH-Keys setup for root users. I recommend using agent forwarding for this.
# mbuffer installed in /opt/local/bin/mbuffer. Adjust to reality.
#
# This script presumes:
# zsnapper is installed. Comment out the two lines where it is referenced if you don't use it
DATE=$(date +%Y%m%d%H%M)
@jim80net
jim80net / cipher_check.sh
Created June 25, 2014 21:54
Test SSL handshake against known handshake methods
#!/usr/bin/env bash
# http://superuser.com/questions/109213/is-there-a-tool-that-can-test-what-ssl-tls-cipher-suites-a-particular-website-of
# OpenSSL requires the port number.
SERVER=$1
DELAY=0
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
@fogleman
fogleman / words.md
Last active June 27, 2024 07:55
Mnemonic Encoding Word List

Mnemonic Encoding Word List

http://web.archive.org/web/20090918202746/http://tothink.com/mnemonic/wordlist.html

  • The wordlist contains 1626 words.
  • All words are between 4 and 7 letters long.
  • No word in the list is a prefix of another word (e.g. visit, visitor).
  • Five letter prefixes of words are sufficient to be unique.
  • The words should be usable by people all over the world. The list is far from perfect in that respect. It is heavily biased towards western culture and English in particular. The international vocabulary is simply not big enough. One can argue that even words like "hotel" or "radio" are not truly international. You will find many English words in the list but I have tried to limit them to words that are part of a beginner's vocabulary or words that have close relatives in other european languages. In some cases a word has a different meaning in another language or is pronounced very differently but for the purpose of the encoding it is still ok - I assume that when the encoding is