Skip to content

Instantly share code, notes, and snippets.

Avatar
😬

Martin Rauscher Hades32

😬
View GitHub Profile
@Hades32
Hades32 / Dockerfile
Last active Jun 23, 2022
Fast SVG rendering with Go binding
View Dockerfile
FROM golang:1.18
RUN apt update && apt install -y librsvg2-dev && apt-get clean
WORKDIR /go/playground
COPY . .
RUN go build
@Hades32
Hades32 / 01-setup-system.network.sh
Created Apr 12, 2020
Grafana+Prometheus for home network monitoring
View 01-setup-system.network.sh
#!/bin/bash
docker network create mynet
useradd --system container-user
mkdir -p /data/prom/config/ /data/prom/data/ /data/grafana/data/ /data/meshping/redis/
chown -R container-user /data/prom/config/ /data/prom/data/ /data/grafana/data/ /data/meshping/redis/
@Hades32
Hades32 / fail.js
Created Jan 18, 2020
vodafone station endless loop
View fail.js
for(i=0 ; i<getdata['StaticNHostTable'].length ; i++) {
if(index != null) {
if(index == i) {
tt.find('span.inner-dropbox').text(getdata['StaticNHostTable'][i]['HostName']);
MAC = (getdata['StaticNHostTable'][i]['MAC']).split(":");
IP = (getdata['StaticNHostTable'][i]['IP']).split(".");
for(j=0; j<6; j++){
tt.find('.extra_mac_address'+(j+1)).text(MAC[j]);
}
@Hades32
Hades32 / kill.sh
Last active Apr 30, 2020
Instant k3s cluster on Scaleway
View kill.sh
#!/bin/bash
set -euo pipefail
server_name=$1
region=${2:-"par1"}
function fix_scw {
# there is currently a bug in scw that causes failures when (re)using servernames with '-' in it
rm ~/.scw-cache.db || true
}
@Hades32
Hades32 / main.go
Created Oct 19, 2019
Azure EventHub with Go experiment
View main.go
package main
// MIT License
//
// Copyright (c) Martin Rauscher. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@Hades32
Hades32 / JwtSecurityConfig.kt
Created Nov 12, 2018
Handling JWT Validation with only RSA X.509 Public Key
View JwtSecurityConfig.kt
package mn.max
import io.micronaut.context.annotation.Value
import io.micronaut.security.token.jwt.signature.rsa.RSASignatureConfiguration
import java.security.KeyFactory
import java.security.interfaces.RSAPublicKey
import java.security.spec.X509EncodedKeySpec
import java.util.*
import javax.inject.Named
import javax.inject.Singleton
@Hades32
Hades32 / fizzlefade.html
Last active Dec 30, 2017 — forked from edco/fizzlefade.html
add possibility to break (obvious) determinism
View fizzlefade.html
<!DOCTYPE html>
<html>
<head><title>Javascript RT</title></head>
<style>canvas {width: 1280px; height: 768px}</style>
<body>
<canvas id="framebuffer"></canvas>
<script type="text/javascript">
/* Fizzlefade using a Feistel network.
@Hades32
Hades32 / run.sh
Last active Aug 25, 2017
Start a docker container with environment variables for external port and IP
View run.sh
#!/bin/bash
#Start a docker container with environment variables for external port and IP
if [ -z $1 ]
then
echo pass in starting port
exit 1
fi
START_PORT=$1
@Hades32
Hades32 / elixir-npp.xml
Created Oct 14, 2014
Simple syntax highlighting for Elixir for Notepad++
View elixir-npp.xml
<NotepadPlus>
<UserLang name="Elixir" ext="ex exs" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="yes" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="yes" Keywords5="yes" Keywords6="yes" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00# 01 02 03/* 04*/</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
@Hades32
Hades32 / registry_test.exs
Created Sep 4, 2014
Problem with GenEvent.stream vs. GenEvent.add_handler
View registry_test.exs
defmodule KV.RegistryTest do
use ExUnit.Case, async: true
alias KV.Registry, as: Reg
# test helper module
defmodule Forwarder do
use GenEvent
def handle_event(event, parent) do
send parent, event