Skip to content

Instantly share code, notes, and snippets.

Sylvain Mougenot smougenot

Block or report user

Report or block smougenot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@geerlingguy
geerlingguy / ansible-role-test.sh
Last active Sep 19, 2019
Ansible Role Test Shim Script
View ansible-role-test.sh
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - 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
jarpy / requirements.txt
Last active Jul 31, 2019
Serverless Elasticsearch Curator for AWS Lambda
View requirements.txt
certifi==2016.8.8
elasticsearch-curator==4.0.6
PyYAML==3.11
@rdammkoehler
rdammkoehler / copy_iso_to_usb.sh
Created Apr 21, 2016
Copy an ISO to a USB stick with a progress bar (linux/mac)
View copy_iso_to_usb.sh
# with a progress bar
dd if=/Users/rich/Downloads/kali-linux-2016.1-amd64.iso | pv | dd of=/dev/disk2 bs=1m
@xelwarto
xelwarto / jenkins_haproxy_config.cfg
Created May 25, 2015
Jenkins CI haproxy configuration example
View jenkins_haproxy_config.cfg
global
chroot /var/lib/haproxy
crt-base /etc/pki/tls/certs
daemon
group haproxy
log 127.0.0.1 local0
maxconn 2000
pidfile /var/run/haproxy.pid
stats socket /var/lib/haproxy/stats
tune.ssl.default-dh-param 2048
@hrwgc
hrwgc / validate.sh
Created Nov 13, 2013
bash wget - check if file exists at url before downloading
View validate.sh
#!/bin/bash
# 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
natcl / light_button_control.py
Last active Dec 11, 2015
Script to toggle my Philips Hue lights on and off using a Raspberry Pi and a button
View light_button_control.py
#!/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/light_button_control.py &
'''
from time import sleep
@smougenot
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
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
URL: http://www.playframework.org/
Source0: http://download.playframework.org/releases/%{name}-%{version}.zip
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
You can’t perform that action at this time.