This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Require PyJwt, AIOHTTP and PyCrypto (for RS256 in JWT) | |
import jwt | |
import time | |
import json | |
from pprint import pprint | |
import aiohttp | |
import asyncio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bottle import route, run, response, request | |
import datetime | |
import json | |
import requests | |
# Cache middleware | |
def cache(callback, ttl=datetime.timedelta(hours=1)): | |
cache = {} | |
def wrapper(*args, **kwargs): | |
key = request.path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import asyncio | |
from urllib.parse import urlsplit | |
async def get(url): | |
url = urlsplit(url) | |
hostname = url.hostname | |
if url.scheme == 'https': | |
port = url.port or 443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=/etc/rc.local Compatibility | |
Documentation=man:systemd-rc-local-generator(8) | |
ConditionFileIsExecutable=/etc/rc.local | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/etc/rc.local start | |
ExecStop=/etc/rc.local stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def glip(java.util.LinkedHashMap params) { | |
def payload = [ | |
activity: params.activity, | |
title: params.title, | |
icon: params.icon, | |
body: params.body | |
] | |
httpRequest( | |
acceptType: 'APPLICATION_JSON', | |
contentType: 'APPLICATION_JSON', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
HOST="http://grafana.local:3000" | |
mkdir dashboards && \ | |
for dashboard in $(wget -qO- "$HOST/api/search?query=&" | jq -r .[].uri); do | |
wget -qO- "$HOST/api/dashboards/$dashboard" | jq -r '.dashboard | del(.uid)' > dashboards/"$(basename "$dashboard")".json | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Scheme] | |
Name=Monokai (dark) | |
TabActivityColor=#a6a6e2e22e2e | |
ColorCursor=#f8f8f8f8f2f2 | |
ColorForeground=#f8f8f8f8f2f2 | |
ColorBackground=#272728282222 | |
ColorPalette=#272728282222;#f9f926267272;#a6a6e2e22e2e;#f4f4bfbf7575;#6666d9d9efef;#aeae8181ffff;#a1a1efefe4e4;#f8f8f8f8f2f2;#757571715e5e;#f9f926267272;#a6a6e2e22e2e;#f4f4bfbf7575;#6666d9d9efef;#aeae8181ffff;#a1a1efefe4e4;#f9f9f8f8f5f5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{/* | |
Convert labels to string like: key1="value1", key2="value2", ... | |
*/}} | |
{{- define "chart.external_labels" -}} | |
{{- $list := list -}} | |
{{- range $k, $v := .Values.external_labels -}} | |
{{- $list = append $list (printf "%s=\"%s\"" $k $v) -}} | |
{{- end -}} | |
{{ join ", " $list }} | |
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copy the following into Preferences > Key Bindings -- User | |
// Thanks to: | |
// http://sublimetext.userecho.com/topic/86166-backtick-quoting-selected-text-does-not-work-like-single-quotes-and-double-quotes/ | |
[ | |
{ | |
"keys": [ | |
"`" | |
], | |
"command": "insert_snippet", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"shell_cmd": "gofmt -w \"$file\" && go run \"$file\"", | |
"selector": "source.go", | |
"file_regex": "go$" | |
} |
OlderNewer