Skip to content

Instantly share code, notes, and snippets.

View nhh's full-sized avatar
🏠
Working from home

Niklas nhh

🏠
Working from home
  • Hamburg
View GitHub Profile
@adtac
adtac / Dockerfile
Last active November 1, 2024 03:05
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@sportsracer
sportsracer / rbast.py
Last active February 16, 2021 20:03
Create different ways of writing Ruby statement in Python
from dataclasses import dataclass
from itertools import product
from typing import Dict, Iterable, List
@dataclass
class AstNode:
def representations(self) -> Iterable[str]:
raise NotImplementedError
@anthonyray
anthonyray / kiosk.md
Created September 6, 2019 15:45
Turn your Raspberry Pi into a kiosk playing looping videos

An acquaintance needed a video kiosk that plays looping videos for an exposition booth. Since I have a bunch of Raspberry Pis lying around, I figured that it would be the perfect use case for using one of them.

Let's assume we start from scratch, with a unflashed, brand new SD card and your Raspberry Pi.

Installing the OS

Install a version of Raspbian that includes the desktop. You can head over to : https://www.raspberrypi.org/downloads/raspbian/ and follow the instructions.

Once the image is downloaded, you can burn it to your SD card with tools like Etcher (https://www.balena.io/etcher/)

# openshift cli tool `oc` will be needed, and you must login
# https://github.com/openshift/origin/releases
# install socat on the mac
brew install socat
# alias localhost to give local containers an address for the host network
sudo ifconfig lo0 alias 172.16.123.1
# start the container in openshift
@ageis
ageis / systemd_service_hardening.md
Last active November 1, 2024 09:45
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@nornagon
nornagon / 1-intro.md
Last active April 20, 2024 18:48
How to make a Minecraft (1.8) mod

How to make a Minecraft mod

Minecraft mods, especially mods which change the client, are by and large written with Forge. If you visit their website, you'll be greeted abruptly by a mysterious message at the top of an SMF forum, with no clear path towards actually... making a mod. I'm documenting here the steps I went through to get started, in the hopes of helping the next person have an easier time of it.

I'll be using Scala for this guide, but it should be fairly easy to adapt these instructions to any JVM language (e.g. clojure or if you're feeling masochistic, Java). I'm also developing on OS X, so some of the commands will be a little different if you're on Linux or Windows. I'm assuming you have some proficiency with your operating system, so I won't go into details about how to adapt those commands to your system.

Background

Minecraft doesn't have an official mod API (despite early [promises](http://notch.t