Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View BalzGuenat's full-sized avatar

Balz Guenat BalzGuenat

View GitHub Profile
@BalzGuenat
BalzGuenat / README.md
Created August 6, 2020 13:57
kle2offset
@BalzGuenat
BalzGuenat / pot.c
Created January 14, 2020 12:58
Potentiometer scanning snippet
// #include "analog.h"
#include "stdio.h"
#include "stdlib.h"
#include "stdint.h"
#include "stdbool.h"
// dz+s | 98*s | s+dz
// 100s+2dz = 1024
// dz = 12
// s = 10
@BalzGuenat
BalzGuenat / mergesort.hs
Created December 10, 2019 09:57
Short Mergesort in Haskell
msort :: Ord a => [a] -> [a]
msort [] = []
msort [a] = [a]
msort as = let half = div (length as) 2; merge [] ys = ys; merge xs [] = xs
merge (x:xs) (y:ys) = if x <= y then x:merge xs (y:ys) else y:merge (x:xs) ys
in merge (msort $ take half as) (msort $ drop half as)
@BalzGuenat
BalzGuenat / maptracks.py
Last active September 27, 2019 12:51
Python module to access COCO.json annotations.
# This code is public domain.
import json
data = {}
images = {}
def imagename_to_id(name):
return list(filter(lambda img: img['file_name'] == name, data['images']))[0]['id']
@BalzGuenat
BalzGuenat / darcula.sublime-color-scheme
Created March 28, 2019 14:36
IntelliJ's Darcula color scheme for Sublime Text 3
{
"name": "Darcula",
"variables":
{
"bg": "#2B2B2B",
},
"globals":
{
"background": "var(bg)",
"foreground": "#A9B7C6",

Analyze traffic of a remote host with local Wireshark.

ssh user@host sudo tcpdump -U -n -i eth0 not port 22 -w - | wireshark -k -S -i -

@BalzGuenat
BalzGuenat / terraria_tutorial.md
Last active February 5, 2024 03:24
Installing and running a Terraria server with tShock on a Raspberry Pi

Installing and running a Terraria server with tShock on a Raspberry Pi

This was originally posted here on reddit. If you decide to try this, please post a comment either confirming that it works or stating any issues that came up. Thanks to reddit user /u/mat_storm1 for pointing out some typos and thanks to reddit user /u/supercore23 for pointing out potential issues with spaces in the world path.

What is this?

This guide explains how to install and run a Terraria server on your Raspberry Pi. I assume you have already installed Raspbian and have a very basic understanding of the command line. Installation on other Unix-based systems should be very similar. The goal is to reach a setup that only requires you to plug in your Pi to start the server. Connecting to the server should be easily done by using a hostname, not an IP. We should also be able to ssh into the server and do server-admin stuff at any t