Skip to content

Instantly share code, notes, and snippets.

@MAS150MD200
MAS150MD200 / logstash.conf
Created April 11, 2018 14:22 — forked from radu-gheorghe/logstash.conf
logstash grok filter for Elasticsearch logs
filter {
if [type] == "elasticsearch" {
grok {
match => [ "message", "\[%{TIMESTAMP_ISO8601:timestamp}\]\[%{DATA:severity}%{SPACE}\]\[%{DATA:source}%{SPACE}\]%{SPACE}(?<message>(.|\r|\n)*)" ]
overwrite => [ "message" ]
}
if "_grokparsefailure" not in [tags] {
grok { # regular logs
match => [
@MAS150MD200
MAS150MD200 / rd-clean.sh
Created February 17, 2018 09:58 — forked from unicolet/rd-clean.sh
Shell script to purge Rundeck execution history
#!/bin/sh
# setup ~/.pgpass to allow passwordless connection to postgres
# keep last 30 executions for each job
KEEP=30
cd /var/lib/rundeck/logs/rundeck
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d`
@MAS150MD200
MAS150MD200 / clean_rundeck.sh
Created February 17, 2018 09:58 — forked from remijouannet/clean_rundeck.sh
Shell script to purge Rundeck execution history, mysql
#!/bin/bash
# keep last 30 executions for each job
set -e
KEEP=60
MYSQLHOST=mysql
MYSQLUSER=rundeck
MYSQLPASSWORD=password
MYSQLDB=rundeck
#!/bin/bash
#
# consul Manage the consul agent
#
# chkconfig: 2345 95 95
# description: Consul is a tool for service discovery and configuration
# processname: consul
# config: /etc/consul.conf
# pidfile: /var/run/consul.pid
@MAS150MD200
MAS150MD200 / threadping.py
Created May 7, 2017 12:41 — forked from glallen01/threadping.py
Python Threaded Ping
#!/usr/bin/env python
from collections import deque
import Queue
import csv
import datetime
import os
import re
import subprocess
import multiprocessing as mp
@MAS150MD200
MAS150MD200 / root_logger_settings.py
Created March 22, 2017 13:13 — forked from st4lk/root_logger_settings.py
Python logging settings for root logger
"""
Settings for root logger.
Log messages will be printed to console and also to log file (rotated, with
specified size). All log messages from used libraries will be also handled.
Three approaches for defining logging settings are used:
1. using logging classes directly (py25+, py30+)
2. using fileConfig (py26+, py30+)
3. using dictConfig (py27+, py32+)
Choose any variant as you like, but keep in mind python versions, that
@MAS150MD200
MAS150MD200 / install.sh
Created November 2, 2016 15:51 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@MAS150MD200
MAS150MD200 / ansible-summary.md
Created October 9, 2016 09:20 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@MAS150MD200
MAS150MD200 / init.pp
Created August 28, 2016 15:02 — forked from Raboo/init.pp
augeas ntp puppet
augeas { "ntp.conf":
context => "/files/etc/ntp.conf",
changes => [
"rm server[.]",
"set server timehost.tconet.net",
"clear server[. = 'timehost.tconet.net']/iburst",
"set server[. = 'timehost.tconet.net']/maxpoll 9",
"clear server[. = 'timehost.tconet.net']/prefer",
],
require => Package["ntp"],
https://blog.svedr.in/posts/prometheus-quick-start.html
https://blog.svedr.in/posts/prometheus-quick-start.rst
.. title: Prometheus quick start
.. slug: prometheus-quick-start
.. date: 2016-07-05 15:50:00 UTC+02:00
.. tags: linux, prometheus
.. link:
.. description: