Skip to content

Instantly share code, notes, and snippets.

View wyaeld's full-sized avatar
🐣
work in progress

Brad Murray wyaeld

🐣
work in progress
View GitHub Profile
@jhannah
jhannah / gist:855947
Created March 5, 2011 00:07
mylvmbackup
sudo apt-get install lvm2
sudo apt-get install mylvmbackup
jhannah@li202-203:~/src$ sudo mylvmbackup --socket=/home/cm_satin/mysql-repl/mysql.sock
20110304 23:19:14 Info: Connecting to database...
20110304 23:19:14 Info: Running hook 'preflush' as perl module.
20110304 23:19:14 Info: Flushing tables with read lock...
20110304 23:19:14 Info: Taking position record into /tmp/mylvmbackup-backup-20110304_231914_mysql-hfUKiZ.pos...
20110304 23:19:14 Info: Running: lvcreate -s --size=5G --name=data_snapshot /dev/mysql/data
File descriptor 4 (socket:[113294]) leaked on lvcreate invocation. Parent PID 1669: /usr/bin/perl
anonymous
anonymous / jspec_with.coffee
Created April 13, 2011 16:41
jspec with coffeescript
JSpec.describe 'ShoppingCart', ->
before_each ->
cart = new ShoppingCart
describe 'addProducts', ->
it 'should add several products', ->
cart.addProducts('cookie')
cart.addProducts('icecream')
expect(cart).to(have, 2, 'products')
# vmc update is great for test and development, however it stops your old app and stages and starts the new one,
# resulting in dropped requests.
# If you want to update an application without dropping user requests, see below.
# NOTE: This change assumes your application can share services, etc with the new version.
# Assume my app is named foo
vmc push foo-v2 --url foov2.cloudfoundry.com
@dalecaru
dalecaru / innobackupex-restore.sh
Created April 20, 2011 13:42
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
@bergie
bergie / README.md
Created May 18, 2011 11:33
Falsy Values tutorials
# In general, there are many places in the file where you can leave off the parens in function calls, if you like.
unless typeof exports is "undefined" # `unless ... else` reads poorly in English. Better to stick to `if ... else`.
Spine = exports
else
Spine = @Spine = {}
Spine.version = "0.0.4"
$ = Spine.$ = @jQuery || @Zepto || -> arguments[0] # In Coffee, `or` is preferred over `||`.
@PlasticLizard
PlasticLizard / msgpack.rb
Created July 5, 2011 20:28
Formatter woes
require 'msgpack'
module Goliath
module Rack
module Formatters
# A MessagePack formatter.
# @example
# use Goliath::Rack::Formatters::MSGPACK
class MSGPACK
include AsyncMiddleware
@tmcgilchrist
tmcgilchrist / gist:1103621
Created July 25, 2011 05:40
Rails 3 Setup for Oracle 10g XE

Notes on Setting up Oracle 10g XE with Rails

Capturing my notes about setting up an Oracle 10g XE / Rails environment for development work. Tested using the following versions, others may work as well:

  1. Ubuntu 11.04
  2. Ruby 1.9.2
  3. Rails 3
  4. Oracle 10 XE
@tomdale
tomdale / gist:1134558
Created August 9, 2011 16:53
Load remote Handlebars templates
jQuery.get('/templates/foo.handlebars', function(data) {
var template = SC.Handlebars.compile(data);
SC.TEMPLATES['foo'] = template;
})
@RandomEtc
RandomEtc / 1-make-key
Created September 16, 2011 16:35
generating SSL keys and Certificate Signing Requests for Heroku / Nginx / RapidSSL
Key was generated using:
tom% openssl genrsa -des3 -out example.com.key 2048
Generating RSA private key, 2048 bit long modulus
....+++
..........................................................................................................................+++
e is 65537 (0x10001)
Enter pass phrase for example.com.key:
Verifying - Enter pass phrase for example.com.key:
%tom