Skip to content

Instantly share code, notes, and snippets.

@hfs
hfs / LICENSE.md
Last active July 27, 2022 19:29
OpenStreetMap landuse areas in Germany which don’t contain any buildings, but are expected to. Data from: 2021-01-30.

This data is derived from OpenStreetMap.

Ⓒ OpenStreetMap contributors

The data is published under the terms of the Open Database License.


ODC Open Database License (ODbL)

@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active March 18, 2024 14:57
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

@ThomasLeister
ThomasLeister / delete-ejabberd-accounts-list.sh
Created May 9, 2020 20:41
Delete Ejabberd accounts by JID list
##
## Create a "spammers.txt" file with all the JIDs (Jabber IDs) to delete. One in each line:
## user1@server.tld
## user2@server.tld
## user3@server.tld
## ...
## then run this command:
cat spammers.txt | xargs -L1 -i bash -c 'jid={}; name=${jid%@*}; domain=${jid##*@}; ejabberdctl unregister $name $domain; echo "deleted $jid"'
@ThomasLeister
ThomasLeister / auto-start-tmux-ssh.txt
Last active February 19, 2024 01:39
Put this into your .bashrc to auto-start a tmux session after SSH login
Put these lines into your server's .bashrc:
##
## TMUX auto attach
##
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then # if this is an SSH session
if which tmux >/dev/null 2>&1; then # check if tmux is installed
if [[ -z "$TMUX" ]] ;then # do not allow "tmux in tmux"
ID="$( tmux ls | grep -vm1 attached | cut -d: -f1 )" # get the id of a deattached session
if [[ -z "$ID" ]] ;then # if not available create a new one
tmux new-session
@ThomasLeister
ThomasLeister / mastodon-tootctl-media-purge.txt
Created February 21, 2019 19:07
How to automatically remove cached media files older that 7 days from your Mastodon instance
This is how to automatically delete cached image previews from your Mastodon instance if they are older than 7 days.
Log in as your "mastodon" User or log in as root and then change to the "mastodon" user, who runs Mastodon:
# su - mastodon
Open crontab:
$ crontab -e
... and add these lines to your crontab:
@brannow
brannow / TempSensor.cs
Created January 22, 2018 15:05
C# USB Temperature Sensor Tester Interface for DS18B20
// see: https://github.com/mikeobrien/HidLibrary/tree/master/src/HidLibrary
using HidLibrary;
using System;
using System.Linq;
using System.Runtime.InteropServices;
namespace Environment.HardwareData.SensorData
{
class TempSensor
{
@td00
td00 / wifionice.py
Last active March 3, 2019 01:08
wifionice
import urllib.request
import subprocess
import psutil
import time
import socket
class BahnWifi:
def __init__(self):
self.loginUrl = 'http://www.wifionice.de/?login'
self.logoutUrl = 'http://www.wifionice.de/?logout'
@mipapo
mipapo / runalyzequeue.service
Created March 19, 2017 11:13
Runalyze Queue
[Unit]
Description=RUNALYZE queue
After=network.target
[Service]
Type=simple
User=www-data #adjust the user
WorkingDirectory=/var/www/example.runalyze.com/htdocs/
ExecStart=/usr/bin/php /var/www/example.runalyze.com/htdocs/bin/console runalyze:queue:consume --env=prod
Restart=always
@bep
bep / hugo-on-android.md
Last active April 26, 2024 04:13
Run Hugo on an Android phone

First install Termux

Then there are two options:

Build from source

Open the Termux terminal on your Android device and copy-and-paste the commands listed below and hit ENTER:

@sebble
sebble / stars.sh
Last active February 17, 2024 16:49
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-sebble}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo