Skip to content

Instantly share code, notes, and snippets.

View calston's full-sized avatar

Colin Alston calston

View GitHub Profile
Facter.add("nginx") do
setcode do
if File.exist? "/etc/nginx/nginx.conf"
true
else
false
end
end
end
if $nginx {
file { '/etc/munin/plugins/nginx_request':
ensure => present,
mode => '0755',
owner => root,
group => root,
source => 'puppet:///modules/munin/nginx_request',
notify => Service['munin-node']
}
}
from twisted.internet import ssl, protocol
from twisted.protocols.tls import TLSMemoryBIOFactory
from txeap import proto_utils
class EAPTLSProtocol(protocol.Protocol):
def dataReceived(self, bytes):
print "Received:", repr(bytes)
serverFactory = protocol.ServerFactory()
#!/bin/bash
for i in *
do
w=`identify -format "%[fx:w]" "$i"`
if [ "$w" -gt "1280" ]; then
mogrify -resize 1280x1024 "$i"
fi
done
@calston
calston / gist:6654546
Created September 21, 2013 21:46
Riakasaurus compat test
riakasaurus.test_crosscompat.test_basic
Tests
test_client ...
self.client.is_alive... [PASS]
self.client.ping... [FAIL]
self.client.stream_buckets... [FAIL]
self.client.bucket... [PASS]
self.client.get_keys... [FAIL]
self.client.get... [FAIL]
self.client.stream_keys... [FAIL]
# aptitude install puppet
The following packages will be upgraded:
puppet puppet-common{b}
2 packages upgraded, 0 newly installed, 0 to remove and 158 not upgraded.
Need to get 1 146 kB of archives. After unpacking 943 kB will be used.
The following packages have unmet dependencies:
puppetmaster-common : Depends: puppet-common (= 3.1.1-1puppetlabs1) but 3.3.0-1puppetlabs1 is to be installed.
puppet-common : Depends: ruby-rgen (>= 0.6.5) which is a virtual package.
open: 1291; closed: 83; defer: 1229; conflict: 1229 oThe following actions will resolve these dependencies:
Notice: Finished catalog run in 20.59 seconds
Error: Could not send report: Error 400 on SERVER: Could not intern from pson: undefined method `from_pson' for Puppet::Transaction::Report:Class
Notice: There was an error sending the report.
Notice: This error is possibly caused by sending the report in a format the master can not handle.
Notice: A puppet master older than 3.2.2 can not handle pson reports.
Notice: Set report_serialization_format=yaml on the agent to send reports to older masters.
Notice: See http://links.puppetlabs.com/deprecate_yaml_on_network for more information.
Currently vpnc-script is not directly configurable from configfiles.
However, a workaround is to use a "wrapper-script" like this, to
disable /etc/resolv.conf rewriting and setup a custom split-routing:
------------------------------
#!/bin/sh
# this effectively disables changes to /etc/resolv.conf
INTERNAL_IP4_DNS=
~# tracepath 196.216.242.2
1: vumi-gateway.za.prk-host.net 0.069ms pmtu 1500
1: 197.221.31.89 4.221ms
1: 197.221.31.89 4.204ms
2: 41.204.206.36 0.790ms asymm 3
3: 41.203.6.41 16.887ms asymm 5
4: ge8-0-0.gw1.cpt1.za.mtnbusiness.net 0.877ms asymm 5
5: 196.7.21.14 0.918ms
6: 196.7.21.3 1.053ms asymm 5
7: srp5-0-0.cr2.cpt1.za.mtnbusiness.net 187.935ms asymm 5
MultipleObjectsReturned: get() returned more than one GeneralPreferences -- it returned 2! Lookup parameters were {}
ERROR 2013-12-09 14:59:28,156 base 18128 140388145288960 Internal Server Error: /logo/
Traceback (most recent call last):
File "/var/praekelt/eggs/Django-1.4.1-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/var/praekelt/eggs/Django-1.4.1-py2.7.egg/django/views/generic/simple.py", line 26, in direct_to_template
c = RequestContext(request, dictionary)
File "/var/praekelt/eggs/Django-1.4.1-py2.7.egg/django/template/context.py", line 176, in __init__
self.update(processor(request))
File "/var/praekelt/eggs/jmbo_foundry-1.1.21-py2.7.egg/foundry/context_processors.py", line 13, in foundry