Skip to content

Instantly share code, notes, and snippets.

View charlesjohnson's full-sized avatar

Chip Johnson charlesjohnson

View GitHub Profile
/* A table for myface users */
CREATE TABLE users(
id CHAR (32) NOT NULL,
PRIMARY KEY(id),
user_name VARCHAR(64),
url VARCHAR(256),
email VARCHAR(128),
neck_beard INTEGER
);
@charlesjohnson
charlesjohnson / default_test.rb
Last active December 15, 2015 14:09
Default test files for Chef Minitest
require File.expand_path('../support/helpers', __FILE__)
describe 'myface::default' do
include Helpers::Myface
# Example spec tests can be found at http://git.io/Fahwsw
it 'runs no tests by default' do
end
@charlesjohnson
charlesjohnson / CentOS Config
Last active December 14, 2015 16:09
Reasonably server-generic Berkshelf config.json
{
"vagrant": {
"vm": {
"box": "opscode-centos-6.3",
"box_url": "https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.3_chef-11.2.0.box",
"forward_port": {
},
"network": {
"bridged": false,
@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"
@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 / 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 / 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 / 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

#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
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 = [