Skip to content

Instantly share code, notes, and snippets.

View mikemackintosh's full-sized avatar
🍏

Mike Mackintosh mikemackintosh

🍏
View GitHub Profile
@mikemackintosh
mikemackintosh / module_sensu.py
Created February 16, 2016 17:57 — forked from mzupan/module_sensu.py
sensu salt module and state. Not 100% but it creates/deletes
# -*- coding: utf-8 -*-
'''
Support for Sensu
.. note::
The functions in here are generic functions designed to work with
all sensu.
'''
import logging
import os
@mikemackintosh
mikemackintosh / pre-commit
Created January 5, 2016 17:50 — forked from saliceti/pre-commit
Git pre-commit hook to check for AWS keys
#!/usr/bin/env bash
# Install globally using https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook
# The checks are simple and can give false positives. Amend the hook in the specific repository.
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
#!/bin/bash
additional_strace_args="$1"
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6)
while read -r pid;
do
if [[ $pid != $MASTER_PID ]]; then
nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 &
# Copyright (c) 1999-2011, Juniper Networks Inc.
# All rights reserved.
# Author: Jeremy Schulman
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# Copyright (c) 1999-2011, Juniper Networks Inc.
# All rights reserved.
# Author: Jeremy Schulman
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#