Skip to content

Instantly share code, notes, and snippets.

View ktilcu's full-sized avatar

kyle tilman ktilcu

View GitHub Profile
@ktilcu
ktilcu / getADay.sh
Last active August 15, 2017 23:37
kyle-Snippet: Zgrep nginx logs from multiple load balancers
#!/bin/bash
set -e
YEARMONTH=$(date +%Y%m)
MONTH=$(date +%b)
TMP_FILE="tmp.log"
DESTINATION_FILE=""
while getopts d:m: opts; do
case ${opts} in
@ktilcu
ktilcu / docker.md
Last active August 15, 2017 20:55
kyle-Info: Docker Introduction

Docker

Wait what?

Docker is a new technology, on which, we are building some of our newer distributed systems and services. You may say to yourself, "Another new technology?" and the answer would be yes. I thought the same thing. Why adopt another new thing when we haven't finished flushing out the older thing. The hope is, that with enough buy-in this wouldn't be just the next thing. I want

@ktilcu
ktilcu / sensu_socket.php
Last active August 29, 2015 14:13
Script to display how to use php to send data to sensu
<?php
error_reporting(E_ALL);
/* The port for the sensu. */
$service_port = 3030;
/* Docker binds to localhost on staging */
$address = "127.0.0.1";
/* Create a TCP/IP socket. Can also use UDP if speed is a concern*/
@ktilcu
ktilcu / whiteboard.sh
Last active August 15, 2017 20:54
kyle-Snippet: Process pic of whiteboard
#!/bin/bash
# Usage ./whiteboard..sh path/to/picture path/to/new/better/picture
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
@ktilcu
ktilcu / kyle-Statsite, StatsD and Newlines.md
Last active August 15, 2017 20:13
kyle-Statsite, StatsD and Newlines

We recently started focusing on telemetry at work. Creating data to help drive good business decisions. Inasmuch, we are encouraging engineers to start instrumenting their code to test and utilize our stack. We decided on an App => Statsite => Graphite => Grafana flow for our metrics.

If you aren't aware, Statsite is a port of StatsD into C but using better and smarter algorithms for computing statistics. Both libraries listen on a port for simple strings to come through, aggregate the data and flush it to Graphite every so often.

@ktilcu
ktilcu / kyle-Mysteriously used disk space.md
Last active August 15, 2017 20:52
kyle-Experience: Mysteriously used disk space

Every Sysadmin has gotten the call before...

^ logs full again, the fix didn't work :\

I'm obviously not immune to servers with full disks. So, I log in a run df sure enough... disk is full. This has happened numerous times on this server. The daemon running on it produces an obscene amount of logs and the disk only has 25G. So each time we just log in and delete the logs.

@ktilcu
ktilcu / aws-ssl-termination-digicert.md
Last active October 19, 2015 21:25 — forked from marcuswestin/aws-ssl-termination-digicert.md
How to set up an AWS SSL terminating Elastic Load Balancer with a Digicert certificate

1: Generate CSR

openssl req -new -newkey rsa:2048 -nodes -keyout server-cert.key -out server-cert-sign-req.csr

# Country Name (2 letter code) [AU]:US
# State or Province Name (full name) [Some-State]:California
# Locality Name (eg, city) []:
# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Flutterby Labs, Inc.
# Organizational Unit Name (eg, section) []:
# Common Name (eg, YOUR name) []:www.dogo.co

Keybase proof

I hereby claim:

  • I am ktilcu on github.
  • I am tilman (https://keybase.io/tilman) on keybase.
  • I have a public key whose fingerprint is 5C3B 88BD 379C 445D 786A 3C23 BA92 51DB 0C2C 1AF9

To claim this, I am signing this object:

@ktilcu
ktilcu / Functional-Programming.md
Last active December 10, 2015 16:15
Functional programming is actually good for javascript developers

Rules

  • no side effects (function can't rely on anything not provided to it)
  • inputs and outputs

In Practice

  • Nested functions are always an indication of complexity

Creates Functions that are

  • Easy to read
  • Easy to reuse
@ktilcu
ktilcu / textImageProcessor.sh
Last active August 15, 2017 20:49
kyle-Snippet: Colorize PNG of text and quantize
#!/bin/bash
set -o pipefail -o errexit -o noglob -o nounset
function usage() {
cat <<EOUSAGE
Usage: textImageProcessor [OPTIONS] ...
Colorizes and/or optimizes rasterized text.
OPTION DESCRIPTION
========== ==================================================================