Skip to content

Instantly share code, notes, and snippets.

View moos3's full-sized avatar

Richard moos3

  • Boost Insurance
  • Maine, USA
  • X @moos3
View GitHub Profile
@moos3
moos3 / main.go
Last active March 27, 2019 14:38
on the fly image processing
package main
import (
"bytes"
"flag"
"fmt"
"image"
"image/draw"
"image/gif"
_ "image/jpeg"
package main
import (
"bufio"
"fmt"
"log"
"net/http"
"os"
"time"
### Keybase proof
I hereby claim:
* I am moos3 on github.
* I am moos3 (https://keybase.io/moos3) on keybase.
* I have a public key ASCQxVDKDXqWOH-h1Z3cZP2ZkqtDRocc2phEGUy2Vl8TGwo
To claim this, I am signing this object:
@moos3
moos3 / mysql-replication-stats.sh
Created December 14, 2016 04:48 — forked from edmorley/mysql-replication-stats.sh
MySQL replication catch-up stats script
#!/usr/bin/env bash
# Updated/fixed version of the script from:
# https://www.percona.com/blog/2012/08/29/heres-a-quick-way-to-foresee-if-replication-slave-is-ever-going-to-catch-up-and-when/
delay=60
echo -e "Stats will be output every ${delay}s...\n"
cmd="mysql -e 'show slave status\G' | awk '/Seconds_Behind_Master/ { print \$2 }'"
while sleep $delay; do
       +--------------------------+
       |                          |
       |      AWS VPC VPN         |
       |      172.16.0.0/16       |
       +------------------+---^---+
                          |   |
ping 10.10.0.0/26 Fail    |   | 172.16.0.0/16 ping ok
                          |   |
                          |   |                                                               +----------------------------------------+
import urllib3
import re
from flask import Flask, request, make_response, url_for
from flask.ext.cors import CORS
app = Flask(__name__)
app.config['IGNORE_REQUEST_HEADERS'] = ['content-length', 'host']
app.config['IGNORE_RESPONSE_HEADERS'] = ['connection', 'transfer-encoding',
'keep-alive', 'content-encoding']
cors = CORS(app)
#!/usr/bin/env bash
fn_distro(){
arch=$(uname -m)
kernel=$(uname -r)
if [ -f /etc/lsb-release ]; then
os=$(lsb_release -s -d)
installer='apt-get'
elif [ -f /etc/debian_version ]; then
os="Debian $(cat /etc/debian_version)"
installer='apt-get'
{
"type": "update",
"data": {
"queues": {
"csm": {
"agents": [
{
"id": "209",
"name": "User 1",
"status": "",
@moos3
moos3 / setup.sh
Last active August 29, 2015 14:23
#!/usr/bin/env bash
# Post this on a Curl that will be always reachable.
if [ -z "$ANTIDOTE_DB_USER" ]; then
echo "Missing \$ANTIDOTE_DB_USER"
exit 1
fi
if [ -z "$ANTIDOTE_DB_PORT" ]; then
echo "Missing \$ANTIDOTE_DB_PORT"
exit 1
[DEFAULT]
#
# Options defined in oslo.messaging
#
# Use durable queues in amqp. (boolean value)
# Deprecated group/name - [DEFAULT]/rabbit_durable_queues
#amqp_durable_queues=false
amqp_durable_queues=False