Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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
#!/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 / 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
@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 / 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 / README.md
Created May 17, 2018 16:15 — forked from lborg019/README.md
Fine tuning smileart's zsh agnoster theme:

lukezin's .zsh-theme

Improvements to smileart's agnoster theme mod:

  • Replaced special characters in the code (fixed bugged characters, currently works with powerline fonts)
  • Prompt is shorter, shows only the current directory
  • LS Colors match iTerm's Dark Solarized theme

to do:

  • Fix tab completion: tab completion should automatically work on special characters (such as [) right now you have to escape such characters for tab to complete it \[
@MAS150MD200
MAS150MD200 / README.md
Created May 17, 2018 16:16 — forked from smileart/README.md
My ZSH Theme — Agnoster Mod

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@MAS150MD200
MAS150MD200 / prometheus.md
Created June 14, 2018 13:27 — forked from petarnikolovski/prometheus.md
Prometheus 2.x installation on Ubuntu 16.04 server.

Installing Prometheus on Ubuntu 16.04

This gist is a compilation of two tutorials. You can find the original tutorials here and here. What should you know before using this? Everything can be executed from the home folder. For easier cleanup at the end you can make directory where you'll download everything, and then just use rm -rf .. Although, you should be careful. If some strange bugs arise unexpectedly somewhere sometimes, just keep in mind that some user names have underscores in them (this is probably nothing to worry about).

Create Users

sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Prometheus Monitoring User" prometheus
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Node Exporter User" node_exporter
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Alertm