Skip to content

Instantly share code, notes, and snippets.

View aleks-mariusz's full-sized avatar

aleks aleks-mariusz

  • London, UK (formerly NYC)
View GitHub Profile
"cniVersion": "0.4.0",
"name": "podman",
"plugins": [
"type": "bridge",
"bridge": "cni-podman0",
"isGateway": true,
"ipMasq": false,
"ipam": {
aleks-mariusz /
Created August 20, 2019 13:42
yum repo sync script
#!/usr/bin/env bash
aleks-mariusz / 06-fluentd-daemonset.yaml
Last active September 25, 2018 18:35
set of fluentd configs for kubernetes aggregated logging into elasticsearch using fluentd, on k8s v1.11+ using docker 1.13+ on centos 7 - kubectl apply the 06-fluentd-daemonset.yaml after placing the other files below into a directory (such as "fluentd-configs") and create configmap using: kubectl -n monitoring create configmap es-fluentd --from…
# Source: fluentd-elasticsearch/templates/service-account.yaml
apiVersion: v1
kind: ServiceAccount
name: es-fluentd
namespace: monitoring
app: fluentd "true"
aleks-mariusz /
Last active July 30, 2018 08:36
kubernetes v1.11.1 - HA setup scripts for centos 7.x used (kickstart file used: - need to also set up keepalived on 2nd/3rd node and replace socat with nginx
aleks-mariusz /
Last active April 26, 2017 23:02
used to distributing keys to different systems uniquely.. takes on standard input and distributes it uniquely to all clients hitting the /k endpoint
#!/usr/bin/env python
import atexit
import functools
import gzip
import itertools
import logging
import os
import socket
import sys
aleks-mariusz /
Created February 9, 2017 21:52
This utiilty helps to find metrics in graphite whisper format that haven't been updated in a preset number of days
import optparse # argparse not available since most systems still have python 2.6 (argparse is in 2.7)
import os
import sys
import time
# helper function to return the parent dir given a dir
parent_of = lambda p: os.path.sep.join( p.split( os.path.sep )[:-1] )
aleks-mariusz / post-install
Last active January 12, 2017 14:22
xenserver7 automated (unattended) installation using cobbler, a trigger script to work with cobbler.sync, also the post-install depends on this answerfile (treated as a kickstart file by cobbler) - sets up small OS partition, and whatever left over space as the xen-storage-repository, installs gluster, and if two disks of same size seen, mirrors…
if [[ $1 -ne 0 ]]; then
echo "ERROR: failed install, backing out changes"
mdadm --stop /dev/md{0,1,2,3}
mdadm --zero-superblock /dev/sd{a,b}{1,4,5,6}
sgdisk --zap /dev/sdb
aleks-mariusz / centos75-minimal.ks
Last active July 26, 2018 18:06
got centos 7.5 down to about 180 packages - around 600 meg installed, note: i removed xfsprogs because i'm using ext2, if you use xfs you may want to remove e2fs* instead
eula --agreed
lang en_US.UTF-8
keyboard us
timezone Europe/London
# Use network installation
aleks-mariusz /
Last active November 9, 2016 17:33
this script preps the sqlite db used by the web-app graphite after initial install by populating it with a default user, preventing a potential race condition resulting in a deadlock requiring the httpd server to be restarted after the first run
#!/usr/bin/env python
import hashlib
import hmac
import random
import sqlite3
import string
from base64 import b64encode
from itertools import izip, starmap
aleks-mariusz /
Last active March 18, 2017 18:04
this will download the geojson for ordinance survey's maps, parse it and create mobac-profiles for their explorer/landranger series of maps
#!/usr/bin/env python
import argparse
import itertools
import json
import math
import os
import re
import sys
import urllib2