Skip to content

Instantly share code, notes, and snippets.

View hh's full-sized avatar

Hippie Hacker hh

View GitHub Profile
@irvingpop
irvingpop / ec11.1-ldap-bug.txt
Last active August 29, 2015 13:57
Patching the EC11.1 LDAP user creation bug
EC 11.1.x has a bug [OC-11384] when an LDAP user attempts to create a new account
that has never existed in the Enterprise Chef database before, rather than linking
with an existing internal user.
Please apply the attached patch to your EC 11.1.x release:
$ cd /opt/opscode/embedded/service/gem/ruby/1.9.1/bundler/gems/mixlib-authorization-c03f584a371b
$ patch -p1 < /tmp/cache/ec11.1-ldap500error.patch
patching file lib/opscode/models/user.rb
$ private-chef-ctl restart opscode-account
@ober
ober / init.el
Created September 17, 2014 16:41
main
;;; init.el --- Where all the magic begins
;;
;; This file loads Org-mode and then loads the rest of our Emacs
;; initialization from Emacs lisp embedded in literate Org-mode files.
;; Load up Org Mode and (now included) Org Babel for elisp embedded in
;; Org Mode files
(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))
(let* ((org-dir (expand-file-name
@ober
ober / .Xdefaults
Created September 18, 2014 18:36
Xdefaults
XTerm*faceName: Pragmata
XTerm*faceSize: 10
XTerm*background: grey13
XTerm*foreground: grey75
XTerm*cursorColor: darkorange1
XTerm*scrollBar: false
XTterm*utf8: 2
XTerm*metaSendsEscape: true
XTerm*eightBitInput: false
#!/usr/bin/env ruby
def find_deps(cookbook_dir)
nel = Hash.new { |h, k| h[k] = [] }
Dir.glob("#{cookbook_dir}/*/").each do |r|
deps_for(r, nel)
end
nel
end
z = 3 * 0x41662d2d * 123750872726249
o = []
puts z.to_s(16)
while z != 0
# let's eat through z one byte at a time
l = z >>4 &0xf #shift right then AND with 16 to get the character
r = z &0xf #just AND with 16 to get the XORed with l position in the array
o[r^l]=(l + 97).chr #put the character in the correct spot in the array
@charles-dyfis-net
charles-dyfis-net / definition.rb
Created July 24, 2011 19:33
CentOS-6.0 (i386) + RBEL Chef veewee definition
Veewee::Session.declare( {
:cpu_count => '1', :memory_size=> '384',
:disk_size => '10140', :disk_format => 'VDI',
:os_type_id => 'RedHat',
:iso_file => "CentOS-6.0-i386-bin-DVD.iso", :iso_src => "", :iso_md5 => "d7e57d6edaca1556d5bad2fa88602309", :iso_download_timeout => 1000,
:boot_wait => "10",:boot_cmd_sequence => ['<Esc>', 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>'],
:kickstart_port => "7122", :kickstart_timeout => 10000,:kickstart_file => "ks.cfg",
:ssh_login_timeout => "100",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
:ssh_host_port => "7222", :ssh_guest_port => "22",
:sudo_cmd => "echo '%p'|sudo -S sh '%f'",
#!/bin/bash
set -e -x
echo "Setting up base system"
REMOTE_SCRIPT="https://raw.github.com/gist/2573056/74237aada624251de7ddfe5e8b98a6e39f736e43/base_setup.sh"
wget -nv -O - "$REMOTE_SCRIPT" | bash
echo "Setting up Chef"
#REMOTE_SCRIPT="http://codecafe.com/chef/ec2_client_setup.sh"
REMOTE_SCRIPT="http://git.io/chefclientsetup.1"
@spikegrobstein
spikegrobstein / chef_compact.sh
Created November 16, 2012 23:39
Chef compaction script run via cron
#! /bin/bash -
curl -H "Content-Type: application/json" localhost:5984/chef
curl -H "Content-Type: application/json" -X POST http://localhost:5984/chef/_compact
sleep 3
for VIEW in nodes roles registrations clients data_bags data_bags_items users checksums cookbooks sandboxes environments id_map; do
curl -H "Content-Type: application/json" -X POST http://localhost:5984/chef/_compact/$VIEW
@jtimberman
jtimberman / rename-node.rb
Created March 2, 2012 07:47 — forked from mpasternacki/rename-node.rb
A knife exec script to change Chef node's name.
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
anonymous
anonymous / Firefox Default SSL CAs.mkd
Created January 2, 2013 17:24
Is there a way to change the default SSL CA's for firefox BEFORE the profile is created on Ubuntu?
user@laptop:~$ lsb_release  -a
No LSB modules are available.
Distributor ID:  Ubuntu
Description:	Ubuntu 12.04.1 LTS
Release:	12.04
Codename:	precise

user@laptop:~$ certutil -d ~/.mozilla/firefox/fk9tyf55.default -L