Skip to content

Instantly share code, notes, and snippets.

@mildsunrise
mildsunrise / hetzner-storage-box-auth.md
Last active October 27, 2025 01:44
Explanation of how SSH keys work in Hetzner storage boxes

Making Hetzner Storage Box authentication make sense

The documentation for this is pretty terrible and we had to figure this out by trial and error.

The storage box has a password, which is secret and random if not provided. It can be reset to an arbitrary one in the console ("Reset password" in the dropdown menu). Cannot be disabled. It's the only way to use WebDAV and SMB. Always accepted by SSH (and thus SFTP) on either port. It is the only way to recover a storage container you have locked yourself out of after losing SSH keys.

The SSH server on port 22 rejects shell, but it allows spawning the SFTP backend. Requests for any other command or subsystem seem to fail, so it seems to be made specifically for SFTP use.

The SSH server on port 23 offers a limited shell (rsh) with rsync, restic and a few other whitelisted commands. No redirections, pipes or other common shell features you'd expect. (dd is whitelisted, so yo

@mildsunrise
mildsunrise / _migrated.md
Last active May 9, 2024 22:26
🕵️‍♀️ MP4 parser / dissector for the command line
@Jim-Bar
Jim-Bar / YUV_formats.md
Last active October 26, 2025 15:51
About YUV formats

About YUV formats

First of all: YUV pixel formats and Recommended 8-Bit YUV Formats for Video Rendering. Chromium's source code contains good documentation about those formats too: chromium/src/media/base/video_types.h and chromium/src/media/base/video_frame.cc (search for RequiresEvenSizeAllocation(), NumPlanes() and those kinds of functions).

YUV?

You can think of an image as a superposition of several planes (or layers in a more natural language). YUV formats have three planes: Y, U, and V.

Y is the luma plane, and can be seen as the image as grayscale. U and V are reffered to as the chroma planes, which are basically the colours. All the YUV formats have these three planes, and differ by the different orderings of them.

@martinarroyo
martinarroyo / citationneeded.tex
Created June 1, 2015 22:10
A LaTeX macro that sets a Wikipedia-stylized "Citation Needed" template and outputs the counter of references with a surprise. Use with write18 enabled! and the Figures directory in \graphicspath{}!
\newcounter{undefinedreferences}
\setcounter{undefinedreferences}{0}
\newcommand{\citationneeded}[1][None]{\stepcounter{undefinedreferences}\textsuperscript{\color{blue} [Citation needed: #1]}}
\newcommand{\checkreferences}{
\ifnum\value{undefinedreferences} > 0
\begin{center}
\immediate\write18{wget -O Figures/protester.png -nc http://imgs.xkcd.com/comics/wikipedian_protester.png}
\includegraphics[width=\textwidth]{protester.png}
diff --git a/bar.c b/bar.c
index 68b41ca..b9f2ae5 100644
--- a/bar.c
+++ b/bar.c
@@ -1,5 +1,6 @@
// vim:sw=4:ts=4:et:
#include <stdbool.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@ctalkington
ctalkington / grunt.js
Created September 12, 2012 02:44
Grunt Glob to Multi Files Object
// gruntfile dropin used to build a grunt files object with 1:1 structure
function globToMultiFiles(glob, dest, options) {
var path = require('path');
grunt.util = grunt.util || grunt.utils;
dest = grunt.template.process(dest);
options = grunt.util._.defaults(options || {}, {
cwd: '',