Skip to content

Instantly share code, notes, and snippets.

View charlesjohnson's full-sized avatar

Charles Johnson charlesjohnson

View GitHub Profile
@charlesjohnson
charlesjohnson / default_attributes.rb
Created October 24, 2012 03:09
Ark library usage example
default['elasticsearch']['version'] = "0.19.6"
default['elasticsearch']['checksum'] = 'f0ec550fb86c4bc8f08afb15de4e197e85f9fcfd352fbb7eb49aaff98f7731dd'
default['elasticsearch']['url'] = "http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-#{node['elasticsearch']['version']}.tar.gz"
default['elasticsearch']['home_path'] = "/usr/lib"
default['elasticsearch']['home_dir'] = "#{node['elasticsearch']['home_path']}/elasticsearch"
@charlesjohnson
charlesjohnson / gist:4033583
Created November 7, 2012 18:50
Conditional notification example
template "/etc/bind/named.conf.local" do
source "named.conf.local.erb"
owner "root"
group "bind"
mode 00644
variables({
:role => node["bind"]["role"],
:masters => node["bind"]["masters"],
:directory => node["bind"]["zone_dir"]
})
@charlesjohnson
charlesjohnson / Ubuntu Vagrantfile
Created December 22, 2012 09:16
Example Vagrantfiles
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# The path to the Berksfile to use with Vagrant Berkshelf
# config.berkshelf.berksfile_path = "./Berksfile"
# An array of symbols representing groups of cookbook described in the Vagrantfile
# to skip installing and copying to Vagrant's shelf.
config.vm.provision :chef_solo do |chef|
chef.json = {
:mysql => {
:server_root_password => 'rootpass',
:server_debian_password => 'debpass',
:server_repl_password => 'replpass'
}
}
chef.run_list = [
#Disable Server Manager
windows_registry 'HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\Chef2013Feb-DisableServerManager' do
type :string
values 'Version' => "1.0", 'StubPath' => 'reg add HKCU\Software\Microsoft\ServerManager /v "DoNotOpenServerManagerAtLogon" /d "1" /t REG_DWORD /f'
action :create
end
@charlesjohnson
charlesjohnson / The Hole Hawg.md
Last active December 13, 2015 19:39
Excerpted From In the Beginning Was the Command Line, by Neal Stephenson. http://www.cryptonomicon.com/beginning.html

The Hole Hawg is a drill made by the Milwaukee Tool Company. If you look in a typical hardware store you may find smaller Milwaukee drills but not the Hole Hawg, which is too powerful and too expensive for homeowners. The Hole Hawg does not have the pistol-like design of a cheap homeowner's drill. It is a cube of solid metal with a handle sticking out of one face and a chuck mounted in another. The cube contains a disconcertingly potent electric motor. You can hold the handle and operate the trigger with your index finger, but unless you are exceptionally strong you cannot control the weight of the Hole Hawg with one hand; it is a two-hander all the way. In order to fight off the counter-torque of the Hole Hawg you use a separate handle (provided), which you screw into one side of the iron cube or the other depending on whether you are using your left or right hand to operate the trigger. This handle is not a sleek, ergonomically designed item as it would be in a homeowner's drill. It is simply a foot-long ch

@charlesjohnson
charlesjohnson / Vagrantfile snippet.rb
Created February 16, 2013 17:52
Vagrantfile snippet
chef.json = {
:mysql => {
:server_root_password => 'rootpass',
:server_debian_password => 'debpass',
:server_repl_password => 'replpass'
},
:resolver => {
:nameservers => [
"8.8.8.8",
"8.8.4.4"
@charlesjohnson
charlesjohnson / Add Sublime Text to $PATH
Last active December 14, 2015 10:29
Commands for installing Sublime Text 2 on OSX
sudo mkdir -p /usr/local/bin; \
sudo chown -R $(whoami) /usr/local/bin; \
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
@charlesjohnson
charlesjohnson / Download Sublime Package Control
Last active December 14, 2015 12:39
One-liner to install Sublime Package Control on OSX
curl -o ~/Library/Application\ Support/Sublime\ Text\ 2/Installed\ Packages/Package\ Control.sublime-package https://sublime.wbond.net/Package%20Control.sublime-package
@charlesjohnson
charlesjohnson / gist:5101696
Created March 6, 2013 18:22
Copy a file in Chef
node.default["copy_file"]["source"] = '/root/foo'
node.default["copy_file"]["destination"] = '/tmp/foonew'
file node["copy_file"]["source"] do
action :create
content "This is a file created by Chef!\n"
owner "root"
group "root"
mode "0644"