Skip to content

Instantly share code, notes, and snippets.

@ugurengin
ugurengin / gen_inckey.py
Created December 6, 2017 16:00
Generate SHA1 INCKey
import hashlib
from optparse import OptionParser
# Generate unique incident key for Openduty
def get_opt():
parser = OptionParser()
parser.add_option("-H", dest="host_name")
parser.add_option("-D", dest="service_desc")
(options, args) = parser.parse_args()
# Please see http://dev.maxmind.com/geoip/geoipupdate/ for instructions
# on setting up geoipupdate, including information on how to download a
# pre-filled GeoIP.conf file.
# Enter your user ID and license key below. These are available from
# https://www.maxmind.com/en/my_license_key
UserId <user_id>
LicenseKey <license_key>
# Enter the product IDs of the databases you would like to update.
@ugurengin
ugurengin / README.md
Last active January 26, 2017 15:01 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

# Record Events that Modify the System's Discretionary Access Controls
-a always,exit -F arch=b64 -S chown -F auid>=500 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S fchmod -F auid>=500 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S fchown -F auid>=500 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S fchownat -F auid>=500 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S fsetxattr -F auid>=500 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S removexattr -F auid>=500 -F auid!=4294967295 -k perm_mod
#!/bin/sh
# VoltDB Cluster TPS Check
export PATH=$PATH:/usr/share/voltdb/tools/
volt1=xxxx.compute-1.amazonaws.com
volt2=xxxx.compute-1.amazonaws.com
volt3=xxxx.compute-1.amazonaws.com
latencylogger $volt1 21211 1 | head -n 4|sed -n 4p|awk {'print $3'}|tr -d ',','tps' >> x &
latencylogger $volt2 21211 1 | head -n 4|sed -n 4p|awk {'print $3'}|tr -d ',','tps' >> x &