Skip to content

Instantly share code, notes, and snippets.

@atomic-penguin
atomic-penguin / chef-server-gemfile-error
Created October 24, 2010 20:12
chef-server -N -e production
[root@muchef ~]# chef-server -N -e production
Merb root at: /usr/lib64/ruby/gems/1.8/gems/chef-server-api-0.9.12
~ No Gemfile found! If you're generating new app with merb-gen this is fine, otherwise run: bundle init to create Gemfile
Loading init file from ./config/init.rb
[Sun, 24 Oct 2010 16:11:36 -0400] INFO: Loading roles
/usr/lib64/ruby/gems/1.8/gems/mixlib-authentication-1.1.4/lib/mixlib/authentication/http_authentication_request.rb:25: warning: already initialized constant MANDATORY_HEADERS
/usr/lib64/ruby/gems/1.8/gems/mixlib-authentication-1.1.4/lib/mixlib/authentication/signatureverification.rb:28: warning: already initialized constant SignatureResponse
/usr/lib64/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/utils.rb:138:in `union': can't convert Array into String (TypeError)
from /usr/lib64/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/utils.rb:138
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
@atomic-penguin
atomic-penguin / gist:702003
Created November 16, 2010 16:20
/etc/profile.d/java.sh
#!/bin/bash
#$JAVA_HOME for all users
export JAVA_HOME=/usr/lib/jvm/jre
export PATH=$JAVA_HOME/bin:$PATH
#!/bin/sh
COUCHDB_URI="http://localhost:5984/chef"
curl -H "Content-Type: application/json" -X POST $COUCHDB_URI/_compact >/dev/null 2>&1
for i in users sandboxes roles nodes id_map data_bags cookbooks clients checksums; do
curl -H "Content-Type: application/json" -X POST $COUCHDB_URI/_compact/$i >/dev/null 2>&1;
done
@atomic-penguin
atomic-penguin / gist:742934
Created December 16, 2010 02:33
erbcheck.sh
#!/bin/bash
if [ ! "$1" ]; then
echo -e "\nRuby ERB syntax checker."
echo -e "Usage: `basename $0` <filename>\n"
else
erubis -x -T '-' "$1" | ruby -c
fi
@atomic-penguin
atomic-penguin / gist:870043
Created March 14, 2011 23:01
rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - Source
baseurl=ftp://ftp.redhat.com/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
@atomic-penguin
atomic-penguin / gist:873754
Created March 17, 2011 02:43
group resource example
group "sysadmins" do
gid 2000
members [ "alice", "bob", "frank" ]
end
@atomic-penguin
atomic-penguin / gist:916198
Created April 12, 2011 19:21
rndc-key-gen
wolfe21@wolfe21-hk47:~/chef/site-cookbooks/bind/attributes$ dd if=/dev/urandom bs=128 count=1 | openssl dgst -md5 -hmac | base64
NmE0NDZkOWYyZGJmZWYwNTgxZWYxNzY5ZGQyMDliZGUK
@atomic-penguin
atomic-penguin / gist:952091
Created May 2, 2011 18:25
rhel-linux-ipv6-notes
We couldn’t find that file to show.
@atomic-penguin
atomic-penguin / gist:957846
Created May 5, 2011 20:23
crontab_environment.sh
# crontab environment howto
# field allowed values
# ----- --------------
# minute 0-59
# hour 0-23
# day of month 1-31
# month 1-12 (or names, see below)
# day of week 0-7 (0 or 7 is Sun, or use names)
0 12 * * * [ -x $HOME/.bash_profile ] && . $HOME/.bash_profile && foo