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
| ActiveSupport::Notifications.subscribe(/process_action.action_controller/) do |*args| | |
| event = ActiveSupport::Notifications::Event.new(*args) | |
| controller = event.payload[:controller] | |
| action = event.payload[:action] | |
| format = event.payload[:format] || "all" | |
| format = "all" if format == "*/*" | |
| status = event.payload[:status] | |
| key = "#{controller}.#{action}.#{format}" | |
| # Send the status of the controller without the controller name |
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
| # Specify the provider and access details | |
| provider "aws" { | |
| region = "${var.aws_region}" | |
| } | |
| # Create a VPC to launch our instances into | |
| resource "aws_vpc" "default" { | |
| cidr_block = "10.0.0.0/16" | |
| } |
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
| encoded_json_hack = encoded_json + ('=' * (4 - encoded_json.length.modulo(4))) | |
| json_str = Base64.urlsafe_decode64(encoded_json_hack) | |
| hmac = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, APP_SECRET, encoded_json) | |
| # bug in ruby. why are there '=' chars on urlsafe_encode ?! | |
| my_signature = Base64.urlsafe_encode64(hmac).gsub('=','') | |
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
| ec2-describe-instances | grep running | awk '{print $9}' |
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
| diff -ur orig/ext/readline/readline.c fixed/ext/readline/readline.c | |
| --- orig/ext/readline/readline.c 2014-03-18 13:53:31.866359527 +0100 | |
| +++ fixed/ext/readline/readline.c 2014-03-18 13:56:26.390247250 +0100 | |
| @@ -1883,7 +1883,7 @@ | |
| rl_attempted_completion_function = readline_attempted_completion_function; | |
| #if defined(HAVE_RL_PRE_INPUT_HOOK) | |
| - rl_pre_input_hook = (Function *)readline_pre_input_hook; | |
| + rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook; | |
| #endif |
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
| $ModLoad imfile # Load the imfile input module | |
| # <syslog-tag> Tag you give to syslog in order to identigy the input coming from this file eg: nginx-access/rails/some_other_name | |
| # <statefile-name> What do you want the state file to be called eg: nginx-access-state | |
| # use @@ if you want to send logs over TCP | |
| # use @ if you want to send logs over UDP | |
| $InputFileName /path/to_log_location.log | |
| $InputFileTag <syslog-tag>: | |
| $InputFileStateFile <statefile-name> |
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 | |
| DEFAULT_PIPE_NAME=".plumber" | |
| PIPE_NAME="${1:-$DEFAULT_PIPE_NAME}" | |
| if [ ! -p $PIPE_NAME ]; then | |
| echo "Created pipe ${PIPE_NAME}..." | |
| mkfifo $PIPE_NAME | |
| fi |
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
| # use UTF8 | |
| set -g utf8 | |
| set-window-option -g utf8 on | |
| # make tmux display things in 256 colors | |
| set -g default-terminal "screen-256color" | |
| set -g default-terminal "screen-256color" | |
| # set scrollback history to 10000 (10k) | |
| set -g history-limit 10000 |
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 | |
| region=us-west-2 | |
| ami=ami-927613a2 | |
| # http://cloud-images.ubuntu.com/locator/ec2/ | |
| echo "Input server name: " | |
| read server_name | |
| USERDATA=$(cat <<-EOF |
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' | |
| class S3FolderUpload | |
| attr_reader :folder_path, :total_files, :s3_bucket | |
| attr_accessor :files | |
| # Initialize the upload class | |
| # | |
| # folder_path - path to the folder that you want to upload | |
| # bucket - The bucket you want to upload to |