Skip to content

Instantly share code, notes, and snippets.

View rcreasey's full-sized avatar
🎯
Focusing

Ryan C. Creasey rcreasey

🎯
Focusing
View GitHub Profile
@rcreasey
rcreasey / bluepill.rb
Created November 18, 2010 22:51
bluepill service
bluepill_service "gstmatch" do
variables {:binary_name => "#{app_name}node",
:environment => app_environment,
:path => app["interfaces"][ app_environment ][ app_name ]["deploy_to"],
:options => app_options.join(' ')
}
action [:enable, :load, :start]
end
@rcreasey
rcreasey / remote_database.sql
Created February 12, 2011 17:37
Trying to figure out what's happening when doing a db pull from one mysql db to another.
mysql> explain wp_users;
+---------------------+---------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+---------------------+------+-----+---------------------+----------------+
| ID | bigint(20) unsigned | NO | PRI | NULL | auto_increment |
| user_login | varchar(60) | NO | MUL | | |
| user_pass | varchar(64) | NO | | | |
| user_nicename | varchar(50) | NO | MUL | | |
| user_email | varchar(100) | NO | | | |
| user_url | varchar(100) | NO | | | |
package "curl"
include_recipe "build-essential"
include_recipe "git"
git node[:rvm][:clone_dir] do
repository node[:rvm][:repository]
revision node[:rvm][:version]
action :sync
not_if { File.exists?( "#{node[:rvm][:clone_dir]}/install" ) }
DEBUG: ---- End output of /sbin/service chef-client status ----
DEBUG: Ran /sbin/service chef-client status returned 0
DEBUG: sh(/sbin/chkconfig --list chef-client)
DEBUG: service[chef-client]: not enabling, already enabled
DEBUG: Processing service[chef-client] on skynet-prodapp-01.ec2
ERROR: service[chef-client] (/srv/chef/cache/cookbooks/chef/recipes/client.rb:68:in `from_file') had an error:
undefined method `exists?' for Chef::Resource::File:Class
/srv/chef/cache/cookbooks/chef/recipes/client.rb:70:in `block (2 levels) in from_file'
/usr/local/rvm/gems/ruby/1.9.2/gems/chef-0.9.14/lib/chef/mixin/command.rb:85:in `call'
/usr/local/rvm/gems/ruby/1.9.2/gems/chef-0.9.14/lib/chef/mixin/command.rb:85:in `block in not_if'
[root@ip-10-194-111-163 ~]# chef-client
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- openssl (LoadError)
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/https.rb:92:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/chef-0.9.14/lib/chef/rest.rb:23:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/chef-0.9.14/lib/chef/couchdb
[root@ip-10-196-54-244 rvm]# git checkout 1.5.2
Note: checking out '1.5.2'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
[root@ip-10-244-249-187 current]# rake RACK_ENV=staging RAILS_ENV=staging QUEUE=notification environment resque:work VVERBOSE=true VERBOSE=true
(in /www/oncall.ign-inc.com/releases/41fc21fa01516b101c86dc8df7783159036f495e)
*** Starting worker ip-10-244-249-187:5970:notification
*** Registered signals
*** Checking notification
*** Sleeping for 5.0 seconds
*** resque-1.15.0: Waiting for notification
*** Checking notification
*** Sleeping for 5.0 seconds
*** resque-1.15.0: Waiting for notification
source_package "protobuf" do
version node[:protobuf][:version]
location node[:protobuf][:mirror]
filename node[:protobuf][:filename]
prefix node[:protobuf][:path]
end
#
# Cookbook Name:: cloud
# Recipe:: hostname
#
template "/etc/hosts" do
source "hostname/hosts.erb"
owner "root"
group "root"
mode 0644
require 'irb/completion'
require 'irb/ext/save-history'
require 'map_by_method'
require 'what_methods'
require 'pp'
require 'hirb'
require 'wirble'
require 'ap'
Wirble.init