Skip to content

Instantly share code, notes, and snippets.

View charlesjohnson's full-sized avatar

Charles Johnson charlesjohnson

View GitHub Profile
@charlesjohnson
charlesjohnson / Brewfile
Last active March 18, 2020 19:16
Brewfile
# Taps
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "sambadevi/powerlevel9k"
# Brew CLI apps
brew "fd"
brew "fzf"
@charlesjohnson
charlesjohnson / foo.chef.rb
Last active November 4, 2019 05:47
Get bash / execute output from Chef
#!/opt/chefdk/bin/chef-apply
# Lifted pretty much verbatim from http://stackoverflow.com/questions/17813592/how-can-i-display-the-output-of-a-opscode-chef-bash-command-in-my-console)
results = "/tmp/output.txt"
file results do
action :delete
end
cmd = "ls /"
bash cmd do

Keybase proof

I hereby claim:

  • I am charlesjohnson on github.
  • I am chipadeedoodah (https://keybase.io/chipadeedoodah) on keybase.
  • I have a public key ASC6A2ZXs9oAPsolgExpIOmtEhVmlufZ1mKEbt3g4sVa0Qo

To claim this, I am signing this object:

@charlesjohnson
charlesjohnson / example1.rb
Created March 31, 2017 04:50
In Chef, these two examples are roughly syntactically equivalent
directory '/var/www/'
# Note: This can take as long as 15 minutes, and will show the bootstrap stuck at "waiting for winrm," but should not take more than 30.
knife ec2 server create -V -V --flavor m1.large --bootstrap-protocol winrm -I ami-173d747e --user-data ./userdata.ps1 -r "role[nopcommerce]" -x opscode -P "opscode" -N demo_nopcommerce1 --tags "Name=demo_nopcommerce1" -Z us-east-1d --distro "windows-chef-client-msi" -S charles_opscode
@charlesjohnson
charlesjohnson / config.json
Last active December 31, 2015 18:39 — forked from micgo/CentOS Berkshelf Config
~/.berkshelf/config.json
{
"vagrant": {
"vm": {
"box": "opscode-centos-6.5",
"box_url": "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box",
"forward_port": {},
"network": {
"bridged": false
},
"provision": "chef_solo"
@charlesjohnson
charlesjohnson / .kitchen.local.yml
Created December 6, 2013 00:45
Docker kitchen config
---
driver_plugin: docker
driver_config:
socket: tcp://33.33.33.10:4243
use_sudo: false
# provision_command: curl -L https://www.opscode.com/chef/install.sh | bash
require_chef_omnibus: true
settings:
parallel: true
require 'spec_helper'
describe 'hodor' do
context 'hodor' do
it 'hodor' do
expect(hodor).to hodor(hodor)
end
end
end
template '/etc/php5/apache2/php.ini' do
source 'php.ini.erb'
cookbook 'php'
owner 'root'
group 'root'
mode '0644'
end
@charlesjohnson
charlesjohnson / Vagrantfile
Last active December 26, 2015 08:19
Vagrant.has_plugin? example
# Plugin-specific configurations
if Vagrant.has_plugin?('vagrant-cachier')
puts 'INFO: Vagrant-cachier plugin detected. Optimizing caches.'
config.cache.enable :chef
config.cache.enable :apt
else
puts 'WARN: Vagrant-cachier plugin not detected. Continuing unoptimized.'
end
if Vagrant.has_plugin?('Omnibus')