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 'fog' | |
connection = Fog::Compute.new( | |
provider: 'AWS', | |
aws_access_key_id: 'AKIAIEXAMPLEEXAMPLE6', | |
aws_secret_access_key: 'example+example+example+example+example7', | |
region: 'us-east-1' | |
) | |
connection.servers.all.each do |server| | |
puts server.id |
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
source "https://rubygems.org" | |
gem 'chef', '>= 11.0' | |
gem 'librarian' | |
gem 'vagrant', '= 1.0.6' | |
gem 'vagrant-hostmaster' | |
gem 'foodcritic' |
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
## using https://github.com/apsoto/monit/ cookbook | |
## this works | |
bind_cookbook_name = cookbook_name | |
monitrc 'redis' do | |
action :enable | |
reload :delayed | |
variables({ :pidfile => "/var/run/redis/6379/redis_6379.pid" }) | |
template_cookbook bind_cookbook_name | |
template_source 'redis_monit.conf.erb' |
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
AJS.toInit(function () { | |
AJS.$("[name=run_dynamic_publisher_id]").select2({width: "400px"}); | |
$("[class^=atlassian-select2]").each(function (ei, ee) { | |
ee.className = ee.className.replace("atlassian-select2", "select2"); | |
}); | |
}) |
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
Open3.popen3 cmd do |sin, sout, serr, wait_thr| | |
loop do | |
rs, _, _ = IO.select([sout,serr]) # no multi-assign in conditions | |
break if (sout.eof? and serr.eof?) or (sout.closed? and serr.closed?) | |
next if rs.empty? | |
rs.each do |readable_io| | |
log readable_io.gets # read a line from it | |
end | |
end | |
exit_status = wait_thr.value |
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
DROP PROCEDURE IF EXISTS rotateAudit; | |
delimiter ;; | |
CREATE PROCEDURE rotateAudit( | |
pv_database VARCHAR(64), | |
pv_table VARCHAR(64) | |
) | |
BEGIN | |
SET @createDbStatement := CONCAT('CREATE DATABASE IF NOT EXISTS archive_',pv_database); | |
SET @createStatement := CONCAT('CREATE TABLE ',pv_database,'.new_',pv_table,' LIKE ',pv_database,'.',pv_table); | |
SET @insertStatement := CONCAT('INSERT INTO ',pv_database,'.new_',pv_table,' SELECT * FROM ',pv_database,'.',pv_table,' ORDER BY id DESC LIMIT 50000'); |
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
target=diffSeries( | |
app.important.stuff, | |
averageSeries( | |
timeShift(app.important.stuff, "-7d"), | |
timeShift(app.important.stuff, "-14d"), | |
timeShift(app.important.stuff, "-21d") | |
) | |
) |
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
# /etc/puppet/config/client.yaml | |
--- | |
client: example.com | |
environment: vagrant |
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
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
} | |
sub vcl_recv { | |
if (req.request == "POST") { | |
return (pipe); | |
} | |
if (req.url ~ "^/(s/|favicon.ico|download/resources/|download/batch/|images/icons/)") { |
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
# unicorn | |
description "unicorn ruby app server" | |
start on (local-filesystems and net-device-up IFACE=lo and runlevel [2345]) | |
stop on runlevel [!2345] | |
env WORKDIR=/data | |
env PIDFILE=/data/tmp/pids/unicorn.pid | |
env CFGFILE=/data/config/unicorn.rb |