Skip to content

Instantly share code, notes, and snippets.

#!/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 September 15, 2024 03:16
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
@stash
stash / GlobalObject.cs
Created March 30, 2018 22:18
GlobalObject.cs
using UnityEngine;
/**
* Singleton-esque inter-Scene GameObject loader.
*
* Ever wanted a singleton or global sort of GameObject that still allowed for editing properties in the Unity Editor?
* I sure did, for things like background music, a game controller, etc. So, I made this simple system of creating a global or "inter-scene" GameObject. It's not a true singleton, but it does a good job at ensuring there's only GameObject with this script attached. I don't like the approach of creating a persistent, additively-loaded scene -- not to mention the other approaches to making true Singleton objects -- so I've opted for a pre-fabbable GameObject approach.
*
* HowTo, in the Unity Editor (tested with 2017.3.1f1):
* 1. Attach this script to an empty GameObject in the current scene.