Skip to content

Instantly share code, notes, and snippets.

Avatar

Carl Danley carldanley

View GitHub Profile
View disk-tests.sh
=============================================================================================================================================
BEFORE
=============================================================================================================================================
root@k8s-master-01:/home/carldanley# fio --rw=write --ioengine=sync --fdatasync=1 --directory=test-data --size=22m --bs=2300 --name=mytest
mytest: (g=0): rw=write, bs=(R) 2300B-2300B, (W) 2300B-2300B, (T) 2300B-2300B, ioengine=sync, iodepth=1
fio-3.1
Starting 1 process
mytest: Laying out IO file (1 file / 22MiB)
View f5-proxy-protocol.txt
when CLIENT_ACCEPTED {
set proxyheader "PROXY TCP[IP::version] [IP::remote_addr] [IP::local_addr] [TCP::remote_port] [TCP::local_port]\r\n"
}
when SERVER_CONNECTED {
TCP::respond $proxyheader
}
@carldanley
carldanley / ingress.yaml
Last active Jul 31, 2018
Intro to Kubernetes Ingress - July 31, 2018
View ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: hello-world
namespace: sfkm
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
labels:
app: hello-world
View migrations-001.js
// external dependencies
const bPromise = require('bluebird');
// logic
exports.up = function(db, types) {
return db.sequelize.transaction(bPromise.coroutine(function* (t) {
yield db.createTable('listings', {
id: {
@carldanley
carldanley / configs.txt
Created Apr 16, 2017
k8s authentication & authorization webhooks
View configs.txt
clusters:
- name: tbxaccounts
cluster:
server: https://some.auth.service/webhook-authn?cluster=kube-prod
users:
- name: apiserver
current-context: webhook
contexts:
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
ANSIBLE_PATH = '.' # path targeting Ansible directory (relative to Vagrantfile)
# Set Ansible roles_path relative to Ansible directory
ENV['ANSIBLE_ROLES_PATH'] = File.join(ANSIBLE_PATH, 'vendor', 'roles')
@carldanley
carldanley / bash.sh
Last active Aug 29, 2015
SSH Agent Scripts
View bash.sh
# adds all keys in the ~/.ssh folder
function add_ssh_keys {
for i in `find ~/.ssh -name '*.pub' | sed 's/.\{4\}$//'`;
do ssh-add $i;
done
}
SSH_ENV=$HOME/.ssh/environment
function start_agent {
@carldanley
carldanley / bookmarklet.js
Last active Apr 29, 2016
JSConf 2014 Schedule Bookmarker
View bookmarklet.js
( function() {
function highlightSchedule( tableIndex, scheduleValues ) {
var tables = document.querySelectorAll( 'table.schedule' );
if( tableIndex >= tables.length ) {
return;
}
var table = tables[ tableIndex ];
var rows = table.querySelectorAll( 'tr' );
for( var i = 0, len = scheduleValues.length; i < len; i++ ) {
@carldanley
carldanley / wp-modules.js
Last active Dec 22, 2015
Example of WP modules object
View wp-modules.js
// new modules object introduction
( function( window, undefined ) {
window.wp = window.wp || {};
window.wp.modules = window.wp.modules || {};
} )( window );
// example Mediator module
wp.modules.Mediator = ( function( window, undefined ) {
View .jshintignore
// --------------------------------------------------------------------
// WordPress JSHint Ignored
// --------------------------------------------------------------------
wp-admin/js/farbtastic.js
wp-admin/js/iris.min.js
wp-includes/js/crop/*
wp-includes/js/imgareaselect/*
wp-includes/js/jcrop/*
wp-includes/js/jquery/*
wp-includes/js/mediaelement/*