Skip to content

Instantly share code, notes, and snippets.

@V3ckt0r
V3ckt0r / webserver.json
Created June 25, 2016 15:25
Serviced service template
{
"ID": "",
"Name": "Python-Web-Server",
"Description": "Python Web Server",
"Services": [
{
"Name": "Python Web Server",
"Command": "",
"Description": "Python Web Server",
"Tags": null,

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@V3ckt0r
V3ckt0r / gist:a3cad7b13bef89d6b6b7150c25fd93ed
Created October 13, 2017 11:34
net_data prometheus metric names
# COMMENT netdata "pal0113.back.stage.cwwtf.local" to prometheus "172.23.66.241", source "average", last seen 8 seconds ago, time range 1507892792 to 1507892800
# COMMENT homogeneus chart "disk_qops.vg01_data", context "disk.qops", family "/data", units "operations"
# COMMENT netdata_disk_qops_operations_average: dimension "operations", value is operations, gauge, dt 1507892790 to 1507892797 inclusive
netdata_disk_qops_operations_average{chart="disk_qops.vg01_data",family="/data",dimension="operations"} 0.0000000 1507892797000
# COMMENT homogeneus chart "disk_qops.sdb", context "disk.qops", family "sdb", units "operations"
# COMMENT netdata_disk_qops_operations_average: dimension "operations", value is operations, gauge, dt 1507892790 to 1507892797 inclusive
netdata_disk_qops_operations_average{chart="disk_qops.sdb",family="sdb",dimension="operations"} 0.0000000 1507892797000
@V3ckt0r
V3ckt0r / serviced-proxy-log
Created November 8, 2017 16:03
Gap in requests between 15:44 and 15:56
132.185.161.101 - - [08/Nov/2017:15:44:02 +0000] "POST /zport/dmd/Events/evconsole_router HTTP/2.0" 200 13682 "https://zenoss-a.tools.bbc.co.uk/zport/dmd/Events/evconsole" "tag=nginx" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
132.185.160.121 - - [08/Nov/2017:15:44:05 +0000] "POST /zport/dmd/Events/evconsole_router HTTP/2.0" 200 13990 "https://zenoss-a.tools.bbc.co.uk/zport/dmd/Events/evconsole" "tag=nginx" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:56.0) Gecko/20100101 Firefox/56.0" "-"
132.185.161.120 - - [08/Nov/2017:15:44:05 +0000] "POST /zport/dmd/jobs_router HTTP/2.0" 200 1280 "https://zenoss-a.tools.bbc.co.uk/zport/dmd/itinfrastructure" "tag=nginx" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:56.0) Gecko/20100101 Firefox/56.0" "-"
132.185.161.101 - - [08/Nov/2017:15:44:07 +0000] "POST /zport/dmd/Events/evconsole_router HTTP/2.0" 200 13682 "https://zenoss-a.tools.bbc.co.uk/zport/dmd/Events/evconsole" "tag=nginx" "Mozilla/5.0 (Macintosh; Intel Mac
@V3ckt0r
V3ckt0r / example
Last active November 15, 2017 17:39
Negroni with Prometheus
====server.go file====
func NewHandler() http.Handler {
mux := http.NewServeMux()
mux.Handle("/v1/", v1.NewHandler())
mux.Handle("/ping", HandlePing())
mux.Handle("/", HandlePing())
mux.Handle("/metrics", prometheus.HandlePrometheusMetrics())
return mux
}
@V3ckt0r
V3ckt0r / script.js
Created January 17, 2018 16:14
k6 test
import http from "k6/http";
import { sleep } from "k6";
export let options = {
vus: 10,
duration: "30s"
};
export default function() {
http.get("http://test.loadimpact.com");
@V3ckt0r
V3ckt0r / metrics.txt
Created February 21, 2018 16:34
Kubernetes 1.8 prometheus metrics
# HELP APIServiceOpenAPIAggregationControllerQueue1_adds Total number of adds handled by workqueue: APIServiceOpenAPIAggregationControllerQueue1
# TYPE APIServiceOpenAPIAggregationControllerQueue1_adds counter
APIServiceOpenAPIAggregationControllerQueue1_adds 0
# HELP APIServiceOpenAPIAggregationControllerQueue1_depth Current depth of workqueue: APIServiceOpenAPIAggregationControllerQueue1
# TYPE APIServiceOpenAPIAggregationControllerQueue1_depth gauge
APIServiceOpenAPIAggregationControllerQueue1_depth 0
# HELP APIServiceOpenAPIAggregationControllerQueue1_queue_latency How long an item stays in workqueueAPIServiceOpenAPIAggregationControllerQueue1 before being requested.
# TYPE APIServiceOpenAPIAggregationControllerQueue1_queue_latency summary
APIServiceOpenAPIAggregationControllerQueue1_queue_latency{quantile="0.5"} NaN
APIServiceOpenAPIAggregationControllerQueue1_queue_latency{quantile="0.9"} NaN
---
apiVersion: v1
kind: Namespace
metadata:
name: flux
---
apiVersion: extensions/v1beta1 #apps/v1
kind: Deployment
metadata:
name: flux