Skip to content

Instantly share code, notes, and snippets.

View fluential's full-sized avatar
💭
¯\_(ツ)_/¯

Mike fluential

💭
¯\_(ツ)_/¯
  • Earth
View GitHub Profile
@fluential
fluential / carbon-load-test-mcz.py
Last active August 29, 2015 14:06
Threaded carbon load tester
#!/usr/bin/env python
# The idea is to generate carbon load from multiple threads / connections to test load balanging feature of graphite / carbon cluster
import sys, os, time, thread, datetime
from socket import socket
from random import random, choice
try:
host = sys.argv[1]
port = int(sys.argv[2])
mpm = int(sys.argv[3])
innodb_buffer_pool_size=5M
innodb_log_buffer_size=256K
query_cache_size=0
max_connections=10
key_buffer_size=8
thread_cache_size=0
host_cache_size=0
innodb_ft_cache_size=1600000
innodb_ft_total_cache_size=32000000
@fluential
fluential / probe-clean.py
Last active November 23, 2015 21:44
async test
#!/usr/bin/env python
import sys, time
import pickle
import tornado
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
from tornado.ioloop import IOLoop
import itertools
from tornado.platform.caresresolver import CaresResolver
mkdir dev
cd dev
git clone git://github.com/Netflix/exhibitor.git
mkdir exhibitor-build
cd exhibitor-build
cp -rp ../exhibitor/gradle* .
#root@xxx:~/dev/exhibitor-build# ls
#gradle gradle.properties gradlew gradlew.bat
@fluential
fluential / gtk.css
Last active May 11, 2017 13:24
gnome-terminal-restyle
# This should go into ~/.config/gtk-3.0/gtk.css
@define-color bg-grey #222;
@define-color active-grey #333;
@define-color border-grey #555;
TerminalWindow .notebook {
border: 0;
padding: 0;
color: #eee;
@fluential
fluential / jenkins-material-theme.css
Created June 7, 2017 20:44
tqx-jenkins-material-theme
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,300);@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700,500,300);@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes b{0%{opacity:1}50%{opacity:0}to{opacity:1}}[src$="blue.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDA5Njg4IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}[src$="red.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjRjQ0MzM2IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtMmgydjJ6bTAtNGgtMlY3aDJ2NnoiLz48L3N2Zz4=)}[src$="yellow.png
@fluential
fluential / lambdaAMICleanup.py
Created March 10, 2018 07:57 — forked from bkozora/lambdaAMICleanup.py
AWS Lambda Function to Delete AMIs and Snapshots
# Automated AMI and Snapshot Deletion
#
# @author Robert Kozora <bobby@kozora.me>
#
# This script will search for all instances having a tag with "Backup" or "backup"
# on it. As soon as we have the instances list, we loop through each instance
# and reference the AMIs of that instance. We check that the latest daily backup
# succeeded then we store every image that's reached its DeleteOn tag's date for
# deletion. We then loop through the AMIs, deregister them and remove all the
# snapshots associated with that AMI.
@fluential
fluential / lambdaAMIBackups.py
Last active March 10, 2018 08:23 — forked from bkozora/lambdaAMIBackups.py
AWS Lambda AMI Backups
# Automated AMI Backups
#
# @author Robert Kozora <bobby@kozora.me>
#
# This script will search for all instances having a tag with "Backup" or "backup"
# on it. As soon as we have the instances list, we loop through each instance
# and create an AMI of it. Also, it will look for a "Retention" tag key which
# will be used as a retention policy number in days. If there is no tag with
# that name, it will use a 7 days default value for each AMI.
#
#!/usr/bin/perl -w
# recover rsyslog disk queue index (.qi) from queue files (.nnnnnnnn).
#
# See:
# runtime/queue.c: qqueuePersist()
# runtime/queue.c: qqueueTryLoadPersistedInfo()
#
# kaiwang.chen@gmail.com 2012-03-14
#
use strict;
@fluential
fluential / example.oscap.sh
Created May 16, 2018 12:53 — forked from gregelin/example.oscap.sh
OpenSCAP examples
echo "oscap xccdf eval --profile usgcb-rhel6-server"
oscap xccdf eval --profile usgcb-rhel6-server \
--results /var/www/govready-html/usgcb-rhel6-server.xml \
--report /var/www/govready-html/usgcb-rhel6-server.html \
--cpe /usr/share/xml/scap/ssg/content/ssg-rhel6-cpe-dictionary.xml \
/usr/share/xml/scap/ssg/content/ssg-rhel6-xccdf.xml ; true