Skip to content

Instantly share code, notes, and snippets.

@kevinkub
kevinkub / incidence.js
Last active June 27, 2023 12:53
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
class IncidenceWidget {
constructor() {
this.previousDaysToShow = 31;
this.apiUrlDistricts = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=RS,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) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/ArcGIS/rest/services/Covid19_hubv/FeatureServer/0/query?where=IdLandkreis%20%3D%20%27${districtId}%27%20AND%20Meldedatum%20%3E%3D%20TIMESTAMP%20%27${this.getDateString(-this.previousDaysToShow)}%2000%3A00%3A00%27%20AND%20Meldedatum%20%3C%3D%20TIMESTAMP%20%27${this.getDateString(1)}%2000%3A00%3A00%27&outFields=Landkreis,Meldedatum,AnzahlFall&outSR=4326&f=json`
this.stateToAbbr = {
@kevinkub
kevinkub / debian-setup.sh
Last active June 16, 2023 08:58 — forked from chris-redbeed/debian-setup.sh
Sets up and hardens an Debian Linux server.
# Arch Linux Setup: https://gist.github.com/kevinkub/46ce7229ee4f17be710ddd7c5a80a3c3
# Change root password
echo "# Change password of root user"
passwd
# Change hostname
echo "# Change hostname"
hostname
sudo hostnamectl set-hostname $hostname
@nabe-abk
nabe-abk / ssdp-relay.pl
Last active October 16, 2018 11:22
UPnP/DLNA multicast relay server
#!/usr/bin/perl
################################################################################
# DLNA multicast relay (C)2015/11/13 nabe@abk / GPLv2 or later
################################################################################
use strict;
use Socket;
use IO::Select;
use IO::Interface::Simple;
use IO::Socket::Multicast;
@aamnah
aamnah / vhost.sh
Last active July 1, 2019 06:58
Bash script to create virtual host file
#!/bin/sh
############
# Author: Aamnah
# URL: http://aamnah.com
# Based on: https://www.linode.com/docs/websites/hosting-a-website
############
# Reset
Color_Off='\033[0m' # Text Reset