Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# vault-ec2-auth.sh
# Authenticates an EC2 instance to Hashicorp Vault
#
# configuration stored in environment variables in /etc/vault/client.conf
# expected configuration (defaults are selected below if none is specified):
# VAULT_ADDR = url of vault server
# VAULT_ROLE = role name to authenticate as
@VerosK
VerosK / lunchtime.py
Last active September 14, 2018 11:05
ansible module example
#!/usr/bin/env python
from ansible.module_utils.basic import *
module = AnsibleModule(
argument_spec = dict(
hour = dict(default=12,type='int'),
),
supports_check_mode=True,
)
@sumitasok
sumitasok / interface-funcprog-oop.go
Last active August 29, 2015 14:05
A Display of interface and Functional Programming playing hand in hand with OOP - with Golang
package reqresp
type ReqResp interface {
HashableString() string
IgnoreList() map[string]string
}
type Response struct {
Type Type
Details DataTypes
@staltz
staltz / introrx.md
Last active April 24, 2024 19:47
The introduction to Reactive Programming you've been missing
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by
# Jared Stafford (jspenguin@jspenguin.org)
# Modified so that it finds cookies
import sys
import struct
import socket
import time
import select
@makuk66
makuk66 / acng.conf.diff
Last active December 17, 2015 16:29
apt-cacher-ng patch for oracle java (.bin) and .tgz/.zip
--- acng.conf.orig 2013-05-23 21:20:04.000000000 +0100
+++ acng.conf 2013-05-28 15:02:23.000000000 +0100
@@ -100,6 +100,7 @@
#
#VfilePattern = (^|.*?/)(Index|Packages\.bz2|Packages\.gz|Packages|Release|Release\.gpg|Sources\.bz2|Sources\.gz|Sources|release|index\.db-.*\.gz|Contents-[^/]*\.gz|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*\.bz2)$
#PfilePattern = .*(\.deb|\.rpm|\.dsc|\.tar\.gz\.gpg|\.tar\.gz|\.diff\.gz|\.diff\.bz2|\.jigdo|\.template|changelog|copyright|\.udeb|\.diff/.*\.gz|vmlinuz|initrd\.gz|(Devel)?ReleaseAnnouncement(\\?.*)?)$
+PfilePattern = .*(\.deb|\.rpm|\.dsc|\.tar\.gz\.gpg|\.tar\.gz|\.tgz|\.zip|\.diff\.gz|\.diff\.bz2|\.jigdo|\.bin(\?AuthParam=.*)?|\.template|changelog|copyright|\.udeb|\.diff/.*\.gz|vmlinuz|initrd\.gz|(Devel)?ReleaseAnnouncement(\\?.*)?)$
# Whitelist for expiration, file types not to be removed even when being
# unreferenced. Default: same as VfilePattern which is a safe bed. When and
# only when the only used mirrors are official repositories
@mathie
mathie / phantomjs.pp
Created April 14, 2013 15:15
Puppet class for installing phantomjs. An example of using curl to grab a tarball for installation.
class phantomjs {
include xvfb
$version = '1.8.1'
$basename = "phantomjs-${version}-linux-x86_64"
$tarball = "${basename}.tar.bz2"
$tarball_path = "/opt/${tarball}"
$url = "http://phantomjs.googlecode.com/files/${tarball}"
$destdir = "/opt/${basename}"
@qrush
qrush / gist:5301799
Created April 3, 2013 14:41
spring clean your git repos!
# remove any bad refs
git remote prune origin
# pipe into bash and auto-delete any branches that have been merged into master!
git log master --pretty=format:'%d' | grep '^ (origin' | tr -d ' ()' | sed 's/origin\//git push origin :/'
@ChrisLundquist
ChrisLundquist / elasticsearch.coffee
Created November 10, 2012 11:04
elasticsearch plugin for Hubot
# Description:
# Log all the things to ElasticSearch then lets you ask hubot what you missed
#
# Dependencies:
# None
#
# Configuration:
# ELASTICSEARCH_HOSTNAME - E.G. elasticsearch.example.com:9200, where to send the put requests
# ELASTICSEARCH_USERNAME - OPTIONAL basic auth username
# ELASTICSEARCH_PASSWORD - OPTIONAL basic auth password
@csexton
csexton / gist:3772971
Created September 23, 2012 20:36
/etc/init.d/znc startup script
#! /bin/sh
### BEGIN INIT INFO
# Provides: znc
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: znc initscript
# Description: This is the init-Script for znc.
### END INIT INFO
# Author: Henner M. Kruse