# create private key
openssl genrsa -des3 -out pk.encrypted.key 2048
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 'aws-sdk' | |
AWS.config({ | |
:access_key_id => ENV['AWS_ACCESS_KEY_ID'], | |
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'], | |
:region => 'sa-east-1' | |
}) | |
cw = AWS::CloudWatch.new |
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 'aws-sdk' | |
AWS.config({ | |
:access_key_id => ENV['AWS_ACCESS_KEY_ID'], | |
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'], | |
:region => 'sa-east-1' | |
}) | |
ec2 = AWS::EC2.new |
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
#!/bin/bash | |
# | |
# using ec2 tools | |
# | |
# Marcus Vinicius Fereira ferreira.mv[ at ].gmail.com | |
# 2011-11 | |
### | |
### programs |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'net/http' | |
# check_aws_status.rb | |
# A nagios plugin for fetching RSS feeds from http://status.aws.amazon.com. | |
# Source: https://gist.github.com/1604786 | |
# Written by Aaron Suggs: https://github.com/ktheory |
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
#!/usr/bin/env ruby | |
require "redis" | |
redis = Redis.new | |
redis.keys("*").each do |key| | |
val = case redis.type(key) | |
when "string" | |
redis.get key | |
when "list" |
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
A good commit message looks like this: | |
Header line: explaining the commit in one line | |
Body of commit message is a few lines of text, explaining things | |
in more detail, possibly giving some background about the issue | |
being fixed, etc etc. | |
The body of the commit message can be several paragraphs, and | |
please do proper word-wrap and keep columns shorter than about |
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
#!/bin/bash | |
(/usr/local/bin/db2log | \ | |
mk-query-digest --fingerprints \ | |
--filter '$event->{user} !~ m/^(bi|memonic)$/') 2>&1 | \ | |
mail -s "MySQL slow logs" root | |
# Rotate slow logs. Will move them into the backup table slow_log_backup. If | |
# that table exists it's overwritten with the primary slow log. | |
# So with this strategy we can still access yesterday's slow log by querying | |
# slow_log_backup. |
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
$ cat facter.log | |
** [out :: ec2-107-22-149-65.compute-1.amazonaws.com] Amazon Linux AMI release 2011.09 | |
** [out :: ec2-107-22-149-65.compute-1.amazonaws.com] operatingsystem => Amazon | |
** [out :: ec2-107-22-149-65.compute-1.amazonaws.com] operatingsystemrelease => 2.6.35.14-97.44.amzn1.x86_64 | |
** [out :: ec2-174-129-92-129.compute-1.amazonaws.com] Amazon Linux AMI release 1 (beta) | |
** [out :: ec2-174-129-92-129.compute-1.amazonaws.com] operatingsystem => Amazon | |
** [out :: ec2-174-129-92-129.compute-1.amazonaws.com] operatingsystemrelease => 2.6.34.6-54.24.amzn1.x86_64 | |
** [out :: ec2-184-72-202-223.compute-1.amazonaws.com] Amazon Linux AMI release 1 (beta) | |
** [out :: ec2-184-72-202-223.compute-1.amazonaws.com] operatingsystem => Amazon | |
** [out :: ec2-184-72-202-223.compute-1.amazonaws.com] operatingsystemrelease => 2.6.34.7-56.40.amzn1.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
load "server.rb" | |
default_run_options[:pty] = true | |
desc "Install Git, Ruby" | |
task :prereq do | |
run "sudo yum install -y git ruby ", :pty => true | |
end |