Skip to content

Instantly share code, notes, and snippets.

View asquelt's full-sized avatar

Andy Asquelt asquelt

View GitHub Profile
class Hiera
class Scope
attr_reader :real
def initialize(real)
@real = real
end
def [](key)
#include "num2words-en.h"
#include "num2words-common.h"
#include "string.h"
// ęóąć - available
// śłżźń - absent
static const char* const ONES[] = {
"",
"jeden",
# puppet managed file, for more info 'puppet-find-resources $filename'
# BEFORE YOU MAKE ANY CHANGES, READ https://stonka.non.3dart.com/wiki/wiki/Puppet#Zarz.C4.85dzanie_konfiguracjami
# Hostname where NSCA (Nagios Service Check Adaptor) reports should be sent
$nsca_host="nsca"
require 'puppet/reports'
require 'open3'
Puppet::Reports.register_report(:nsca) do
--- galleria-fs.php~ 2014-03-18 18:15:46.364798315 +0100
+++ galleria-fs.php 2014-03-18 18:15:51.035185714 +0100
@@ -445,7 +445,7 @@
if (!empty($exif['FNumber'])) {
$f = $this->exifv($exif['FNumber']);
$f = $f[0] / $f[1];
- $f = ' and f/'.$f;
+ $f = ' and f/'.round($f);
}
if (!empty($exif['ExposureTime'])) {
#!/usr/bin/perl -w
#/home/mirror/bin/updateinfo.pl -a i386 -H rhn.redhat.com -u xxx -p xxx -c rhel-i386-server-5 -x /home/mirror/db/rhel-i386-server-5.xml -d /home/mirror/db/rhel-i386-server-5.db
#/home/mirror/bin/updateinfo.pl -a x86_64 -H rhn.redhat.com -u xxx -p xxx -c rhel-x86_64-server-5 -x /home/mirror/db/rhel-x86_64-server-5.xml -d /home/mirror/db/rhel-x86_64-server-5.db
#/home/mirror/bin/updateinfo.pl -a i386 -H rhn.redhat.com -u xxx -p xxx -c rhel-i386-server-6 -x /home/mirror/db/rhel-i386-server-6.xml -d /home/mirror/db/rhel-i386-server-6.db
#/home/mirror/bin/updateinfo.pl -a x86_64 -H rhn.redhat.com -u xxx -p xxx -c rhel-x86_64-server-6 -x /home/mirror/db/rhel-x86_64-server-6.xml -d /home/mirror/db/rhel-x86_64-server-6.db
use strict;
$|=1;
@asquelt
asquelt / unencrypt-tree
Created July 3, 2015 13:30
a quick script to remove all encryption from git repo; run: git filter-branch --tree-filter '/tmp/unencrypt-tree' deadbeef..HEAD
#!/bin/bash
i=1
log=$(mktemp /dev/shm/unenc.XXXXXXX)
find -type f -name \*.gpg|while read f ; do
out=$(mktemp /dev/shm/unenc.XXXXXXX)
[ $i -gt 1 ] && ec"o -n "
gpg <$f >$out 2>/dev/null
if [ -s $out ] ; then
mv $out $f
echo -n "[$f]"
# https://docs.puppetlabs.com/pe/latest/nc_classification.html
set -x
facts="{\"fact\":$(puppet facts find $1)}"
#resp=$(curl -X POST -H 'Content-Type: application/json' \
# --data "$facts" \
# --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem \
# --cert /opt/puppet/share/puppet-dashboard/certs/pe-internal-dashboard.cert.pem \
# --key /opt/puppet/share/puppet-dashboard/certs/pe-internal-dashboard.private_key.pem \
@asquelt
asquelt / ca-bundle.crt
Last active August 29, 2015 14:26
to install puppet enterprise 2015.2 you need verisign root certificate that AWS uses imported into your CA-bundle (on centos: /etc/pki/tls/certs/ca-bundle.crt)
# VeriSign Class 3 Public Primary CA
-----BEGIN CERTIFICATE-----
MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG
A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
@asquelt
asquelt / haproxy.sh
Created November 25, 2015 15:14
acmetool hook for haproxy
#!/bin/bash
# If haproxy is installed this hook will assemble certificates
# in HAPROXY_DIR so that they can be used for SSL termination.
#
# Suggested configuration (/etc/haproxy/haproxy.cfg):
#
# global
# ssl-default-bind-options no-sslv3 no-tls-tickets
# tune.ssl.default-dh-param 2048
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.5
Comment: Hostname: pgp.mit.edu
mQGiBEVwDGkRBACwPhZIpvkjI8wV9sFTDoqyPLx1ub8Sd/w+YuI5Ovm49mvvEQVTVLg8FgE5
JlST59AbsLDyVtRa9CxIvN5syBVrWWWtHtDnnylFBcqG/A6J3bI4E9/AUtSL5Zxbav0+utP6
f3wOpxQrxc+WIDVgpurdBKAQ3dsobGBqypeX6FXZ5wCgou6CyZpGIBqosJaDWLzNeOfb/70D
/1thLkQyhW3JJ6cHCYJHNfBShvbLWBf6S231mgmuMyMlt8Kmipc9bw+saaAkSkVsQ/ZbfjrW
B7e5kbMruKLVrH+nGhamlHYUGyAPtsPgUj/NUSj5BmrCsOkMpn43ngTLssE9MLhSPj2nIHGF
v9B+iVLvomDdwnaBRgQ1aK8zz6MAA/406yf5yVJ/MlTWs1/68VwDhosc9BtU1V5IE0NXgZUA