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 / README.md
Created June 9, 2016 06:36 — forked from fnichol/README.md
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@vinyar
vinyar / net_share_dsc.ps1
Created June 15, 2016 14:28
Converting net share to DSC
#old code
$mike_smells = 'c:\temp'
if(!(test-path \\$env:computername\MySMBShare)){net share logroot=$mike_smells}
#new DSC code
$mike_smells = 'c:\temp'
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Set-PSRepository -Name PSGallery -InstallationPolicy trusted
# this module will be used for creating shares
@vinyar
vinyar / erlang-redbug.md
Created June 16, 2016 04:45 — forked from sean-horn/erlang-redbug.md
erlang redbug debugging of ldap
@vinyar
vinyar / managing chef server.md
Created June 21, 2016 14:30
chef server management notes (probably outdated)

Tools for Managing RabbitMQ

rabbitmqctl

rabbitmqctl man page

rabbitmqctl provides some management capabilities

@vinyar
vinyar / kitchen_sink.rb
Created August 3, 2016 09:59 — forked from alexpop/kitchen_sink.rb
Script to export Chef Server nodes and add them to Chef Compliance
# encoding: utf-8
### Sample script to export Chef Server nodes and import them to Chef Compliance
### Change the 'api_url', 'api_user', 'api_pass' and 'api_org' variables below
### Change the nodes_array json suit your environment
### Go to your chef-repo and check Chef Server access first
# cd chef-repo; knife environment list
### Save this Ruby script as kitchen_sink.rb and run it like this:
# cat kitchen_sink.rb | knife exec
### Chef Compliance API docs: https://docs.chef.io/api_compliance.html
@vinyar
vinyar / chef_windows_upgrade.ps1
Created August 10, 2016 17:01 — forked from echohack/chef_windows_upgrade.ps1
chef_windows_upgrade.ps1
# Execute this script in order to upgrade all the windows nodes in your fleet of servers to the desired version of chef-client.
# This script will requires the ChefDK to be installed and configured on your Windows machine.
$windows_nodes = knife search node 'platform:windows' -i
invoke-command -ComputerName $windows_nodes -filepath C:\Users\MyUser\invoke_upgrade.ps1 -Credential domain\user
Read-Host -Prompt “Upgrade complete. Press Enter to exit.”
@vinyar
vinyar / versions and links.md
Created November 4, 2016 18:42
Vagrant + virtualbox + kitchen - stable combination
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCZgojr3phXzEdoOSBR1VH85NdSNCpJIHotGhfOporhBb0lpsqC/YQEA7+7QZY+9Oa9rNsnkPPbaDAuyyxsKM/NCAZ2i1mzTK4Mf+1S4s9asfBvXU41q2ux4A0jLAxnrf7lUP+gSzPvpi07y7ZTpM5vRYjjSUeJGzDQZPltV4n+sdNVWtlj2oxp/PPO7PTz5Y7g+jGQ4I4EluYbwv5RAwBof1CSHYZJr0u88UbGuXDly6K8jMLdy25bKHIiutiBz8ZqMN8JkZw3RSlKHhklUwYgTflVq7yhRGPGa+EJ6C7apLY88jxI24+a48qNHbNSwKPUCH4okoXg/m2Yy+2RXfb7Hx9c2hH+nOYcMC9z6SRh7usteSodfaNOgusPOPT2pvVz/0MxW3Aj1pMRDTdCNH9k0AUPYvm5J2I5U9S2rIeSJuRbm9bTJh1tQmeDyYQ09xgVKEUFx+VrXj8fzaVUmMRk6j5S91CO/4vOpP7gQ5mE6Jrj/u5FaTuXcB8vqP/KSB/eqAEZ/vmygsVXVJ0gFy+S4XlWTDTjq+67C9BeZZOoaQpOFt8iSsj3HGeZ+t0og+LhkDjh3EmXHlBEPlh0v9IOJWBHUhxnDv1OZhd4q7yyiD7YI6J9pwOayQYa8vdN6gs80ATJWc9d4ULr50ds7W8zGynHbdEdWYMedIcxBHUMrQ== alexvinyar@C02S7902G8WP
@vinyar
vinyar / vagrantfile & kitchen.yml
Created November 8, 2016 20:41
kitchen and vagrant setup for VPN
c.vm.provider :virtualbox do |p|
p.customize ["modifyvm", :id, "--cpus", "2"]
p.customize ["modifyvm", :id, "--memory", "2048"]
p.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
p.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
@vinyar
vinyar / Chef-metadata-environment-pattern.rb
Created November 17, 2016 08:58 — forked from zuazo/Chef-metadata-environment-pattern.rb
This Chef Cookbook metadata.rb example reads the dependencies from Berksfile.lock. (Experimental)
# metadata.rb
# This metadata.rb example reads the dependencies from Berksfile.lock. This can
# be used to implement the Environment Pattern with Chef Server.
#
# The Environment Cookbook:
# http://blog.vialstudios.com/the-environment-cookbook-pattern/
name 'my_face'
# [...]