Skip to content

Instantly share code, notes, and snippets.

View joshmyers's full-sized avatar

Josh Myers joshmyers

View GitHub Profile
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
root@measuring1:/opt/graphite/storage/whisper# whisper-info.py stats/dev/apps/deployments/test.wsp
maxRetention: 31536000
xFilesFactor: 0.0
aggregationMethod: sum
fileSize: 378432028
Archive 0
retention: 31536000
secondsPerPoint: 1
points: 31536000
maxRetention: 157784400
xFilesFactor: 0.5
aggregationMethod: average
fileSize: 3302620
Archive 0
retention: 21600
secondsPerPoint: 10
points: 2160
size: 25920
~ $ cassandra-cli
Connected to: "Test Cluster" on 127.0.0.1/9160
Welcome to Cassandra CLI version 1.2.6
Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.
[default@unknown] use cassandra_test;
Authenticated to keyspace: cassandra_test
[default@mydrive_test] update column family TripProfiles
[
{
"name": "dev",
"columnFamilies": [
{
"name": "AggregateProfiles"
},
{
"name": "LinkHistory"
},