Skip to content

Instantly share code, notes, and snippets.

View richardkmichael's full-sized avatar

Richard Michael richardkmichael

  • 22:14 (UTC -07:00)
View GitHub Profile
@richardkmichael
richardkmichael / gist:5323594
Last active December 15, 2015 21:09
OpenSSL version required by Ruby 1.9.3-p392 (fd5c678ff)
>= 0.9.6 (typo?)
https://github.com/ruby/ruby/blob/fd5c678ff76ccb815ee52a4035d5549d3d2da74e/ext/openssl/extconf.rb#L61
>= 0.9.7
https://github.com/ruby/ruby/blob/fd5c678ff76ccb815ee52a4035d5549d3d2da74e/ext/openssl/ossl.h#L37
[Closed bug - wont fix](http://bugs.ruby-lang.org/issues/5655)
Ruby 1.9.3p0 on MacOS Lion, recommended solution: install OpenSSL using MacPorts or Homebrew. But surely Lion has a OpenSSL >= 0.9.7?
require 'bundler/setup'
require 'celluloid/autostart'
require 'celluloid/probe'
Celluloid.logger = ::Logger.new './celluloid.log'
class UselessActor
include Celluloid
end
@richardkmichael
richardkmichael / config.rb
Last active August 29, 2015 13:58
RBX compile with clang/clang++ fail.
module Rubinius
config = {}
config[:build_tool_gems] = [["rubinius-ast", "2.1.2"], ["rubinius-compiler", "2.1.0"], ["rubinius-melbourne", "2.1.0.0"], ["rubinius-processor", "2.1.1"], ["rubinius-toolset", "2.2.0"]]
config[:build_c_ext_gems] = [["ffi2-generators", "0.1.1"], ["rubysl-etc", "2.0.3"], ["rubysl-fileutils", "2.0.3"], ["rubysl-mkmf", "2.0.1"], ["rubysl-shellwords", "2.0.0"]]
config[:bootstrap_gems] = [["rubysl-date", "2.0.6"], ["rubysl-delegate", "2.0.1"], ["rubysl-digest", "2.0.3"], ["rubysl-etc", "2.0.3"], ["rubysl-fcntl", "2.0.4"], ["rubysl-fileutils", "2.0.3"], ["rubysl-monitor", "2.0.0"], ["rubysl-openssl", "2.1.0"], ["ruby
sl-optparse", "2.0.1"], ["rubysl-stringio", "2.0.0"], ["rubysl-strscan", "2.0.0"], ["rubysl-tempfile", "2.0.1"], ["rubysl-thread", "2.0.2"], ["rubysl-tmpdir", "2.0.1"], ["rubysl-uri", "2.0.0"], ["rubysl-yaml", "2.0.4"], ["rubysl-zlib", "2.0.1"]]
config[:runtime_gems] = [["json", "1.8.1"], ["rake", "10.2.2"], ["rdoc", "4.1.1"], ["ffi2-generators", "0.1.1"], ["rubiniu
#!/bin/bash
#
# pgpool-II replication manager
#
# Interfaces with pgpool's pcp command-line tools to provide access to common functions for managing
# load-balancing and failover.
#
# [email protected]
# 2011-08-28

Ember.Console

This is a set of helpers for finding the application's currently active models/routes/controllers/etc. This isn't a straightforward process because of how Ember (rightly) encapsulates application objects, but it's useful in debugging environments to be able to quickly access them. And with the beta release of Ember Data, the store is not easily accessible without helpers either.

Usage

All helpers can be called directly if you provide them an application instance:

/*
Creates a computed property that persists into local storage, all
instances share the same value for the same property.
App.AuthController = Ember.Controller.extend({
token: Em.computed.stored()
});
controller = App.__container__.lookup('controller:auth')
contorller.set('token', 'abc123foo456bar')
#!/bin/bash
# Post-update hook, it receives a list of updated refs on STDIN ($@); including tags.
# -e = exit if any command exits non-zero ; -u exit if undefined variable name ; -o pipefail
set -euo pipefail
GIT_DIR="$( readlink -nf ${PWD} )"
REPO_NAME="$( basename ${GIT_DIR} .git )"
DEPLOY_LOG_DIR="${GIT_DIR}/../deploy-logs"
@richardkmichael
richardkmichael / bash-completion-notes.md
Last active August 29, 2015 14:24
Install bash-completion:master for `shopt -s failglob` with TAB-completion.

bash-completion:master has fixes for TAB-completion breakage when using shopt -s failglob (helpful with shopt -s dotglob).

$ ls -l bash: no match: words[0]=${!ref}${COMP_WORDS[i]}

Unfortunately, Homebrew's bash-completion will always use version 1.3, pinned because of OSX pinning to bash 3.2.x. Also, the homebrew-version/bash-completion2 package is 2.1, which is very old.

So, let's quickly install bash-completion from source until we have time to fix homebrew.

@richardkmichael
richardkmichael / gist:c3f9251630f7da63fbe7
Created August 24, 2015 19:25
Broken DateTime based Range#include?
[38] pry(main)> RUBY_DESCRIPTION
=> "ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin12.0]"
[41] pry(main)> d = "2015-01-01"
=> "2015-01-01"
# Broken Range#include? with DateTime objects, they don't understand the time portion of the day.
[42] pry(main)> n = DateTime.parse "#{d} 9am"
=> #<DateTime: 2015-01-01T09:00:00+00:00 ((2457024j,32400s,0n),+0s,2299161j)>

KVM OSX Guest 10.11 (El Capitan) with Clover

  • Some notes about this approach:
    • An OSX Installer USB drive for Install OS X El Capitan is created
    • Clover is then installed on the USB drive
    • Clover Configurator is then run on the USB drive
    • The USB drive contents are copied to the VM host
    • VNC is used to connect to the guest UI
  • The qxl virtual video device is used (part of the standard kvm qemu install)