Skip to content

Instantly share code, notes, and snippets.

@havenwood
havenwood / rmd128.rb
Last active December 15, 2015 21:08
The hash function RIPEMD-128 in Ruby
require 'digest'
require 'stringio'
module Digest
class RMD128 < Digest::Class
##
# http://homes.esat.kuleuven.be/~bosselae/ripemd/rmd128.txt
#
# RIPEMD-128 is an iterative hash function that operates on 32-bit words.
# The round function takes as input a 4-word chaining variable and a 16-word
@tonyla
tonyla / gist:1327838
Created October 31, 2011 16:05
1.9.2-p290-loadpatch
# Save this somewhere, then run `ruby-build path/to/1.9.2-p290-loadpatch`
build_package_apply_loadpatch() {
{ curl "https://raw.github.com/gist/1008945/4edd1e1dcc1f0db52d4816843a9d1e6b60661122/ruby-1.9.2p290.patch" | patch
} >&4 2>&1
}
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
install_package "ruby-1.9.2-p290" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz" apply_loadpatch standard
install_package "rubygems-1.8.10" "http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz" ruby
@rpavlik
rpavlik / fix_homebrew.rb
Created January 6, 2011 20:32 — forked from mxcl/install_homebrew.markdown
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@scottjbarr
scottjbarr / install_nginx_on_debian.sh
Created January 12, 2010 03:51
Install nginx on Debian
#!/bin/bash
#
# Install nginx on Debian.
#
# Author : Scott Barr
# Date : 7 Jan 2010
#
VERSION=0.7.64