Skip to content

Instantly share code, notes, and snippets.

View dysinger's full-sized avatar
🏠
Working from home

Dysinger dysinger

🏠
Working from home
  • Independent
  • Oregon | Hawaii | Alaska
View GitHub Profile
@dysinger
dysinger / mommy-bucks-calc.rb
Created September 4, 2008 04:59
A simple shoes app to get my son started
#!/usr/bin/env ruby
# -*- ruby -*-
Shoes.app(:title => "Mommy Bucks Calculator",
:width => 300, :height => 400, :resizable => false) do
background "rgb(240, 245, 220)"
stack do
stack(:margin => 10) do
@dysinger
dysinger / unfuddle.rake
Created March 14, 2009 00:22
Unfuddle Screen Scrape of CSV Tickets -> iCal
%W(mechanize icalendar fastercsv date).each {|l| require l}
namespace(:unfuddle) do
desc("unfuddled ical")
task(:ical, [:user, :pass]) do |t,a|
agent = WWW::Mechanize.new
agent.get("https://sonian.unfuddle.com") do |login|
home = login.form_with(:action => '/session') do |form|
form.authenticity_token ="19bc194e909975bf8cf502810b51e872bf7df728"
form.username = a[:user]
@dysinger
dysinger / convert.rb
Created March 24, 2009 15:13
Convert Chef Cookbooks to Headless Branches
#!/usr/bin/env ruby
# -*- ruby -*-
`git checkout opscode/master`
Dir.glob("*").select {|x| FileTest.directory?(x) }.each do |path|
`git br -D #{path}`
`git checkout -b #{path} opscode/master`
`git filter-branch --tree-filter \
'rm -rf #{Dir.glob("*").reject {|x| x == path }.join(" ")}' --prune-empty HEAD`
`rm -rf .git/refs/original`
@dysinger
dysinger / update-projects.scm
Created March 24, 2009 15:23
Gambit-C Scheme Script to Recursively Update Git Remotes
#!/usr/bin/env gsi-script
;; -*- scheme -*-
(define (update cwd)
(for-each
(lambda (entry)
(let ((full-entry-path (path-expand entry cwd)))
(if (equal? 'directory (file-type full-entry-path))
(if (equal? ".git" entry)
(begin
@dysinger
dysinger / gentoo-ec2.sh
Created March 31, 2009 22:36
Bare Minimum to boot Stage3 gentoo @ ec2
#!/bin/sh
# -*- sh -*-
# NOTE: This is the bare min needed to make an ec2 image from a stage3 gentoo image.
# !st Build a stage3 from somewhere. I use metro. ...then... ->
#
# Configure
#
@dysinger
dysinger / 2.6.18-ec2-modules.sh
Created April 8, 2009 20:33
Compile custom modules for ec2 2.6.18
# build machine
# ami-205fba49 w/ aki-9b00e5f2
# update yum / install dev tools
yum clean all
perl -p -i -e 's/.?baseurl\=http\:\/\/download.fedora.redhat.com\/pub\/fedora\/linux/baseurl\=http\:\/\/archives.fedoraproject.org\/pub\/archive\/fedora\/linux/g' \
/etc/yum.repos.d/*
perl -p -i -e 's/.?mirrorlist(.*)/\#mirrorlist$1/g' /etc/yum.repos.d/*
perl -p -i -e 's/gpgkey\=file\:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-fedora/gpgkey\=file\:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY/g' \
/etc/yum.repos.d/fedora.repo
@dysinger
dysinger / Makefile
Created April 16, 2009 03:21
Simple Makefile for Lisp Flavored Erlang
LFE_SRC := $(wildcard src/*.lfe)
LFE_BEAM := $(LFE_SRC:src/%.lfe=ebin/%.beam)
INCL_DIRS := $(wildcard deps/*/include) include
EBIN_DIRS := $(wildcard deps/*/ebin) ebin
FLAGS := -noshell -noinput $(INCL_DIRS:%=-I %) $(EBIN_DIRS:%=-pa %)
OPTIONS := {outdir,"ebin"}
compile: $(LFE_BEAM)
@dysinger
dysinger / hp-mini-ubuntu-9.04.sh
Created June 18, 2009 16:18
Ubuntu LPIA 9.04 on HP Mini 1120NR
#!/bin/bash
sudo su -
#
# Audio: fix ubuntu 9.04 broken sound
#
apt-get install build-essential xmlto libncurses5-dev
export ALSA="1.0.20"
# Clean out OS X Snow Leopard's crappy default gems (I prefer ~/.gem installs)
sudo gem uninstall \
--install-dir /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 \
--bindir /usr/bin -I \
actionmailer actionpack actionwebservice activerecord activeresource activesupport \
acts_as_ferret capistrano cgi_multipart_eof_fix daemons dnssd fastthread fcgi ferret \
gem_plugin highline hpricot libxml-ruby mongrel needle net-scp net-sftp net-ssh \
net-ssh-gateway rails rake RedCloth ruby-openid ruby-yadis rubynode sqlite3-ruby \
termios xmpp4r
#!/bin/sh
cd /tmp
curl http://www.iro.umontreal.ca/~gambit/download/gambit/v4.5/source/gambc-v4_5_2.tgz | tar xz
cd gambc-v4_5_2
export CC='/usr/bin/gcc-4.0'
./configure --prefix=$HOME/Homebrew/Cellar/gambit/4.5.2
make && make install
cd ..