Skip to content

Instantly share code, notes, and snippets.

View spheromak's full-sized avatar
🕵️‍♂️

Jesse Nelson spheromak

🕵️‍♂️
View GitHub Profile
@spheromak
spheromak / boot_setup.sh
Created June 20, 2012 07:52
first boot shell script for vm guests
#!/bin/bash
# vim: set tabstop=2 noexpandtab:
# Jesse Nelson <[email protected]>
#
# Custom setup script to init early networking after VM initialization
# This script should be run before network init scripts as it preps the network
#
# The idea is to pass down ip config settings through boot params so that this
# script can configure the network on first boot Anaconda will take care of this
# on machines that are kickstarted, but this lets us just be 100%
@spheromak
spheromak / bash_profile.sh
Created July 26, 2012 23:20
bashrc and simple aliases for managing multiple chef envs
#
# Need to move your initial ~/.chef to ~/.chef-ENV
#
alias prod="rm ~/.chef; ln -sf ~/.chef-prod ~/.chef; export CHEF_ENV=prod"
alias dev="rm ~/.chef; ln -sf ~/.chef-dev ~/.chef; export CHEF_ENV=dev"
function knife_env {
if [ -e ~/.chef ] ; then
echo $( cd -P ~/.chef ; echo ${PWD##*-} )
fi
@spheromak
spheromak / kickstart post script
Last active December 11, 2015 12:38
First boot static network over kernel params
%post --log=/var/log/post_install.log
# ensure we have xvc0 console
if [ -f /dev/xvc0 ] ; then
echo "co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav" >> /etc/inittab
echo "xvc0" >> /etc/securetty
fi
# install CA cert bundle
wget -O/etc/pki/tls/certs/ca-bundle.crt http://curl.haxx.se/ca/cacert.pem
#!/usr/bin/env ruby
#
# Parse a zone file and dump output suitable for a cucumber test data set
#
class DnsZoneParser
require 'socket'
attr_accessor :records
def initialize(filename)
knife confifure --admin-client-key /etc/chef-server/admin.pem --admin-client-name admin --validation-client-name chef-validator --validation-key=/etc/chef-server/chef-validator.pem -i
topology "standalone"
server_name = "server.vm"
api_fqdn server_name
nginx['url'] = "https://#{server_name}"
nginx['server_name'] = server_name
lb['fqdn'] = server_name
bookshelf['vip'] = server_name
execute "echo_path" do
command 'echo $PATH > /tmp/test_path'
environment ({ 'PATH' => "#{ENV['PATH']}:/this/is/something" } )
end
# Get the proper system type.
def system_class
virt = node.virtualization
if virt[:role]
if virt[:role] == "guest" && virt[:system] == "xen"
return "xen-guest"
elsif virt[:role] == "host" && virt[:system] == "xen"
return "xen-host"
else
return "unknown-vm"
require 'json'
require 'uri'
require 'httpclient'
require 'redis'
require 'mw-irc'
# First, get an access token for your account on the command line
# curl -d '{"scopes":["repo"],"note":"Post-Receive Hooks"}' -u 'username:******' https://api.github.com/authorizations
# Paste your access token here
jnelson@trendy mkd2 develop ~/repos/ng_base
$ /Applications/Vagrant/bin/vagrant plugin install berkshelf-vagrant
Installing the 'berkshelf-vagrant' plugin. This can take a few minutes...
Installed the plugin 'berkshelf-vagrant (1.1.0)'!
jnelson@trendy mkd2 develop ~/repos/ng_base
$ /Applications/Vagrant/bin/vagrant -v
/Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate activesupport-3.2.13, because i18n-0.6.4 conflicts with i18n (= 0.6.1) (Gem::LoadError)
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/specification.rb:746:in `activate'
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/custom_require.rb:51:in `block in require'
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/custom_require.rb:50:in `each'