Skip to content

Instantly share code, notes, and snippets.

View ogarrett's full-sized avatar

Owen Garrett ogarrett

View GitHub Profile
@ogarrett
ogarrett / README.md
Last active February 4, 2021 11:59
NGINX Plus Health Check - mark node as unhealthy if bandwidth utilisation exceeds threshhold

Overview

Requirement is for NGINX Plus to back off and stop sending new connections to an upstream node if the network utilization for that node exceeds a given threshhold.

Strategy

Create a simple HTTP-accessible script that runs on each upstream node. Script returns 200 OK (HTTP status code) if node is not overloaded, and 503 Too Busy if node is overloaded.

@ogarrett
ogarrett / convert.pl
Created December 23, 2015 15:28
Convert GeoIPv2 to GeoIPv1
#!/usr/bin/perl -w
use strict;
use warnings FATAL => 'all';
use Text::CSV;
# ./convert.pl GeoLite2-City-CSV_20151201/GeoLite2-City-Locations-en.csv GeoLite2-City-CSV_20151201/GeoLite2-City-Blocks-IPv4.csv
my ( $locfile, $blocksfile ) = @ARGV;
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Long;
sub uri_escape( $ );
# Default country code to add to phone numbers that start with
# a 0 so the SMS gateway will accept them.
@ogarrett
ogarrett / iprewrite.c
Created May 9, 2013 10:40
iPlanet/SunONE/SunJavaSystem module to update internal record of connection source IP address to match value of X-Cluster-Client-IP header from Stingray Traffic Manager
/*---------------------------------------------------------------------
*
* Copyright (c) 2005 Zeus Technology
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@ogarrett
ogarrett / README.md
Created April 25, 2013 14:06
libHMAC: TrafficScript library to calculate HMAC hashes

This Riverbed TrafficScript library implements the HMAC/SHA1 and HMAC/MD5 calculations.

For more details and usage instructions, check out https://splash.riverbed.com/docs/DOC-1610

Tags: #Stingray #TrafficScript #HMAC #splash.riverbed.com

@ogarrett
ogarrett / README.md
Created April 25, 2013 14:00
libTable: TrafficScript libraries to manage on-disk tables of data

These Riverbed TrafficScript libraries implements a means to efficiently search tables of data stored as files in the Resource directory (conf/extra) of Stingray Traffic Manager

For more details and usage instructions, check out https://splash.riverbed.com/docs/DOC-1618

Tags: #Stingray #TrafficScript #splash.riverbed.com

@ogarrett
ogarrett / README.md
Last active June 26, 2020 16:16
WebSockets TrafficScript library

This Riverbed TrafficScript library implements support for identification and modification of WebSockets traffic in Stingray Traffic Manager.

For more details and usage instructions, check out https://splash.riverbed.com/docs/DOC-1451

Tags: #Stingray #TrafficScript #WebSockets #splash.riverbed.com