Skip to content

Instantly share code, notes, and snippets.

View scalp42's full-sized avatar
πŸ‘¨β€πŸŽ¨

Anthony Scalisi scalp42

πŸ‘¨β€πŸŽ¨
View GitHub Profile
@scalp42
scalp42 / signal_catching.rb
Created December 23, 2016 01:42 — forked from sauloperez/signal_catching.rb
How to catch SIGINT and SIGTERM signals in Ruby
# Signal catching
def shut_down
puts "\nShutting down gracefully..."
sleep 1
end
puts "I have PID #{Process.pid}"
# Trap ^C
Signal.trap("INT") {
@scalp42
scalp42 / gemfile_lock2geminabox.rb
Created November 4, 2016 23:43 — forked from flavio/gemfile_lock2geminabox.rb
Parse Gemfile.lock, download all gems from rubygems and then upload them to a local instance of geminabox
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
require 'fileutils'
require 'net/http'
require 'net/https'
require 'uri'
TMP_DIR = "/tmp/gems"
@scalp42
scalp42 / gist:a59be769192cfabac109b45364a52010
Created September 22, 2016 00:07 — forked from acwright/gist:1944639
Sinatra / ActionMailer / Sendgrid / Heroku
require 'sinatra'
require 'action_mailer'
class Mailer < ActionMailer::Base
def contact
mail(
:to => "[email protected]",
:from => "[email protected]",
:subject => "Test") do |format|
format.text
@scalp42
scalp42 / autoverifier.js
Created August 11, 2016 22:49 — forked from sebastienvercammen/Code.gs
Nintendo PTC Account Verifier for Gmail (via Google Scripts)
/*
Automatically click all "Verify your email" links in the welcome e-mail from
Nintendo PokΓ©mon Trainer Club's signup e-mails.
All verified e-mails will be moved to trash unless you set "moveToTrash" to false.
How to use:
1. Login to Gmail
2. Go to https://script.google.com/
3. Enter the code, save, run.
@scalp42
scalp42 / README.md
Created March 25, 2016 18:39 — forked from nathanielks/README.md
Simple wrapper around terraform to manage multiple environments

This script will pull down an S3 remote configuration before running any terraform actions. Assumes the following structure:

main.tf
terraform.cfg
env/dev/vars
env/staging/vars
env/whatever/vars
env/whatever/somefile.tf
@scalp42
scalp42 / gist:ef420778d28f8d82adb1
Created March 14, 2016 23:15 — forked from tyler-ball/gist:f7c16e814265f34260e9
Test Kitchen Shared Examples

Create the following folder structure in your cookbook:

test
└── integrationq
    β”œβ”€β”€ helpers
    β”‚Β Β  β”œβ”€β”€ serverspec
    β”‚Β Β  β”‚Β Β  β”œβ”€β”€ shared_serverspec_tests
    β”‚Β Β  β”‚Β Β  β”‚Β Β  └── shared_tests2.rb
    β”‚Β Β  β”‚Β Β  └── spec_helper.rb
@scalp42
scalp42 / spec_helper.rb
Created March 14, 2016 21:28 — forked from hartmantis/spec_helper.rb
ChefSpec stubs for testing a recipe in isolation
require 'chefspec'
module SpecHelper
def global_stubs
# Don't worry about external cookbook dependencies
Chef::Cookbook::Metadata.any_instance.stub(:depends)
# Test each recipe in isolation, regardless of includes
@included_recipes = []
Chef::RunContext.any_instance.stub(:loaded_recipe?).and_return(false)
@scalp42
scalp42 / README.md
Created March 8, 2016 21:12 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@scalp42
scalp42 / gist:b779ba06691e5b006bcf
Created March 2, 2016 01:31 — forked from shamil/gist:2165160
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -out ca.key 2048
openssl req -new -x509 -days 365 -key ca.key -out ca.crt

Create the Client Key and CSR