Skip to content

Instantly share code, notes, and snippets.

View ryanschwartz's full-sized avatar

Ryan Schwartz ryanschwartz

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ryanschwartz on github.
  • I am rts (https://keybase.io/rts) on keybase.
  • I have a public key whose fingerprint is C8B1 553F 0345 06CC EA97 A7F9 C156 785A FF25 B324

To claim this, I am signing this object:

@ryanschwartz
ryanschwartz / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ryanschwartz
ryanschwartz / gist:a832d63f479c452e29db
Created November 2, 2015 15:43
openssl negotiation f5 vs f5-staging.vitalsource.com
Last login: Mon Nov 2 09:19:08 on ttys000
✓ ( 09:41:40 ) ⦿ ryan@juniper
▶︎ ~ ▶︎ echo | openssl s_client -connect f5.vitalsource.com:443
CONNECTED(00000003)
depth=1 /C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/C=US/ST=California/L=San Mateo/O=Vital Source Technologies, Inc./CN=*.vitalsource.com
@ryanschwartz
ryanschwartz / mysql_snapback.py.diff
Created November 6, 2015 15:44
Diff of things I added to mysql_snapback (-q for silent running, -t for formatting time_snapshot)
--- datap02 2015-11-06 15:28:07.800529694 +0000
+++ mysql_snapback.py 2014-02-07 18:42:31.103289360 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/opt/local/bin/python
####################################################################
# FILENAME: mysql_snapback.py
# PROJECT: Miscellaneous Tools
@@ -51,10 +51,14 @@
@ryanschwartz
ryanschwartz / mysql-autosnapper.sh
Created November 6, 2015 15:52
wrapper for zfs snapshot + mysql_snapback.py, cribbed from http://letsgetdugg.com/2010/03/30/automated-zfs-snapshots/
#!/bin/bash
# sample crontab configuration
# # "frequent" snapshots, one every 15 minutes, keep 4
# 0,15,30,45 * * * * /opt/src/autosnapper.sh pool/home frequently 4
# # hourly snapshots, once an hour, keep 24 hours
# 0 * * * * /opt/src/autosnapper.sh pool/home hourly 24
# # daily snapshots, keep 7 days
# 0 0 * * * /opt/src/autosnapper.sh pool/home daily 7
# # weekly snapshots, keep 4 weeks
[zion:/var/www/sites/doesfollow.com/current] root# cat config.ru
require 'rubygems'
require 'sinatra'
#require 'newrelic_rpm'
require 'redis'
require 'resque'
set :environment, ENV['RACK_ENV'].to_sym
disable :run, :reload
@ryanschwartz
ryanschwartz / 1. Defined RC
Created May 19, 2016 03:09
kubectl expose not creating correct ports
✓ ( 22:04:47 ) ⦿ ryan@juniper
▶︎ ~ ▶︎ kg rc vpn -o yaml
apiVersion: v1
kind: ReplicationController
metadata:
creationTimestamp: 2016-05-19T02:27:08Z
generation: 2
labels:
app: vpn
name: vpn
--- ProxySQL_GloVars.cpp
+++ ProxySQL_GloVars.cpp.new
@@ -16,6 +16,7 @@
#ifdef DEBUG
// malloc_stats_print(NULL, NULL, "");
#endif
+#ifdef __GLIBC__
void *arr[20];
size_t s;
@ryanschwartz
ryanschwartz / -
Created September 22, 2016 18:49
test
@ryanschwartz
ryanschwartz / create-multi-region-l7-lb.sh
Created October 3, 2016 23:44
Creates a http/https load balancer in GCE using provided parameters
#! /bin/bash
# sourced from https://gist.github.com/bprashanth/3827059fc46cba4ffbe1651ee3e9a78f#gistcomment-1828832
show_usage() {
echo ""
echo -e "Usage: $0 balancer-name \"ig1,ig1_zone;ig2,ig2_zone[;ig3...]\" project static-ip hc-path port certname"
echo ""
echo "List manage instance groups: gcloud compute instance-groups managed list"
echo "List project global IPs: gcloud compute addresses list --global --project $PROJECT"
echo "Reserve a new IP: gcloud compute addresses create <name> --global --project $PROJECT"