This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -m SimpleHTTPServer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osascript -e 'display notification "Lorem ipsum dolor sit amet" with title "Title" subtitle "subtitle"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys, os | |
from subprocess import call | |
message_file = sys.argv[1] | |
def check_format_rules(lineno, line): | |
real_lineno = lineno + 1 | |
if lineno == 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import (absolute_import, division, print_function) | |
__metaclass__ = type | |
import os | |
import glob | |
from ansible.plugins.lookup import LookupBase | |
class LookupModule(LookupBase): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
#import cProfile | |
import os | |
import StringIO | |
class InstrumentMiddleware(object): | |
# def process_request(self, request): | |
# if 'profile' in request.REQUEST: | |
# request.profiler = cProfile.Profile() | |
# request.profiler.enable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
import collectd | |
import psycopg2 | |
config = { | |
'connection_string': 'dbname=pgbouncer user=np_db_user port=6432' | |
} | |
def get_stats(): | |
conn, cur = None, None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find all parents and kill the whole process tree | |
ps xao pgid,ppid,pid,comm | grep defunct | awk '{print -$2}' | sort -n | uniq -d | xargs sudo kill -9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://lnav.org/schemas/format-v1.schema.json", | |
"bunyan_log": { | |
"title": "JFrog Billing Report", | |
"url": "https://gist.github.com/bitle/65b45ce807ca3bc84183145efee9528f", | |
"description": "Lnav format for reading JFrog Billing Report files", | |
"json": true, | |
"file-pattern": "artifactory-traffic-.*.log", | |
"line-format": [ | |
{ |