This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Packaging ruby with fpm is a bit meta | |
# You need ruby install to use fpm | |
# I used an RVM install on a VM install fpm in a packaging gemset | |
# Install EPEL if you don't have it already | |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
# Install deps for ruby build | |
yum install rpm-build readline-devel.x86_64 libffi-devel.x86_64 libyaml-devel.x86_64 zlib-devel.x86_64 openssl-devel.x86_64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash -c ' | |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
yum install -q -y sudo gcc gcc-c++ automake autoconf make readline-devel.x86_64 libffi-devel.x86_64 libyaml-devel.x86_64 zlib-devel.x86_64 openssl-devel.x86_64 wget | |
# This may not be necessary for you | |
yum remove -q -y ruby-libs ec2-ami-tools | |
wget http://someurl.domain.com/ruby-1.9.2p180_x86_64.rpm -O /tmp/ruby-1.9.2p180_x86_64.rpm | |
yum localinstall --nogpgcheck -q -y /tmp/ruby-1.9.2p180_x86_64.rpm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cinch' | |
module MyBot | |
module Plugins | |
class Foo | |
include ::Cinch::Plugin | |
match "foo" | |
def execute(m) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyBot | |
module Plugins | |
class Hello | |
include ::Cinch::Plugin | |
match "hello" | |
def execute(m) | |
m.reply "Hello, #{m.user.nick}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@user = User.invite_without_notification! | |
@group = Group.find_by_name('foo') | |
@group.memebers << @user | |
GroupMailer.welcome_invitation(@group, @user).deliver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Group < ActiveRecord::Base | |
has_many :group_memberships, :dependent => :destroy | |
has_many :members, :through => :group_memberships, :source => :user | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_boom_complete() { | |
local cur prev lists | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
lists=`boom | awk '{print $1}'` | |
case "${prev}" in | |
boom) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$boom test | |
Boom! Created a new list called "test". | |
$boom test foo bar | |
Boom! "foo" in "test" is "bar". Got it. | |
$boom test foo blah | |
Boom! "foo" in "test" is "blah". Got it. | |
$boom test foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facility = { 0 => 'kern', | |
1 => 'user', | |
2 => 'mail', | |
3 => 'daemon', | |
4 => 'auth', | |
5 => 'syslog', | |
6 => 'lpr', | |
7 => 'news', | |
8 => 'uucp', | |
9 => 'cron', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
debian01:/usr/lib/ruby/1.8/chef# gem sources | |
*** CURRENT SOURCES *** | |
http://gems.rubyforge.org/ | |
debian01:/usr/lib/ruby/1.8/chef# gem install httpclient | |
ERROR: could not find gem httpclient locally or in a repository | |
debian01:/usr/lib/ruby/1.8/chef# gem install httpclient | |
debian01:/usr/lib/ruby/1.8/chef# gem search -r httpclient | |
*** REMOTE GEMS *** |