Skip to content

Instantly share code, notes, and snippets.

@kgroveshok
kgroveshok / mautic.sh
Created July 4, 2017 19:31
Prevent Mautic crons from clashing with one another
#!/bin/sh
# provide blocking to prevent duplicates
echo $$
LOCKFILE=/tmp/mautic.lock
if [[ -a $LOCKFILE ]] ; then
echo "Already running?"
@kgroveshok
kgroveshok / yaml2dot.py
Created June 30, 2017 09:31 — forked from rchrd2/yaml2dot.py
YAML to Graphviz
#!/usr/bin/python
# vim: fileencoding=utf-8
u'''Translate YAML written text to graphviz dot language
Input YAML text like below:
---
foo:
@kgroveshok
kgroveshok / yaml2dot.py
Created June 30, 2017 09:30 — forked from nakamuray/yaml2dot.py
YAML to dot translator
#!/usr/bin/python
# vim: fileencoding=utf-8
u'''Translate YAML written text to graphviz dot language
Input YAML text like below:
---
employee:
- name
- age
@kgroveshok
kgroveshok / postfix_grok_pattern
Created June 6, 2017 20:13 — forked from brablc/postfix_grok_pattern
Logstash example configuration for parsing Postfix mail log files
# Postfix stuff based on https://gist.github.com/jbrownsc/4694374:
QUEUEID (?:[A-F0-9]+|NOQUEUE)
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote}
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?)
POSREAL [0-9]+(.[0-9]+)?
DELAYS (%{POSREAL}[/]*)+
DSN %{NONNEGINT}.%{NONNEGINT}.%{NONNEGINT}
STATUS sent|deferred|bounced|expired
@kgroveshok
kgroveshok / tmux.md
Created April 12, 2017 08:34 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@kgroveshok
kgroveshok / gist:488a8fd35a8349863791a694414bcacf
Created January 27, 2017 14:58 — forked from andywenk/gist:3569769
elasticsearch start/stop script
#! /bin/sh
### BEGIN INIT INFO
# Provides: elasticsearch
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts elasticsearch
# Description: Starts elasticsearch using start-stop-daemon
### END INIT INFO