Skip to content

Instantly share code, notes, and snippets.

View vinyar's full-sized avatar

Mr. Pacman vinyar

  • Launch Consulting
  • Seattle
View GitHub Profile
@vinyar
vinyar / attribs.rb
Created September 5, 2014 22:31
attribute structure that I like
attributes:
default['winsecureos']['services']['foo'] = {
:action => [ :stop, :disable ],
:name => 'ALG',
:description => 'Application Layer Gateway Service'}
default['winsecureos']['services']['foo1'] = {
:action => [ :stop, :manual ],
:name => 'AppMgmt',
@vinyar
vinyar / nodes.transform.rb
Created September 10, 2014 02:16
nodes.transform(:all) {|n| n.chef_environment("dev")}
0:/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2633:Net::HTTPResponse:^: raise error_type().new(@code + ' ' + @message.dump, self)
#0:/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2633:Net::HTTPResponse:<: raise error_type().new(@code + ' ' + @message.dump, self)
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:146:Chef::HTTP:-: log_failed_request(response, return_value) unless response.nil?
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:235:Chef::HTTP:>: def log_failed_request(response, return_value)
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:236:Chef::HTTP:-: return_value ||= {}
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:237:Chef::HTTP:-: error_message = "HTTP Request Returned #{response.code} #{response.message}: "
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:238:Chef::HTTP:-: error_message << (return_value["er
@vinyar
vinyar / ohai.rb
Created September 12, 2014 19:35
Rebuilding ohai slide
Ohai.plugin(:ApacheModules) do
require 'mixlib/shellout'
provides "apache/modules"
collect_data(:default) do
string = Mixlib::ShellOut.new("apachectl -t -D DUMP_MODULES")
string.run_command
apache Mash.new
apache[:modules] = string.stdout
end
@vinyar
vinyar / apache.rb
Last active August 29, 2015 14:06 — forked from mcquin/apache.rb
# plugins/apache/modules.rb
# :ApacheModules good, you might have some other plugin providing modules
# and you wouldn't want to overlap on the :Modules namespace.
Ohai.plugin(:ApacheModules) do
require 'mixlib/shellout'
provides "apache/modules"
collect_data(:default) do
string = Mixlib::ShellOut.new("apachectl -t -D DUMP_MODULES")
string.run_command
# 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')
@vinyar
vinyar / gemrc.erb
Last active August 29, 2015 14:06 — forked from charlesjohnson/gemrc.erb
:sources:
- http://<%= node['gem_file']['host'] %>:<%= node['gem_file']['port'] %>/
@vinyar
vinyar / vagrantfile.rb
Created September 29, 2014 22:39
Vagrant file for working on VPN
# -*- mode: ruby -*-
# vi: set ft=ruby :
cookbook_name = "centrify"
box = "windows2008r2"
box_url = "http://bla.com/windows2008r2.box"
hostname = "server_name"
Vagrant.configure("2") do |config|
#config.omnibus.chef_version = :latest
@vinyar
vinyar / Vagrantfile.rb
Last active August 29, 2015 14:09
Vagrant blob for blog
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "alex_rocks"
# config.vm.synced_folder "../../stuff_for_windows", "c:/mount_point"
config.vm.guest = :windows
# New veature in vagrant 1.6. Makes windows much easier.
@vinyar
vinyar / gist:50649216b131837a3a29
Last active August 29, 2015 14:09
certify pains that make you want to throw large objects

When creating expense

  • All of the expenses need currency specified individually. There is no way to specify currently at the expense report level.
  • Location should be definable at the Expense level and persist through all of the receipts. Currently have to specify location on each receipt. Super time waster.
  • No ability to rearrange items within a day to reflect the actual flow of events.
  • No ability to flag expenses as "follow up" or "double check of accuracy"
  • The app flags same value transactions as potentially duplicates even when they have different receipts attached, took place in different cities, or generally have fundamentally different characteristics. 
  • No way to accept flagged transactions as 'not duplicate'.
  • When pressing 'cancel' Website presents a completely useless dialog box prompting - "are you sure you want to cancel" even though no changes have been made and data is already saved. There is no reason to ask a user if they're sure since there is no risk of data loss. Useless 'fe
powershell_script "Install IIS" do
code "add-windowsfeature Web-Server"
action :run
end
service "w3svc" do
action [:enable, :start ]
end
#node.default["iis_demo"]["indexfile"] = "Default2.htm"