Skip to content

Instantly share code, notes, and snippets.

@elblivion
elblivion / fastly-debug.sh
Created November 11, 2020 08:42
Dockerised headless Fastly-Debug
docker run --rm --shm-size=512m buildkite/puppeteer node -e "
require('puppeteer').launch({ args: ['--no-sandbox', '--disable-setuid-sandbox'] })
.then(browser => browser.newPage()
.then(page => page.goto('https://www.fastly-debug.com')
.then(() => page.waitFor(() => document.querySelector('#json').textContent))
.then(jsonEl => jsonEl.jsonValue())
.then(console.log)
.finally(() => page.close())
).finally(() => browser.close()),
err => console.log('Error fetching Fastly debug info', err)
@elblivion
elblivion / nginx-lua-prometheus
Created July 11, 2018 13:25
nginx-lua-prometheus
# HELP nginx_http_connections Number of HTTP connections
# TYPE nginx_http_connections gauge
nginx_http_connections{state="reading"} 0
nginx_http_connections{state="waiting"} 0
nginx_http_connections{state="writing"} 1
# HELP nginx_http_request_duration_seconds HTTP request latency
# TYPE nginx_http_request_duration_seconds histogram
nginx_http_request_duration_seconds_bucket{host="admin.joistio.com",le="00.005"} 1
nginx_http_request_duration_seconds_bucket{host="admin.joistio.com",le="00.010"} 1
nginx_http_request_duration_seconds_bucket{host="admin.joistio.com",le="00.020"} 1
@elblivion
elblivion / test.md
Last active October 23, 2017 19:16

test |

@elblivion
elblivion / README.md
Last active May 19, 2017 09:29
curl-based endpoint test

curl-based endpoint testing

Statistics on DNS resolution, connection and SSL negotiation time for HTTP(S) endpoints.

Requires:

  • curl
  • bash

How to use:

@elblivion
elblivion / broken
Last active May 18, 2017 11:43
test yamls
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: fluent-fwd
spec:
replicas: 1
template:
metadata:
labels:
app: fluent-fwd
@elblivion
elblivion / .git-completion.bash
Last active January 5, 2017 04:51
bash git stuff
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@elblivion
elblivion / Request through Incapsula
Created December 20, 2016 15:43
Response headers from api.contentful.com
< Access-Control-Allow-Headers: Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent
< Access-Control-Allow-Methods: DELETE,GET,HEAD,POST,PUT,OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Etag
< Access-Control-Max-Age: 1728000
< CF-Space-Id: chesnog1a2cb
< Content-Type: application/vnd.contentful.management.v1+json
< Date: Tue, 20 Dec 2016 15:43:00 GMT
< ETag: "77f45f1497a407aeda6b806e5482e3da"
< Server: Contentful
@elblivion
elblivion / curlformat
Last active March 29, 2018 07:44
curlformat
Timings:
DNS lookup: %{time_namelookup}
Connection: %{time_connect}
SSL negotiation: %{time_appconnect}
Total: %{time_total}
\n
#!/usr/bin/perl -w
# recover rsyslog disk queue index (.qi) from queue files (.nnnnnnnn).
#
# See:
# runtime/queue.c: qqueuePersist()
# runtime/queue.c: qqueueTryLoadPersistedInfo()
#
# kaiwang.chen@gmail.com 2012-03-14
#
use strict;