Skip to content

Instantly share code, notes, and snippets.

View leoh0's full-sized avatar
🕶️
Working

Eohyung Lee leoh0

🕶️
Working
View GitHub Profile
@whitekid
whitekid / genpass.sh
Created March 26, 2014 06:01
Random Password Generator
#!/bin/sh
genpasswd() {
local l=$1
[ "$l" == "" ] && l=16
cat /dev/urandom | LC_CTYPE=C tr -dc A-Za-z0-9_ | head -c ${l}
echo
}
genpasswd "$@"
# TODO throwing error:
# Cannot find a resource for to_ary on ubuntu version 12.04
require 'set'
file "/root/chef_resources-#{node.name}.json" do
resource_clxn = Chef::ResourceCollection.new
run_context.resource_collection.each do |r|
next if r.class.to_s == 'Chef::Resource::NodeMetadata'
r = r.dup