Skip to content

Instantly share code, notes, and snippets.

Sylvain Mougenot smougenot

View GitHub Profile
geerlingguy /
Last active Aug 2, 2020
Ansible Role Test Shim Script
# Ansible role test shim.
# Usage: [OPTIONS] ./tests/
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
jarpy / requirements.txt
Last active Dec 3, 2019
Serverless Elasticsearch Curator for AWS Lambda
View requirements.txt
rdammkoehler /
Created Apr 21, 2016
Copy an ISO to a USB stick with a progress bar (linux/mac)
# with a progress bar
dd if=/Users/rich/Downloads/kali-linux-2016.1-amd64.iso | pv | dd of=/dev/disk2 bs=1m
xelwarto / jenkins_haproxy_config.cfg
Created May 25, 2015
Jenkins CI haproxy configuration example
View jenkins_haproxy_config.cfg
chroot /var/lib/haproxy
crt-base /etc/pki/tls/certs
group haproxy
log local0
maxconn 2000
pidfile /var/run/
stats socket /var/lib/haproxy/stats
tune.ssl.default-dh-param 2048
hrwgc /
Created Nov 13, 2013
bash wget - check if file exists at url before downloading
# simple function to check http response code before downloading a remote file
# example usage:
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi
function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
natcl /
Last active Dec 11, 2015
Script to toggle my Philips Hue lights on and off using a Raspberry Pi and a button
#!/usr/bin/env python
# -*- coding: utf-8 -*-
This script toggles lights on and off using the phue library and a physical switch
It is started on boot in /etc/rc.local with this line:
python /home/pi/light_button_control/ &
from time import sleep
smougenot / A_Logstash.conf
Created Jul 26, 2012
Logstash Multiline Filter for Java Stacktrace (tested on field)
View A_Logstash.conf
# stacktrace java as one message
multiline {
#type => "all" # no type means for all inputs
pattern => "(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)"
what => "previous"
smougenot / play.spec
Created Mar 9, 2012 — forked from dcarley/play.spec
RPM SPEC for Play Framework
View play.spec
Name: play
Version: 1.2.4
Release: 1%{?dist}
Summary: Play Framework
Group: System Environment/Daemons
License: Apache License, Version 2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
You can’t perform that action at this time.