Skip to content

Instantly share code, notes, and snippets.

View tomislacker's full-sized avatar

Ben Tomasik tomislacker

View GitHub Profile
from docopt import docopt
import sys
class command(object):
registry = {}
short_docs = []
def __init__(self, doc = None):
self.short_docs.append(doc)
def __call__(self, fn):
@deltheil
deltheil / nginx.conf
Created June 4, 2012 07:57
Hide sensitive GET parameters within nginx access logs thanks to the Lua module
http {
log_format filt '$remote_addr - $remote_user [$time_local] "$_request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
location /login {
# `set` is provided by the Rewrite module
set $filter "password|secret";
@xavierjurado
xavierjurado / gist:3138813
Created July 18, 2012 20:53
Gitlab Gmail configuration

Gitlab Gmail configuration

In Gitlab 2.6 you must edit the following files in order to send messages through a Gmail account (also applicable to Google Apps accounts).

config/environments/production.rb

config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
@non
non / calc.py
Created December 2, 2012 06:28
python calculator
#!/usr/bin/python
#
# by Erik Osheim
#
# This program uses a recursive descent, LL1 parser to generate a Code object
# for the given input. Code objects are pure expressions whose behavior can
# only be controlled via a dictionary of strings-to-numbers provided to run.
#
# Syntax:
#
@glenfant
glenfant / logging_yaml_config.py
Last active November 11, 2021 14:08
A example of logging medium complex configuration using YAML on Python 2.7 or 3.2
# -*- coding: utf-8
"""\
A simple demo of logging configuration with YAML (Python 2.7)
=============================================================
Requires PyYAML -> "easy_install PyYAML"
See the recipes for configuring logging with dicts and YAML
- http://docs.python.org/2.7/howto/logging-cookbook.html
- http://stackoverflow.com/questions/10519392/python2-7-logging-configuration-with-yaml
@scottslowe
scottslowe / ifcfg-mgmt0-script
Created February 7, 2013 20:20
This RHEL/RHEL variant network startup script creates an OVS internal interface and assigns it an IP address.
DEVICE="mgmt0"
BOOTPROTO="static"
ONBOOT="yes"
DEVICETYPE="ovs"
TYPE="OVSIntPort"
IPADDR=10.11.12.13
NETMASK=255.255.255.0
OVS_BRIDGE="ovsbr0"
HOTPLUG="no"
@magnetikonline
magnetikonline / README.md
Last active October 29, 2025 21:22
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@MHenderson
MHenderson / networkx-notebook.ipynb
Last active February 9, 2016 23:22
Learning NetworkX in IPython.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ismell
ismell / README.md
Last active September 10, 2016 15:39
Docker Ubuntu upstart scripts

Production Ready Process Monitoring

  1. Install docker-manger.conf and docker-instance.conf in /etc/init

  2. Create a containers file in /etc/docker/ with the following format

     name: image cmd
    

    The name must be unique.

  3. sudo service docker-manager start

@chhibber
chhibber / gist:6908927
Last active June 23, 2022 20:02
LaunchConfig with Cloudformation::Init
"LaunchConfig" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Metadata" : {
"AWS::CloudFormation::Init" : {
"config" : {
"files" : {
"/tmp/boot-strap-nat00.sh" : {
"source" : { "Fn::Join" : ["", [
"http://", { "Ref" : "AWS::Region" }, "-development-appname", ".s3.amazonaws.com/path/to/boot-strap-nat00.sh"
]]}