Skip to content

Instantly share code, notes, and snippets.

@rdark
rdark / wsus_cleanup.ps1
Created September 2, 2014 14:57
automate clean up of WSUS
# Script to clean up WSUS database
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
$cleanupScope = new-object Microsoft.UpdateServices.Administration.CleanupScope;
$cleanupScope.DeclineSupersededUpdates = $true
$cleanupScope.DeclineExpiredUpdates = $true
$cleanupScope.CleanupObsoleteUpdates = $true
$cleanupScope.CompressUpdates = $true
$cleanupScope.CleanupObsoleteComputers = $true
$cleanupScope.CleanupUnneededContentFiles = $true
@rdark
rdark / keybase.md
Created September 22, 2014 19:06
keybase.md

Keybase proof

I hereby claim:

  • I am rdark on github.
  • I am rdark (https://keybase.io/rdark) on keybase.
  • I have a public key whose fingerprint is CF92 BB4E ABDF 0368 2828 2C1C F17D 4E75 ED47 71E0

To claim this, I am signing this object:

%global __requires_exclude %{?__requires_exclude}|perl\\(VMS::Filespec\\)
Error: Package: perl516-perl-DynaLoader-Functions-0.002-5.el6.noarch (external-rhscl-perl516)
Requires: perl516-perl(VMS::Filespec)
Configuration:
Libraries:
intel mic . . . . . . no (MicAccessApi not found)
libaquaero5 . . . . . no (libaquaero5.h not found)
libcurl . . . . . . . yes
libdbi . . . . . . . yes
libcredis . . . . . . no
libesmtp . . . . . . yes
libganglia . . . . . yes
libgcrypt . . . . . . yes
@rdark
rdark / gist:9a6ac449c3e72c494602
Created October 24, 2014 13:37
hiera() lookup function
pakrat::ldap_exclude_hosts: "%{hiera('trusted_hosts')}"
trusted_hosts:
- '127.0.0.1/8'
- '192.168.1.1/32'
Error: "127.0.0.1/8192.168.1.1/32" is not an Array. It looks to be a String at /tmp/vagrant-puppet-1/modules-0/pakrat/manifests/init.pp:109 on node puppet.vm
Error: "127.0.0.1/8192.168.1.1/32" is not an Array. It looks to be a String at /tmp/vagrant-puppet-1/modules-0/pakrat/manifests/init.pp:109 on node puppet.vm
@rdark
rdark / gist:c70791321e9800cb816f
Created October 24, 2014 13:59
delete_nested_subkeys
#
# delete_child_subkey.rb
#
# === Author
#
# Richard Clark <[email protected]>
#
module Puppet::Parser::Functions
newfunction(:delete_child_subkey, :type => :rvalue, :doc => <<-EOS
Given a hash containing nested hashes, a single or array of regular
@rdark
rdark / gist:a69290a2cf352160db5e
Created November 5, 2014 14:54
Augeas XML arrays
# What I get
<configuration>
<foo>
<nodes>
<node>
<domainname>puppet-foobar.vm:7310</domainname>
</node>
<node>
<domainname>d1.mynode.example.com</domainname>
</node>
@rdark
rdark / gist:93ae34b3617b71bbe16d
Created November 7, 2014 08:13
function (three arguments)
Rake spec:
$ rake spec
function_name
example at ./spec/functions/function_name_spec.rb:40 (FAILED - 1)
Failures:
@rdark
rdark / gist:4406c0cee74339c3db7f
Created November 11, 2014 17:11
connect timeout
Nov 11 17:00:56 ip-10-35-165-195 yum[1007]: Installed: 1:facter-2.3.0-1.el6.x86_64
Nov 11 17:01:00 ip-10-35-165-195 yum[1007]: Installed: puppet-3.6.2-1.el6.noarch
Nov 11 17:02:26 ip-10-35-165-195 puppet-agent[1069]: Error connecting to mgmt-pupt-prod-002.eu-west-1.aws.compute.telnic.net:8140: Connection timed out - connect(2)
Nov 11 17:02:26 ip-10-35-165-195 puppet-agent[1069]: Could not request certificate: getaddrinfo: Name or service not known
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"ap-northeast-1" : {
"AMI" : "ami-19fba518"
},