Skip to content

Instantly share code, notes, and snippets.

@frozenfoxx
frozenfoxx / LinkWardenExportjson2htmlconverter.py
Created February 1, 2025 22:54 — forked from arnavpraneet/LinkWardenExportjson2htmlconverter.py
A simple convertor in Python to take the backup.json file that is supplied by LinkWarden on clicking export or through the migration API and convert it into the Netscape bookmark HTML format which is supported by most other major bookmarking, read-it-later and link-saving applications (LinkDing, LinkAce, Briefkasten, Pocket, Readwise, Omnivore e…
import json
import logging
from datetime import datetime
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s')
def date_to_timestamp(date_str):
try:
dt = datetime.fromisoformat(date_str.replace('Z', '+00:00'))
return int(dt.timestamp())
@arnavpraneet
arnavpraneet / LinkWardenExportjson2htmlconverter.py
Created May 20, 2024 19:34
A simple convertor in Python to take the backup.json file that is supplied by LinkWarden on clicking export or through the migration API and convert it into the Netscape bookmark HTML format which is supported by most other major bookmarking, read-it-later and link-saving applications (LinkDing, LinkAce, Briefkasten, Pocket, Readwise, Omnivore e…
import json
import logging
from datetime import datetime
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s')
def date_to_timestamp(date_str):
try:
dt = datetime.fromisoformat(date_str.replace('Z', '+00:00'))
return int(dt.timestamp())
#!/bin/bash
Counter=20
DisplayHeader="Date Time GPU-C GPU-F CPU-C CPU-F CPU Core Vcore"
while true ; do
let ++Counter
if [ ${Counter} -eq 21 ]; then
echo -e "${DisplayHeader}"
Counter=0
fi
@frozenfoxx
frozenfoxx / UnityHttpListener.cs
Created October 5, 2020 22:42 — forked from amimaro/UnityHttpListener.cs
Listen for Http Requests with Unity
using UnityEngine;
using UnityEngine.Networking;
using System;
using System.IO;
using System.Net;
using System.Threading;
public class UnityHttpListener : MonoBehaviour
{
@gimiki
gimiki / traefik_tcp_mqtt_mosquitto_docker_compose.md
Last active July 21, 2024 20:38
Traefik Reverse Proxy - Mosquitto MQTT Broker - Docker Container

This gist is to configure a Mosquitto MQTT Broker behind a Traefik reverse-proxy, both in a docker container. Mosquitto will be configuread as a TCP Service.

This is a simple configuration used on the same single server. Probably to be adapted for other cases. Having mosquitto behind a reverse proxy enables you to configure TLS on Traefik (likely you already do that for other applications as well) and to load balance different MQTT instances, but that goes beyond this gist.

As noted in Traefik docs, in the router you must use the rule HostSNI(`*`) when using non-TLS routers like in this example. Ref. https://docs.traefik.io/routing/routers/#rule_1

docker-compose.yml

@wmnnd
wmnnd / force-https.toml
Created March 11, 2020 00:05
Traefik configuration for an HTTPS redirect middleware/router
[http.routers]
[http.routers.force-https]
entryPoints = ["http"]
middlewares = ["force-https"]
rule = "HostRegexp(`{any:.+}`)"
service = "noop"
[http.middlewares]
[http.middlewares.force-https.redirectScheme]
scheme = "https"
@conoro
conoro / updating_banglejs.md
Last active January 21, 2023 18:47
Updating the firmware on your NodeWatch/Bangle.js

Updating the firmware on your NodeWatch/Bangle.js

Hi Banglers,

We hope you've been having fun experimenting with your Bangle.js and wanted to let you know about some important updates to the software for it.

The version of software on your Bangle.js is a very early release and has been improved hugely since November. Some of you may have encountered bugs with the middle button or find that some of the newer Apps on banglejs.com/apps don't work as they should.

Updating the software will solve these issues and get you access to new apps such as early Gadgetbridge integration for Android phone notifications.

WARNING MAY BE INCORRECT AND INCOMPLETE, USE AT YOUR OWN RISK

Install Proxmox, RancherOS, in a VM with Rancher 2.0 and Portainer

Setup Proxmox

  1. Install Proxmox 5.3
  2. Console/SSH into Proxmox
  3. nano /etc/apt/sources.list
  4. edit the file to look like this

WARNING MAY BE INCORRECT AND INCOMPLETE, USE AT YOUR OWN RISK

Install Proxmox, RancherOS, in a VM with Rancher 2.0 and Portainer

Setup Proxmox

  1. Install Proxmox 5.3
  2. Console/SSH into Proxmox
  3. nano /etc/apt/sources.list
  4. edit the file to look like this
@munificent
munificent / generate.c
Last active January 27, 2025 18:14
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u