Skip to content

Instantly share code, notes, and snippets.


Kevin Kub kevinkub

View GitHub Profile
from axolotl.tests.inmemoryaxolotlstore import InMemoryAxolotlStore, InMemoryIdentityKeyStore, InMemoryPreKeyStore, InMemorySessionStore, InMemorySignedPreKeyStore
from axolotl.sessioncipher import SessionCipher
from axolotl.util.keyhelper import KeyHelper
class Entity:
def __init__(self):
self.__sessionStore = InMemorySessionStore()
self.__preKeyStore = InMemoryPreKeyStore()
self.__signedPreKeyStore = InMemorySignedPreKeyStore()
kevinkub /
Last active Sep 15, 2020
Sets macOS to continuously scan for new wifi networks. When a shell* wifi network appears, it tries to connect automatically. Afterwards the script checks for versioning information and performs multiple http requests to configure the shellys accordingly.
# Automatically connects to Shelly-Wifis and performs the initial setup (on macOS).
while true; do
# Connect to Shelly wifi
echo "Started scanning for shelly Wifi networks"
while [ -z "$shellySsid" ]; do
shellySsid=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s | grep shelly | awk '{$1=$1};1' | grep -io '[a-zA-Z0-9\-]\{10,\}' | head -n 1)
kevinkub / Arch Linux
Last active Sep 16, 2020
Sets up and hardens an Arch Linux server.
View Arch Linux
# See for a Debian version of this script.
# Change root password
echo "# Change password of root user"
# Change hostname
echo "# Change hostname"
read hostname
hostname $hostname
kevinkub / object-path.js
Created Sep 11, 2019
Sets the values of a javascript object or array using a chain of colon separated keys.
View object-path.js
function set(obj, keyChain, value) {
var keys = keyChain.split('.');
var key = keys.shift();
while(keys.length) {
obj[key] = obj[key] || (isFinite(keys[0]) ? [] : {});
obj = obj[key];
key = keys.shift();
obj[key] = value;
View scriptable-tests.js
const widget = await createWidget()
if (!config.runsInWidget) {
await widget.presentSmall()
async function createWidget(items) {
const location = await Location.current()
kevinkub /
Last active Dec 31, 2020 — forked from chris-redbeed/
Sets up and hardens an Debian Linux server.
# Arch Linux Setup:
# Change root password
echo "# Change password of root user"
# Change hostname
echo "# Change hostname"
sudo hostnamectl set-hostname $hostname
View scriptable-line-chart.js
class LineChart {
// LineChart by
constructor(width, height, values) {
this.ctx = new DrawContext();
this.ctx.size = new Size(width, height);
this.values = values;
_calculatePath() {
kevinkub / incidence.js
Last active Jan 23, 2021
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪
View incidence.js
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
// Thanks to @rphl ( and @tzschies ( for their inspiring work on this widget. See and
class IncidenceWidget {
constructor() {
this.previousDaysToShow = 31;
this.apiUrlDistricts = (location) => `,GEN,cases7_bl_per_100k,cases7_per_100k,BL&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`
this.apiUrlDistrictsHistory = (districtId) => `${districtId}%27%20AND%20Meldedatum%20