Skip to content

Instantly share code, notes, and snippets.

c197493644ea54b514965e448ac60fab
@ryanking
ryanking / cantTouchThis.rb
Created December 6, 2013 01:03
I just stumbled on this bit of ruby code from a long time ago. Matt Knox and I were trying to solve the question of "can you selectively prevent monkey-patching in ruby?" I think this is the best we could do at the time.
# Ever get tired of people messing with your ruby classes?
# now you can put the hammer down and stop them. Just
# include this module and no one will be able to modify the
# class implementation or any instance implementations.
module Stop
module CantTouchThis
def self.included(mod)
Verifying that +rk is my openname (Bitcoin username). https://onename.io/rk
provisioner "local-exec" {
command = "aws elb create-load-balancer-policy --load-balancer-name ${var.deploy_environment}-storm-elb --policy-name EnableProxyProtocol --policy-type-name ProxyProtocolPolicyType --policy-attributes AttributeName=ProxyProtocol,AttributeValue=True"
}
provisioner "local-exec" {
command = "aws elb set-load-balancer-policies-for-backend-server --load-balancer-name ${var.deploy_environment}-storm-elb --instance-port 8000 --policy-names EnableProxyProtocol"
}
### Keybase proof
I hereby claim:
* I am ryanking on github.
* I am ryanking (https://keybase.io/ryanking) on keybase.
* I have a public key whose fingerprint is 8376 0403 7FD2 E5AA 9DB4 6D1C EA44 1C28 C205 A9F6
To claim this, I am signing this object:
$ terraform remote config -state=state/state.tfstate -backend=S3 -backend-config="bucket=boltops" -backend-config="key=terraform-state" -backend-config="region=us-west-1"
Remote state management enabled
Error while performing the initial pull. The error message is shown
below. Note that remote state was properly configured, so you don't
need to reconfigure. You can now use `push` and `pull` directly.
Error reloading remote state: RequestError: send request failed
caused by: Get : 301 response missing Location header
~/code/bolt/infrastructure/terraform2 (master)*$ TF_LOG=1 tf plan
2015/07/16 16:02:49 [INFO] Terraform version: 0.6.0 e40127fda6766dbea2749c17ba61f97b78c6c468
2015/07/16 16:02:49 Detected home directory from env var: /Users/ryanking
2015/07/16 16:02:49 [DEBUG] Discovered plugin: atlas = /Users/ryanking/bin/terraform-provider-atlas
2015/07/16 16:02:49 [DEBUG] Discovered plugin: aws = /Users/ryanking/bin/terraform-provider-aws
2015/07/16 16:02:49 [DEBUG] Discovered plugin: azure = /Users/ryanking/bin/terraform-provider-azure
2015/07/16 16:02:49 [DEBUG] Discovered plugin: cloudflare = /Users/ryanking/bin/terraform-provider-cloudflare
2015/07/16 16:02:49 [DEBUG] Discovered plugin: cloudstack = /Users/ryanking/bin/terraform-provider-cloudstack
2015/07/16 16:02:49 [DEBUG] Discovered plugin: consul = /Users/ryanking/bin/terraform-provider-consul
2015/07/16 16:02:49 [DEBUG] Discovered plugin: digitalocean = /Users/ryanking/bin/terraform-provider-digitalocean
This file has been truncated, but you can view the full file.
^C~/code/bolt/infrastructure/terraform2 (master)*TF_LOG=1 terraform plan
2015/07/29 10:29:31 [INFO] Terraform version: 0.6.0 e40127fda6766dbea2749c17ba61f97b78c6c468
2015/07/29 10:29:31 Detected home directory from env var: /Users/ryanking
2015/07/29 10:29:31 [DEBUG] Discovered plugin: atlas = /Users/ryanking/bin/terraform-provider-atlas
2015/07/29 10:29:31 [DEBUG] Discovered plugin: aws = /Users/ryanking/bin/terraform-provider-aws
2015/07/29 10:29:31 [DEBUG] Discovered plugin: azure = /Users/ryanking/bin/terraform-provider-azure
2015/07/29 10:29:31 [DEBUG] Discovered plugin: cloudflare = /Users/ryanking/bin/terraform-provider-cloudflare
2015/07/29 10:29:31 [DEBUG] Discovered plugin: cloudstack = /Users/ryanking/bin/terraform-provider-cloudstack
2015/07/29 10:29:31 [DEBUG] Discovered plugin: consul = /Users/ryanking/bin/terraform-provider-consul
2015/07/29 10:29:31 [DEBUG] Discovered plugin: digitalocean = /Users/ryanking/bin/terraform-provider-digitalocean
select(0x0, 0x0, 0x0, 0x0, 0x208C55F38) = 0 0
@ryanking
ryanking / powerball.rb
Last active January 11, 2016 02:31
powerball number generator
#!/usr/bin/env ruby
require 'colorize'
white_ball_drum = (1..69).to_a
red_ball_drum = (1..26).to_a
white_balls = []
red_ball = nil