Skip to content

Instantly share code, notes, and snippets.

@ssp
ssp / README.md
Last active May 22, 2023 21:40
senec-to-influx

Senec to Influx

Extract values from Senec JSON with string-hex-floats and push them to InfluxDB

Run example

SENEC_URL=http://senec.local/lala.cgi INFLUX_URL=https://influx.yourserver.net/ INFLUX_ORG=your_org INFLUX_TOKEN=your_token ./senec-to-influx.py
@ssp
ssp / output.js
Created September 21, 2021 23:47
Brute force solution to a quiz-formula given by symbols
{ a: 7, b: 2, c: 5, d: 4, e: 1, f: 3, g: 8, h: 6 }
@ssp
ssp / commands.sh
Last active November 28, 2018 22:20
# alle Dateien, deren Name auf _B endet …
find . -name "*_B" -print0 | xargs -0 ./reduce.py > processed.csv
# erster Versuch mit Pipes
cat 20181011_06-04-51_B \
| awk 'NR == 1 || NR == 2 || NR % 100 == 0' \
| sed -e 's/ \+/ /g' \
| cut -d ' ' -f 1-10 \
@ssp
ssp / ParseURIs.java
Last active November 18, 2016 22:26
Dauert das Parsen von URIs lange?
package net.earthlingsoft.uritest;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
@ssp
ssp / clone-and-build-gitx.sh
Last active November 1, 2016 15:00
Script to clone and build gitx
#!/usr/bin/env sh
#
# Script to clone gitx from github and build it using
# the scripts provided by the project.
#
# Sven-S. Porst @ssp <ssp-web@earthlingsoft.net>
#
git clone https://github.com/ssp/gitx.git
cd gitx
@ssp
ssp / Wikidata.sparql
Last active May 26, 2016 21:40
Colours from Wikidata/dbpedia
SELECT ?color ?label (lang(?label) AS ?language) ?rgb WHERE {
?color wdt:P31/wdt:P279* wd:Q1075. # instance or subclass of »colour«
?color wdt:P465 ?rgb. # store sRGB value in ?rgb
?color rdfs:label ?label. # store label in ?label
FILTER (lang(?label)="de" || lang(?label) = "en" || lang(?label) = "fr" || lang(?label) = "tr")
}
ORDER BY ASC(?rgb)
@ssp
ssp / check-codesign-running.sh
Last active April 19, 2016 20:21
One-liner to check all running processes on Mac OS X with codesign.
#!/usr/bin/env sh
ps aux | cut -b 16-22 | sed -e "s/\s*//" | grep -v PID | sort -n | xargs -n 1 -IA sh -c "codesign --verify --deep A"
👒
👀
🐽
👅
👕
👖
@ssp
ssp / iterate-dom.js
Last active August 29, 2015 14:10
Iterates the DOM and logs tag names, classes and id to the console
iterate = function (e, level) {
var message = '';
e.children().each( function() {
var logString = '';
for (var i = 0; i < level; i++) { logString += '>'; }
logString += this.nodeName + ' ';
if (this.id) { logString+= '#' + this.id + ' '; }
if (typeof this.className === 'string') { logString += '.' + this.className.split(' ').join(' .'); }
message += logString + "\n";
message += iterate($(this), level + 1);

Keybase proof

I hereby claim:

  • I am ssp on github.
  • I am ssp (https://keybase.io/ssp) on keybase.
  • I have a public key whose fingerprint is 73B2 8281 F366 912E 7DF8 D918 93D7 2D60 0085 ABA3

To claim this, I am signing this object: