Skip to content

Instantly share code, notes, and snippets.

@tehpeh
tehpeh / centos-deploy.txt
Created May 8, 2012 06:43
CentOS Deploy
Setup:
------
See ror-deploy.txt for general instructions.
Create user:
------------
groupadd staff
useradd [user] -g staff
@tehpeh
tehpeh / ubuntu-deploy.txt
Created May 8, 2012 06:42
Ubuntu Deploy
Setup:
------
See ror-deploy.txt for general instructions.
Packages:
---------
sudo aptitude update
sudo aptitude safe-upgrade
@tehpeh
tehpeh / ror-deploy.txt
Created May 8, 2012 06:41
RoR Deploy
General steps for a RoR deployment on linux.
For Ubuntu, see ubuntu-deploy.txt
For CentOS, see centos-deploy.txt
Information:
------------
- users
cat /etc/passwd
@tehpeh
tehpeh / gist:990443
Created May 25, 2011 06:15
Sort colours
#!/usr/bin/env ruby
def sort_colours(str)
ranking = {
"blue" => 1,
"orange" => 2,
"green" => 3,
"yellow" => 4,
"pink" => 5,
"red" => 6,
@tehpeh
tehpeh / eddie.rb
Created May 20, 2011 07:47
Collect array to hash
#!/usr/bin/env ruby
input = [["GREY", "1"], ["GREY", "2"], ["GREY", "3"], ["LIME", "1"], ["LIME", "2"], ["LIME", "3"], ["PINK", "1"], ["PINK", "2"], ["PINK", "3"], ["RED", "1"], ["RED", "2"], ["RED", "3"]]
out = {}
input.each do |a|
out[a.first] ||= []
out[a.first] << a.last
end