Skip to content

Instantly share code, notes, and snippets.

View jarsen's full-sized avatar

Jason Larsen jarsen

  • Salt Lake City, Utah
View GitHub Profile
@jarsen
jarsen / installing everything.txt
Created July 18, 2009 04:59
the commands i use to install set up everything on my ubuntu 9.04 server edition
THE SUPER SCRIPTS
sudo aptitude update; sudo aptitude safe-upgrade; sudo reboot
sudo aptitude -y install build-essential; sudo aptitude -y install php5-cgi php5-mysql php5-xcache php5-common php5-dev php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-mcrypt php5-curl php5-gd php5-memcache php5-mhash php5-pspell php5-snmp php5-sqlite libmagick9-dev php5-cli php5-xcache subversion git-core libreadline5-dev; sudo aptitude -y install php-pear; sudo aptitude -y install imagemagick; sudo pecl install imagick; sudo aptitude -y install mysql-server mysql-client libmysqlclient15-dev; mysql_secure_installation; sudo aptitude -y install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev; mkdir ~/src/; cd ~/src/; wget http://rubyforge.org/frs/download.php/58677/ruby-enterprise-1.8.6-20090610.tar.gz; sudo tar xvzf ruby*; cd /ruby*; sudo ./installer
wget http://rubyforge.org/frs/download.php/59007/passenger-2.2.4.tar.gz; sudo tar xzvf passenger-2.2.4.tar.gz -C /opt/;
wget http://sysoev.ru/nginx/nginx-0.8.5.tar.gz; t
@jarsen
jarsen / contacts.rb
Created May 25, 2009 23:53
just something I cooked up real quick to show Art ruby's expressive power after he had done this same project in C++
#!/usr/bin/env ruby -wKU
class Contact
attr_accessor :name, :address, :city, :state, :zip_code, :phone
def initialize( name, address, city, state, zip_code, phone )
@name, @address, @city, @state, @zip_code @phone = name, address, city, state, zip_code, phone
end
def to_s
@jarsen
jarsen / nfa_converter.rb
Created May 18, 2009 07:06
For a cs theory class. Will take a NFA-lambda machine and print out it's corresponding DFA
#!/usr/bin/env ruby -wKU
#nfa_converter.rb
# converts a given NFA-lambda to it's corresponding DFA and prints
# corresponding transition rules.
$: << File.expand_path(File.dirname(__FILE__))
require 'NFA'
ARGV.each do |fileName| # each argument passed through bash is a file to convert