Skip to content

Instantly share code, notes, and snippets.

View drahamim's full-sized avatar

Daniel Rahamim drahamim

View GitHub Profile
#!/usr/bin/env python
import string
import sys
import hmac
import hashlib
def split_hex(value):
value = value[4:] if len(value) % 4 == 0 else "0" + value[4:]
return " ".join(value[i:i+4] for i in range(0, len(value), 4))
SECRET = bytearray.fromhex('85 44 E3 B4 7E CA 58 F9 58 30 43 F8')
D = hmac.new(SECRET, digestmod=hashlib.sha1)
@drahamim
drahamim / migration.sh
Created November 17, 2015 17:12 — forked from stephenlauck/migration.sh
Migrate node across hosted chef servers
# update gems
sudo gem update --no-rdoc --no-ri
# edit client.rb with correct validation key and chef server
# also set the environment
log_level :info
log_location STDOUT
chef_server_url "https://api.opscode.com/organizations/modcloth-comments"
validation_client_name "modcloth-comments-validator"
node_name "comments-standalone-01.demo.modcloth.com"
@drahamim
drahamim / Bootstrapping chef client behind firewall
Last active August 29, 2015 14:26 — forked from vinyar/Bootstrapping chef client behind firewall
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/