Skip to content

Instantly share code, notes, and snippets.

@johnseekins
johnseekins / python-virtualenv.sh
Last active September 28, 2015 18:59
Completely independent python virtualenv with shared-library support.
#!/bin/bash
if [[ -z $1 ]]; then
echo "Missing operator for script"
exit 1
fi
if [[ ! -z $2 ]]; then
ENV_DIR=$2
else
@johnseekins
johnseekins / gist:7cc0ef14c5aa1d26c686
Created December 6, 2015 18:40
Exchange backup with no external tools
SET SQLCMDDIR=
SET SAGEDBBACKUPDIR=
SET CMDLOCATION=
SET BACKUPTARGET=
SET BACKUPDRIVE=
SET LOGLOCATION=
::Remove remote copy of Exchange Database
DEL /Q /S %BACKUPDRIVE%\ExchangeDatabase.edb > %LOGLOCATION%\ExchangeBackup.log
::Create VSS copy of D drive to copy running exchange
@johnseekins
johnseekins / b2_cleanup
Last active July 25, 2016 17:09
Clean up old versions of files on b2
#!/usr/bin/env python
import time
import argparse
from b2.account_info import SqliteAccountInfo
from b2.api import B2Api
from b2.cache import AuthInfoCache
NUM_DAYS = 2
def get_opts():
@johnseekins
johnseekins / windows-collector.ini
Created August 31, 2016 20:17
Simple Windows stats collector and Graphite forwarder
[General]
host=
port=2014
pod=PR
batch=15
pollinterval=60
[SystemCounters]
prefix=Infrastructure.servers.<POD>
hostname=1
@johnseekins
johnseekins / install_facetimehd_module_fedora25.sh
Last active February 10, 2017 17:41
Script to collect and compile the facetimehd kernel module on fedora 25 (with not quite functional module signing)
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
echo "Checking system dependencies..."
for dep in make openssl kernel-devel mokutil keyutils; do
dnf list installed $dep > /dev/null 2>&1
@johnseekins
johnseekins / py_gelf_listener.py
Last active April 13, 2017 15:56
python docker gelf listener
import json
import argparse
import gzip
import socket
import uuid
import scandir
import os
import yaml
from multiprocessing import Pool, cpu_count
try:
[root@ops-freeipa-devops-1 ec2-user]# ipa-server-install --mkhomedir -NU --ca-cert-file=/mnt/certs/rootCA.pem --dirsrv-cert-file=/mnt/certs/ops-freeipa-devops-1.dm.lan.pem --http-cert-file=/mnt/certs/ops-freeipa-devops-1.dm.lan.pem --no-pkinit --dirsrv-pin='' --http-pin='' -p <DS password> -a <admin password> -n DM.LAN -r DM.LAN
The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.
This includes:
* Create and configure an instance of Directory Server
* Create and configure a Kerberos Key Distribution Center (KDC)
@johnseekins
johnseekins / rebalance_brokers.sh
Last active January 17, 2019 20:23
Automatic Kafka Topic Re-balancing
#!/bin/bash
if [[ -z "${1}" ]]; then
THROTTLE=100000
else
THROTTLE="${1}"
fi
set -eou pipefail
KAFKABIN=${KAFKABIN:-/opt/kafka/bin}
[root@ops-freeipa-devops-1 jseekins]# certutil -L -d /etc/httpd/alias/
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
CN=Master,L=Bozeman,ST=Montana,C=US C,,
CN=ops-freeipa-devops-1.dm.lan,L=Bozeman,ST=Montana,C=US Cu,u,u
DM.LAN CT,C,C
[root@ops-freeipa-devops-1 jseekins]# ipa-certupdate
INFO requests: [uri:/user/error, duration:67, remoteUser:null, remoteHost:172.19.250.77, userAgent:Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0, authToken:form, method:GET, secure:https, contentType:null, project:?]
INFO requests: [uri:/user/error, duration:67, remoteUser:null, remoteHost:172.19.250.77, userAgent:Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0, authToken:form, method:GET, secure:https, contentType:null, project:?]
DEBUG MemoryPageFragmentCachingFilter: No cacheable annotation found for GET:/grails/user/login.dispatch [controller=user, action=login]
INFO requests: [uri:/user/login, duration:2, remoteUser:null, remoteHost:172.19.250.77, userAgent:Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0, authToken:form, method:GET, secure:https, contentType:null, project:?]
INFO requests: [uri:/user/login, duration:2, remoteUser:null, remoteHost:172.19.250.77, userAgent:Mozilla/5.0 (X11; Fedora; Linux x86_64; rv