Skip to content

Instantly share code, notes, and snippets.

@jomat
jomat / Mikroelektronik im Sozialismus
Created February 20, 2022 11:13
Mikroelektronik im Sozialismus · Für das Wohl des Volkes ·
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●◒●◓●●●●●○●◓○●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●◐●●●●●◐●○●○●○●●●●●●●●○●◓●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●◓◓◑●●◑◓○○◓○◓◓○●◓●●○◑○◐○◓◑●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●○●○◑○○●◑○○○○○●○○◑○○○◓○◓◓●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●◑●●●◓●◒◑◐○○◒●●○●●○○○○○○○○○○○○○◑●○●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●◓●●○○◓○◓◒●●●●◓●◓○○○○○○○●◐○○○○○●○○◑●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●◐◑◐○◑●●◒◐◓○○○○○○○○○○○○○○○◑◒○○○◓●◒◒◑●●●●●●●●●●●●●
{
"name": "ThomCat Black",
"is_dark": true,
"colors": {
"accent-color": "#cc7b19",
"primary-color": "#9F8652",
"warning-color": "#f9c003",
"sidebar-color": "#000000",
"roomlist-background-color": "#191919",
"roomlist-text-color": "#cc7b19",
@jomat
jomat / matrix.conf
Created June 25, 2021 10:22
matrix_send
#!/bin/zsh
. /usr/lib/zabbix/etc/matrix.conf
RECEIVER="$1"
SUBJECT="$2"
MESSAGE="$3"
SEVERITY=0
if $(echo "$MESSAGE"|jq . >/dev/null 2>/dev/null)
#!/usr/bin/env python3
import requests
from requests.compat import urljoin
AS_TOKEN = "redacted"
HS_BASE = "https://darkfasel.net"
ROOMS = [
"!someroomid:darkfasel.net"
]
@jomat
jomat / update_riot.sh
Last active June 22, 2019 11:16
Script to check latest riot-web release and update it
#!/bin/zsh
# This script assumes you have a symlinked riot installation, eg
# /var/www/html/riot -> /var/www/html/riot-v0.11.4
#
# If the local version is older than the github version, it
# downloads the latest release, extracts it, copies
# config.json and home.html from old to new, removes
# the old symlink and sets a new one
###
# Copyright (c) 2016, Johannes Matheis
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
#!/bin/bash
user=
pass=
url=
echo $*
case $1
in
@jomat
jomat / alpine_chroot.sh
Created October 5, 2016 11:02
Creates an alpine linux chroot
#!/bin/sh
set -xeu
arch=x86_64
base_dir=/data/opt/alpine
work_dir=${base_dir}/work-${arch}
chroot_dir=${base_dir}/edge-${arch}
version=2.6.7-r1
mirror=http://dl-2.alpinelinux.org/alpine/
@jomat
jomat / sslarm
Last active April 28, 2016 22:41
#!/bin/zsh
function retr_cert_base64() {
fields=(${(s: :)1})
host=$fields[1]
port=$fields[2]
sni=$fields[3]
proto=$fields[4]
[ -z "$sni" ] && servername=$host || servername=$sni
[ -n "$proto" ] && starttls="-starttls $proto"
@jomat
jomat / 420
Last active February 21, 2018 12:14
#! /usr/bin/env python
import pytz, datetime
now_utc = datetime.datetime.utcnow()
now_utc = pytz.utc.localize(now_utc)
for tzstring in pytz.all_timezones:
local_tz = pytz.timezone(tzstring)
local_time = now_utc.astimezone(local_tz)