Skip to content

Instantly share code, notes, and snippets.

View scalp42's full-sized avatar
🪂

Anthony Scalisi scalp42

🪂
View GitHub Profile
@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")
@hraban
hraban / pre-commit.md
Last active December 25, 2025 17:22
Prevent accidentally committing debug code in Git
@solarce
solarce / keystore.rb
Created April 21, 2015 16:26
snippets of how we get rundeck behind nginx+ssl
# Import the self-signed certificate from chef-server for rundeck's store
cert_alias = "#{node['fqdn']}-selfsigned-crt"
execute "import-rundeck-self-signed-cert" do
not_if "keytool -list -keystore /etc/rundeck/ssl/truststore -storepass adminadmin | grep #{cert_alias}"
command "keytool -import -alias #{cert_alias} -file /var/opt/chef-server/nginx/ca/*.crt -keystore /etc/rundeck/ssl/truststore -storepass adminadmin -noprompt"
action :run
end
@iGlitch
iGlitch / card1to2.py
Last active April 26, 2021 07:00
Convert card1 3DS to card2
import os,sys,struct,subprocess
print("\ncard1to2\nby Glitch\nTrimming feature by Jdbye\n")
filename=sys.argv[1]
f=open(filename,"rb+")
MB=0x100000
def num2string(n,size):
ret=""
for i in range(size):
@md5
md5 / 00_README.md
Last active January 17, 2026 10:19
Demonstration Docker config for Wordpress on PHP-FPM behind Nginx

Proof of concept setup for Wordpress running under PHP-FPM with an Nginx frontend

Usage

Build a copy of this image:

git clone git://github.com/d9206eacb5a0ff5d6be0.git docker-nginx-fpm
cd docker-nginx-fpm
docker build -t nginx-fpm .
@O-I
O-I / hash_except.md
Last active August 2, 2023 17:31
[TIx 4] Remove key-value pairs from a hash and return the hash

Note: As of Ruby 3.0.0, Hash#except is now [part][1] of the language. However, Ruby does not implement Hash#except!.

Sometimes I want to remove a specific key-value pair from a Ruby hash and get the resulting hash back. If you're using Rails or ActiveSupport you can accomplish this using Hash#except:

hash = { a: 1, b: 2, c: 3 }
hash.except(:a)     # => { b: 2, c: 3 }

# note, the original hash is not modified
hash # => { a: 1, b: 2, c: 3 }