Skip to content

Instantly share code, notes, and snippets.

Balz Guenat BalzGuenat

Block or report user

Report or block BalzGuenat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
BalzGuenat / pot.c
Created Jan 14, 2020
Potentiometer scanning snippet
View pot.c
// #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 / mergesort.hs
Created Dec 10, 2019
Short Mergesort in Haskell
View mergesort.hs
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 /
Last active Sep 27, 2019
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 / darcula.sublime-color-scheme
Created Mar 28, 2019
IntelliJ's Darcula color scheme for Sublime Text 3
View darcula.sublime-color-scheme
"name": "Darcula",
"bg": "#2B2B2B",
"background": "var(bg)",
"foreground": "#A9B7C6",
View gist:7b4136841c3c22d63a3b3e53371eef15

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 /
Last active Oct 26, 2019
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

You can’t perform that action at this time.