Skip to content

Instantly share code, notes, and snippets.

View scalp42's full-sized avatar
🪂

Anthony Scalisi scalp42

🪂
View GitHub Profile
@scalp42
scalp42 / hash_inverse.rb
Last active August 29, 2015 14:27 — forked from NigelThorne/hash_inverse.rb
ruby hash invert
require './hash_inverse'
describe Hash do
describe "when empty and asked for the inverse" do
it "returns an empty hash" do
{}.inverse.must_equal Hash.new
end
end
describe "when mapping are unique and asked for the inverse" do
userAuth:
type: ldap
server: yourserver
port: 636
userDN: the_dn_of_the_keywhiz_user
password: external:/some/place
lookup:
userBaseDN: ou=some,dc=dn,dc=for,dc=your,dc=site
userAttribute: uid
requiredRoles: [keywhizAdmins]
@seeder
seeder / fetch-tmpl-content
Created July 20, 2015 10:40
Used for fetching templates from consul for use in consul-template as plugin
#!/bin/sh
TMPL=$1
DESTINATION=/config/consultemplate/template/$TMPL
TMPDESTINATION=/tmp/$DESTINATION
LOGS=/logs/$HOSTNAME
mkdir -p $LOGS
mkdir -p "`dirname $DESTINATION`"
@cnk
cnk / shell_output.sh
Created July 10, 2015 00:11
Example code from Chapter 7 (Library Example 1: Modules and Mixins) of Customizing Ruby
$ chef-client --once --local-mode --config /\
Users/cnk/Code/sandbox/customizing_chef/part3_examples/solo.rb --override-runlist testcookbook::default
Starting Chef Client, version 12.3.0
[2015-07-09T17:08:42-07:00] WARN: Run List override has been provided.
[2015-07-09T17:08:42-07:00] WARN: Original Run List: []
[2015-07-09T17:08:42-07:00] WARN: Overridden Run List: [recipe[testcookbook::default]]
resolving cookbooks for run list: ["testcookbook::default"]
Synchronizing Cookbooks:
- testcookbook
Compiling Cookbooks...
@mahnve
mahnve / gist:a173857078ecf5849dce
Last active August 30, 2022 21:47
get list of AWS us east ip ranges
curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes' | jq 'map(select(.region=="us-east-1"))' | jq 'map(.ip_prefix)'
@vinyar
vinyar / Bootstrapping chef client behind firewall
Created June 25, 2015 18:24
Bootstrapping chef client behind firewall
https://docs.chef.io/knife_bootstrap.html#custom-templates
https://docs.chef.io/install_bootstrap.html
https://docs.chef.io/knife_bootstrap.html
https://github.com/chef/chef/blob/12.2.1/lib/chef/knife/bootstrap/templates/chef-full.erb
https://github.com/chef/chef/blob/11.6.2/lib/chef/knife/bootstrap/chef-full.erb
Blog:
https://www.chef.io/blog/2014/10/28/working-with-chef-behind-your-firewall/
http://www.appneta.com/blog/customizing-chef-bootstrap-templates/
http://www.tomduffield.com/bootstrapping-without-the-internet/
@inferiorhumanorgans
inferiorhumanorgans / main.tf
Created May 28, 2015 23:18
Terraform discreet state files w/ interpolation
variable "unique" {}
variable "cidr" {}
provider "aws" {
region="us-east-1"
secret_key=""
access_key=""
}
resource "aws_security_group" "default" {
@KamilLelonek
KamilLelonek / extend_self.rb
Last active October 30, 2017 00:34
Ruby `extend self` example
module A
extend self
def a
puts 'a'
end
end
A.a # => 'a'
@SantoshSrinivas79
SantoshSrinivas79 / Startups in Financial Services.md
Last active September 12, 2016 23:09
Startups in Financial Services

#Startups in Financial Services

  • LearnVest - Financial Planning Services for Women. For $19 a month, plus a $299 set-up fee, get a financial plan, automated budget management tools organized with to-do lists and goals, and advice from human financial planners.
  • Check - Billpay app
  • Motif Investing - Buy a bucket of up to 30 stocks (a motif) built around a hot idea like CleanTech or 3-D printing for just $9.95. Buy basic Motifs made up of index ETFs for free.
  • Wealthfront - For 0.25% of invested assets a year above $10,000 (below that is free), manages your asset allocation using index ETFs. Helps Twitter and Facebook workers diversify out of company stock.
  • Personal Capital - High-end “wealth management,” including human planners and tax-saving computerized index-style investing (using individual stocks) for 0.95% of assets a year, falling in steps to 0.75% above $5 million.
  • Betterment - Makes saving and investing easy with automatic debit from your checking and with index ETF portfolios designed for
@schneems
schneems / gist:e09c95da37a8c50047a8
Created May 12, 2015 18:23
Find 50 most popular Gems that have mime-types as a dependency
require 'net/http'
require 'json'
def rubygems_get(gem_name: "", endpoint: "")
path = File.join("/api/v1/gems/", gem_name, endpoint).chomp("/") + ".json"
JSON.parse(Net::HTTP.get("rubygems.org", path))
end
results = rubygems_get(gem_name: "mime-types", endpoint: "reverse_dependencies")