Skip to content

Instantly share code, notes, and snippets.

View vvuksan's full-sized avatar

Vladimir Vuksan vvuksan

View GitHub Profile
@vvuksan
vvuksan / gist:3100171
Created July 12, 2012 19:03
JMX collection using command line JMX client
#!/bin/bash
if [ $# -ne 3 ]; then
echo "You need to supply both JMX host and port and metric. Exiting ..."
exit 1
fi
JAVA_BIN="/usr/bin/java"
JMX_CMDLINE="/opt/ganglia/cmdline-jmxclient-0.10.3.jar"
GMETRIC_BIN="/usr/bin/gmetric -d 180"
@vvuksan
vvuksan / gist:7f60f5552c2b96f39b16
Created December 27, 2014 16:21
Packet loss to Digital Ocean JFK
$ mtr -c 20 -r -w -z x.x.x.x
Start: Sat Dec 27 11:19:47 2014
HOST: xxxxxx Loss% Snt Last Avg Best Wrst StDev
<snip>
3. AS11426 gig10-0-0-424.rlghnca-rtr2.nc.rr.com 0.0% 20 19.2 25.6 10.6 73.2 13.1
4. AS11426 cpe-024-025-062-150.ec.res.rr.com 0.0% 20 14.2 14.3 10.8 36.4 5.3
5. AS11426 be31.chrcnctr01r.southeast.rr.com 0.0% 20 16.7 20.6 16.7 23.5 1.8
6. AS7843 bu-ether34.atlngamq46w-bcr00.tbone.rr.com 0.0% 20 28.5 24.7 20.6 33.9 3.6
7. AS7843 bu-ether21.atlngamq47w-bcr01.tbone.rr.com 0.0% 20 27.6 25.7 22.2 32.8 3.0
8. AS7843 107.14.17.190 0.0% 20 25.0 24.0 20.1 61.9 9.0
@vvuksan
vvuksan / deliver.vcl
Last active September 10, 2018 17:55
EZ Publish VCL snippets
# Stale object handling
if (resp.status >= 500 && resp.status < 600) {
/* restart if the stale object is available */
if (stale.exists) {
restart;
}
}
// On receiving the hash response, copy the hash header to the original
// request and restart.
if (req.restarts == 0
@vvuksan
vvuksan / README.md
Created December 22, 2017 00:53
Dictionary creation

To make it work correctly all these environment variables need to be set

export SERVICE_ID=XXXXX
export API_KEY="XXXX"
export VERSION="XXXXX"

Create a dictionary

sub aws4_lambda_sign_request {
# Declare local variables we'll need
declare local var.date_stamp STRING;
declare local var.string_to_sign STRING;
declare local var.canonical_request STRING;
declare local var.credential_scope STRING;
declare local var.request_parameters STRING;
declare local var.canonical_querystring STRING;
declare local var.canonical_headers STRING;
sub vcl_recv {
#FASTLY recv
# If geo_override header is supplied use that instead of built in geoip library. For testing.
if ( req.http.geo_override ) {
set req.http.X-Geo-Country = req.http.geo_override;
} else {
set req.http.X-Geo-Country = geoip.country_code;
}
@vvuksan
vvuksan / README
Created August 16, 2011 22:01
LXC (Linux Containers Installation)
This works under Ubuntu 10.10. I tried under 10.04 LTS but the Ubuntu templates are not there. Investigating.
[ Leaving this link here for reference in case I need to do apt-get upgrade. @ohloh recommends it
http://sourceforge.net/mailarchive/message.php?msg_id=26885493 ]
To make things easy have libvirt installed ie.
sudo apt-get install libvirt-bin
Otherwise you will need to set up bridges, iptables, dnsmasq.
@vvuksan
vvuksan / gist:6002154
Created July 15, 2013 18:18
Code Anywhere random errors
$ curl -v http://www.codeanywhere.net
* About to connect() to www.codeanywhere.net port 80 (#0)
* Trying 168.61.33.86...
* Connected to www.codeanywhere.net (168.61.33.86) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.codeanywhere.net
> Accept: */*
>
< HTTP/1.1 200 OK
@vvuksan
vvuksan / gist:4425024
Last active December 10, 2015 10:59
time.apple.com NYE 2013 issues
# date
Tue Jan 1 02:46:29 UTC 2013
# ntpdate -q time.apple.com
server 17.171.4.13, stratum 16, offset -0.994684, delay 0.03630
server 17.151.16.22, stratum 16, offset -0.994590, delay 0.10086
server 17.151.16.21, stratum 16, offset -0.995015, delay 0.10132
server 17.151.16.20, stratum 15, offset -0.995329, delay 0.10136
server 17.151.16.23, stratum 15, offset -0.995040, delay 0.10164
server 17.171.4.33, stratum 15, offset -0.994484, delay 0.03622
server 17.171.4.34, stratum 16, offset -0.994793, delay 0.03615
@vvuksan
vvuksan / gist:0e1b59727a7fbcd0733d
Created October 14, 2015 15:44
Monitorama requirements according to @obfuscurity
accommodates 250-500 theater style
budget $5k/day (USD)
breakout space for workshops
exhibitor space
casual / hangout spaces
option to outsource catering
travel accessibility
in-house A/V equipment
in-house A/V staff
internet access