Skip to content

Instantly share code, notes, and snippets.

View adamcrews's full-sized avatar

Adam Crews adamcrews

View GitHub Profile
@adamcrews
adamcrews / gist:6983331
Created October 14, 2013 22:29
windows sid
C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\bin>puppet resource file c:\httpd-2.2.25-win32-x86-openssl-0.9.8y.msi
file { 'c:\httpd-2.2.25-win32-x86-openssl-0.9.8y.msi':
ensure => 'file',
content => '{md5}b83edbc9811e27c7b493e35514a820aa',
ctime => '2013-10-14 16:30:31 +0000',
group => 'S-1-5-21-1589796259-2920747512-705253099-513',
mode => '2000700',
mtime => '2013-10-14 16:30:44 +0000',
owner => 'S-1-5-32-544',
type => 'file',
@adamcrews
adamcrews / gist:6983435
Created October 14, 2013 22:37
Sample Manifest
exec { 'Download Apache':
command => "powershell.exe -Command (new-object System.Net.WebClient).DownloadFile('http://archive.apache.org/dist/httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi', 'C:/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi')",
path => 'C:\Windows\System32\WindowsPowerShell\v1.0',
creates => 'C:\httpd-2.2.25-win32-x86-openssl-0.9.8y.msi',
logoutput => true,
}
file { 'C:\httpd-2.2.25-win32-x86-openssl-0.9.8y.msi':
owner => "EVIL\\Administrators",
group => "EVIL\\Administrators",
@adamcrews
adamcrews / gist:7087489
Created October 21, 2013 17:20
require array
$files = [ '/tmp/1', '/tmp/2', '/tmp/3']
file { $files:
ensure => file,
}
file { '/tmp/all':
ensure => file,
require => File[$files],
}
@adamcrews
adamcrews / gist:8344110
Created January 9, 2014 23:26
crappy, crappy, crappy kickstart
#!/bin/bash
#
CERTNAME='foo.adam.vm'
CONFDIR='/tmp/ssl_keys'
SSLDIR=`puppet config print ssldir`
PUPPETMASTER=`puppet config print server`
FQDN=`facter fqdn`
@adamcrews
adamcrews / gist:9837172
Created March 28, 2014 16:37
kill stuck mcollective process on windows
exec { 'kill_stuck_mcollective':
command => 'stop-process -force (get-wmiobject Win32_Service -filter \'name="pe-mcollective"\').ProcessID',
unless  => 'if ((get-service "pe-mcollective" | select status).Status -eq "StopPending") { exit 1 }',
provider => powershell,
}
@adamcrews
adamcrews / sample_apt.pp
Created April 1, 2014 17:41
sample apt
node 'node1.my.vm' {
class { '::profile::apt':
unstable => true,
}
}
node 'vagrant.vm' {
class { '::profile::apt':
unstable => false,
}
@adamcrews
adamcrews / zone.rb
Created April 1, 2014 18:14
zone fact
Facter.add(:my_zone) do
# confine :kernel => :Linux
setcode do
net = Facter.value('ipaddress').split('.').shift(2).join('.')
# scheme is: 10.13x.x.x == west_datacenter and so on
case net
when /^10\.13[0-9]$/
zone = 'west_datacenter'
when /^10\.14[0-9]$/
zone = 'euro_datacenter'
@adamcrews
adamcrews / example.pp
Created April 1, 2014 18:52
auth_keys
class profile::ssh {
# this installs ssh server, makes it start, ect.
# my current favorite is https://forge.puppetlabs.com/saz/ssh
include ssh
}
define myssh::authkeys_file (
$user = root,
$group = root,
$keygroup = 'default',
@adamcrews
adamcrews / keybase.md
Last active December 3, 2019 21:33
keybase.md

Keybase proof

I hereby claim:

  • I am adamcrews on github.
  • I am doo (https://keybase.io/doo) on keybase.
  • I have a public key ASArJsXtndbm5JTOtYBC5_DCnXRKOfphcoydCqliWie4YQo

To claim this, I am signing this object:

NameVirtualHost <%= @vhost_name %>:<%= @port %>
<VirtualHost <%= @vhost_name %>:<%= @port %>>
ServerName <%= @servername %>
DocumentRoot <%= @docroot %>
<Directory <%= @docroot %>>
Options <%= @options %>
AllowOverride None
Order allow,deny
allow from all
</Directory>