Skip to content

Instantly share code, notes, and snippets.

View joshmyers's full-sized avatar

Josh Myers joshmyers

View GitHub Profile
postgres_packages = %w{ postgresql-9.1 postgresql-client-9.1 postgresql-contrib-9.1 postgresql-server-dev-9.1 }
postgres_deps = %w{ libatk1.0-0 libgdk-pixbuf2.0-0 libgtk2.0-0 libpango1.0-0 }
postgres_packages + postgres_deps.each do |dpkg|
package dpkg
end
postgres_packages.each do |postgres_package|
apt_preference "#{postgres_package}" do
pin "9.1.11-0ubuntu0.12.04"
foo@s9-app1:/opt/foo/bar/releases/20140623084741$ bundle exec rake assets:precompile
syck has been removed, psych is used instead
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in RolePlay instead. (called from require at /opt/ruby/2.0/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76)
/opt/ruby/2.0/bin/ruby /opt/foo/bar/shared/bundle/ruby/2.0.0/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
syck has been removed, psych is used instead
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in RolePlay instead. (called from require at /opt/ruby/2.0/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76)
fatal: Not a git repository (or any of the parent directories): .git
[deprecated] I18n.enforce_available_locales will default to true in the futur
upstream tumblr {
server 72.32.231.8:80;
}
server {
listen 80;
server_name jyorr.com;
access_log /var/log/nginx/jyorr.access.log;
100% [1 chef-server-core 455 MB/455 MB 100%] 182 kB/s 0s
Err https://packagecloud.io/chef/stable/ubuntu/ precise/main chef-server-core amd64 12.0.1-1
Failed to fetch https://packagecloud.io/chef/stable/ubuntu/pool/precise/main/c/chef-server-core/chef-server-core_12.0.1-1_amd64.deb
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
opscode_user_secret = Chef::EncryptedDataBagItem.load_secret("#{node[:opscode_user][:secretpath]}")
opscode_user_creds = Chef::EncryptedDataBagItem.load("chef_backup", "opscode_user", opscode_user_secret)
opscode_user_creds["ssh_key"]
opscode_user = encrypted_data_bag_item("chef_backup", "opscode_user")
template "/root/.chef/chef_backup_user.pem" do
variables(:ssh_key => opscode_user_creds['ssh_key'])
source chef_backup_user_pem.erb
owner "root"
class Homer < RTanque::Bot::Brain
NAME = 'MyDriveDestroyer'
include RTanque::Bot::BrainHelper
def tick!
move
in_circles
fire
if someones_close
[stats]
priority = 100
pattern = ^stats\..*
retentions = 10:2160,60:10080,600:262974
[deployments]
priority = 100
pattern = ^stats\.*\.apps.deployments
retentions = 10:262974
[collectd]
priority = 100
def get_s3_files_for_csv(bucket, type)
@csv_data.map do |element|
(bucket.objects.with_prefix("#@base_path/#{element[type]}") || []).select do |o|
looks_like_a_trip?(o.key) &&
between_dates?(o.key, @opts[:start_date], @opts[:end_date]) &&
in_rolling_window?(o.key, element[:loss_date])
end
end.flatten
end
def get_s3_files_for_csv(bucket, type)
@csv_data.map do |element|
(bucket.objects.with_prefix("#@base_path/#{element[type]}") || []).select do |o|
looks_like_a_trip?(o.key) &&
between_dates?(o.key, @opts[:start_date], @opts[:end_date]) &&
in_rolling_window?(o.key, element[:loss_date])
end
end.flatten
end
CSV.foreach(csv, headers: :first_row, header_converters: :downcase) do |row|
@csv_data << {imei: row['imei'], subscription_id: row['subscription_id'], loss_date: Time.parse(row['loss_date'])}
end