Skip to content

Instantly share code, notes, and snippets.

View Sir-Photch's full-sized avatar
🤬
*!?.#&=

Christoph Sir-Photch

🤬
*!?.#&=
View GitHub Profile
@Sir-Photch
Sir-Photch / .clang-format
Last active April 22, 2024 10:31 — forked from YodaEmbedding/.clang-format
.clang-format for Rust style (rustfmt)
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent # New in v14. For earlier clang-format versions, use AlwaysBreak instead.
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: false
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
@Sir-Photch
Sir-Photch / Dockerfile
Created May 11, 2023 12:29
AArch64 Raspberry Pi OS Dockerfile
ARG DEBIAN_FRONTEND=noninteractive
FROM busybox:latest
ADD https://downloads.raspberrypi.org/raspios_lite_arm64/root.tar.xz /
RUN set -xeu && \
mkdir "/rpi-root" && \
tar xaf /root.tar.xz -C /rpi-root
@Sir-Photch
Sir-Photch / dyndns.py
Last active February 17, 2023 12:11
Python script to update A root ("@") record with hetzner dns
#!/usr/bin/env python3
import requests
import json
import os
from http.client import responses
token = os.environ.get("HETZNER_API_TOKEN") # abc123
zone_name = os.environ.get("HETZNER_DYNDNS_ZONE") # "mydomain.com"
ntfy_topic = os.environ.get("HETZNER_NTFY_TOPIC") # ntfy.sh/... my_topic_name
@Sir-Photch
Sir-Photch / send.sh
Created November 9, 2022 08:11
Loop to write ascii-text to serial port
#!/bin/sh
if [[ $# == 0 ]]; then
echo "Usage: send.sh <serial port>" >&2
exit 1
fi
echo "Writing to $1; Press Ctrl+C to exit"
echo
@Sir-Photch
Sir-Photch / Sarcasm.c
Last active March 27, 2022 16:20
Sarcasm.c | cLiPbOaRd GeNeRaToR fOr SaRcAsM tExT
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main(void)
{
if (!OpenClipboard(NULL))
{
@Sir-Photch
Sir-Photch / cargo.toml
Last active March 4, 2022 22:34
Recursive shasum generator for entries in filesystem
[package]
name = "traverse"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sha2="0.10.2"
hex="0.3.1"
using System;
using System.Linq;
using System.IO;
using System.Drawing;
using System.Collections.Generic;
namespace ImageConverter
{
class Program
{