Skip to content

Instantly share code, notes, and snippets.

View Data5tream's full-sized avatar

Simon Barth Data5tream

View GitHub Profile
@Data5tream
Data5tream / reload_grafana_dashboard.js
Last active October 14, 2024 09:11
Automatically reloads grafana dashboards once an hour
// ==UserScript==
// @name Grafana dash autoreload
// @namespace https://github.com/Data5tream
// @version 0.2.0
// @description Reload grafana dashboards once an hour
// @author Simon Barth
// @match https://*.grafana.net/d/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=grafana.com
// @grant none
// ==/UserScript==
@Data5tream
Data5tream / normalize.min.css
Created November 6, 2017 22:05
normalize.css minified (v7.0.0)
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:0.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace, monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,
@Data5tream
Data5tream / IPAddressDetector
Last active November 6, 2017 22:09
Detect IP Address with Python
#!/usr/bin/env python
# Get correct IP here
def getPublicIP():
data = str(urlopen('http://checkip.dyndns.com/').read())
return re.compile(r'Address: (\d+\.\d+\.\d+\.\d+)').search(data).group(1)
def getLocalIP():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8",80))