Skip to content

Instantly share code, notes, and snippets.

View dougireton's full-sized avatar

Doug Ireton dougireton

View GitHub Profile
@dougireton
dougireton / recruiter_response.md
Last active January 11, 2020 22:52
I've started responding to recruiters with this list of requirements

Company Requirements

I'm definitely not looking for work. However to provide some helpful guidance for hiring like-minded engineers, I would only consider working for a company if it met these requirements:

  1. Fewer than 250 employees.
  2. Concrete, measurable plan to increase the number of women and minorities in engineering roles.
  3. Commitment to using and contributing to open source.
  4. Collaborative, friendly atmosphere where pair programming is encouraged.
  5. Meaningful work with clear linkage between work and company goals.
  6. Demonstrated commitment to ethical business practices, e.g. B corp certification.
# https://github.com/opscode-cookbooks/windows
# create a printer
windows_printer 'HP LaserJet 5th Floor' do
driver_name 'HP LaserJet 4100 Series PCL6'
ipv4_address '10.4.64.38'
end
# include Windows::Helper from Opscode Windows Cookbook
::Chef::Recipe.send(:include, Windows::Helper)
# now you can call helper methods like win_friendly_path directly
my_batch_file = win_friendly_path(
::File.join( node['cookbook']['batch_dir'],'foo.bat'))
execute "My batch file" do
command my_batch_file
creates "e:/logs/my_batch_file.log"
locate_sysnative_cmd("dism.exe")
# include Windows::Helper from Opscode Windows Cookbook
::Chef::Recipe.send(:include, Windows::Helper)
# now you can call helper methods like win_friendly_path directly
my_batch_file = win_friendly_path(
::File.join( node['cookbook']['batch_dir'],'foo.bat'))
execute "My batch file" do
command my_batch_file
creates "e:/logs/my_batch_file.log"
Ohai::Config[:disabled_plugins] = [
# The following plugins are disabled as they are either not needed,
# have poor performance, or do not apply to the Windows configuration
# we use.
"c", "cloud", "ec2", "rackspace", "eucalyptus", "command", "dmi",
"dmi_common", "erlang", "groovy", "ip_scopes", "java", "keys",
"lua", "mono", "network_listeners", "passwd", "perl",
"php", "python", "ssh_host_key", "uptime", "virtualization",
"windows::virtualization", "windows::kernel_devices"
chef_gem "chef-vault"
require 'chef-vault'
# given a 'passwords' data bag
vault = ChefVault.new("passwords")
# get the 'Administrator' data bag item
user = vault.user("Administrator")
# https://github.com/moserke/diskpart-cookbook
diskpart_partition "create_#{disk[:letter]}:/" do
disk_number disk[:number]
align disk[:align]
letter disk[:letter]
action :create
end
diskpart_partition "format_#{disk[:letter]}:/" do
@dougireton
dougireton / chef.vim
Created February 8, 2013 06:25
(Broken) chef Syntastic syntax checker
function! SyntaxCheckers_chef_IsAvailable()
return executable('foodcritic')
endfunction
function! SyntaxCheckers_chef_GetLocList()
" let exe = expand(g:syntastic_ruby_exec)
" if !has('win32')
" let exe = 'RUBYOPT= ' . exe
" endif
@dougireton
dougireton / pre-commit
Created December 11, 2012 05:22
git pre-commit hook for linting Chef cookbooks
#!/usr/bin/env ruby
# check for whitespace errors
git_ws_check = `git diff-index --check --cached HEAD --`
unless $?.success?
puts git_ws_check
exit 1
end
COOKBOOK_PATH = File.split `git rev-parse --show-toplevel`