Skip to content

Instantly share code, notes, and snippets.

@mrzarquon
mrzarquon / gist:0d2e198f26960c4ffb14
Created November 2, 2014 17:44
show_classification.sh "PE Master" - to see the full json rule / configuration for the "PE Master" classification group in the console
#!/bin/bash
# simple 3.7 NC classifier commands
declare -x PE_CERT=$(/opt/puppet/bin/puppet agent --configprint hostcert)
declare -x PE_KEY=$(/opt/puppet/bin/puppet agent --configprint hostprivkey)
declare -x PE_CA=$(/opt/puppet/bin/puppet agent --configprint localcacert)
declare -x NC_CURL_OPT="-s --cacert $PE_CA --cert $PE_CERT --key $PE_KEY --insecure"
@mrzarquon
mrzarquon / gist:be2860937d729c2c74de
Created December 16, 2014 19:24
Make a service restart more graceful
class classroom::master::wait_for_startup {
Service <| title == 'pe-puppetserver' |> {
hasrestart => true,
restart => "service pe-puppetserver restart && while true; do puppet status ${clientcert} --terminus rest && break; sleep 5; done"
}
Service <| title == 'pe-console-services' |> {
hasrestart => true,
restart => "service pe-console-services restart && while true; do curl http://localhost:4432/classifier-api/v1/last-class-update && break; sleep 5; done",
}

Keybase proof

I hereby claim:

  • I am mrzarquon on github.
  • I am mrzarquon (https://keybase.io/mrzarquon) on keybase.
  • I have a public key whose fingerprint is 7761 9BB7 53DF E567 66DF 11AE 9AD2 FACB 10C3 8462

To claim this, I am signing this object:

@mrzarquon
mrzarquon / LazyDrop
Created March 23, 2012 21:02
Quick way to drop a file anywhere with luggage
include /usr/local/share/luggage/luggage.make
TITLE=Jamf_Foo
REVERSE_DOMAIN=org.angrydome
DESTINATIONFOLDER="/Library/Application Support/JAMF/Self Service/Plug-ins/"
FILEPAYLOAD="foobar"
PACKAGE_VERSION=`/usr/bin/git rev-parse --verify HEAD | /usr/bin/cut -c1-10`
PAYLOAD=\
foo
defaults write /Library/Preferences/com.apple.Bluetooth BluetoothAutoSeekKeyboard -bool false
defaults write /Library/Preferences/com.apple.Bluetooth BluetoothAutoSeekPointingDevice -bool false
@mrzarquon
mrzarquon / gist:3687791
Created September 9, 2012 22:52
Hope you've had a nice flight gary
curiosity:puppet-scripts chris$ sudo ./postflight
looking for Puppet User
<dscl_cmd> DS Error: -14136 (eDSRecordNotFound)
Looking for Puppet Group
<dscl_cmd> DS Error: -14136 (eDSRecordNotFound)
Creating Puppet User (uid: 52) in new Puppet Group (gid: 495)
curiosity:puppet-scripts chris$ sudo ./postflight
looking for Puppet User
dsAttrTypeNative:KerberosKeys:
30820151 a1030201 01a08201 48308201 443072a1 2b3029a0 03020112 a1220420 d671c11e 458153bd c7b7f5ae 51cf303f f2688854 6b361774 23dfe1fa 2acd3f38 a2433041 a0030201 03a13a04 384c4b44 433a5348 41312e35 30363944 44433842 30454545 39333646 30423639 31363234 32343836 43313132 41413443 36304270 75707065 743062a1 1b3019a0 03020111 a1120410 0c21266a 91641731 f69dd50a 03d30d3f a2433041 a0030201 03a13a04 384c4b44 433a5348 41312e35 30363944 44433842 30454545 39333646 30423639 31363234 32343836 43313132 41413443 36304270 75707065 74306aa1 233021a0 03020110 a11a0418 70f77057 64e9859e 6d25ec13 a2bab06d d968a79e 152fb58f a2433041 a0030201 03a13a04 384c4b44 433a5348 4131
@mrzarquon
mrzarquon / gist:3754072
Created September 20, 2012 05:09
rc.local to start puppet from a template
/usr/local/bin/puppet agent -t
chkconfig --level 2345 pe-puppet on
chkconfig --level 2345 pe-mcollective on
/etc/init.d/pe-puppet start
/etc/init.d/pe-mcollective start
@mrzarquon
mrzarquon / gist:4042676
Created November 8, 2012 23:46
Puppet Upgrade
[root@centos63a vagrant]# puppet --version
2.7.12 (Puppet Enterprise 2.5.3)
[root@centos63a vagrant]# puppet agent -t
info: Retrieving plugin
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_version.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/win_common_desktop_directory.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/concat_basedir.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb
@mrzarquon
mrzarquon / gist:4172392
Created November 29, 2012 22:38
pe-httpd port 80 configu
root@master:/etc/puppetlabs/httpd/conf.d# cat enable80.conf
Listen 80
# ls /opt/puppet/htdocs/
index.html
@mrzarquon
mrzarquon / gist:4632484
Created January 25, 2013 07:25
Minimal packages needed for a puppet run.
pe-puppet
pe-facter
pe-puppet-enterprise-release
pe-ruby
pe-ruby-libs
pe-ruby-shadow