Skip to content

Instantly share code, notes, and snippets.

View PaulGoldschmidt's full-sized avatar
🎯
Focusing

Paul Goldschmidt PaulGoldschmidt

🎯
Focusing
View GitHub Profile
@PaulGoldschmidt
PaulGoldschmidt / ignoredsstore.sh
Last active October 25, 2024 18:38
Git ignore .DS_Store Globally
echo .DS_Store >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
@PaulGoldschmidt
PaulGoldschmidt / direct-transformer.py
Last active October 19, 2024 15:54
A script to transform the keepass .csv-export to a format that is importable by the native apple password application.
import csv
import getpass
from pykeepass import PyKeePass
# Function to decrypt the KeeWeb file and transform it to CSV
def transform_kdbx_to_csv(kdbx_file, output_csv):
# Ask for KeeWeb password securely via CLI
password = getpass.getpass("Enter KeeWeb (KeePass) database password: ")
# Open the KeePass database using pykeepass
@PaulGoldschmidt
PaulGoldschmidt / buergerportal-sampledecoder.js
Created October 1, 2024 09:13
Sample Decoding Function / payload formatter for the Heidelberg Buergerportal
function decodeUplink(input) {
var temp = input.bytes[0] << 24 | input.bytes[1] << 16 | input.bytes[2] << 8 | input.bytes[3];
var hum = input.bytes[4] << 24 | input.bytes[5] << 16 | input.bytes[6] << 8 | input.bytes[7];
var pressure = input.bytes[8] << 24 | input.bytes[9] << 16 | input.bytes[10] << 8 | input.bytes[11];
var gas = input.bytes[12] << 24 | input.bytes[13] << 16 | input.bytes[14] << 8 | input.bytes[15];
return {
data: {
temperature: temp / 100,
humidity: hum / 1000,
@PaulGoldschmidt
PaulGoldschmidt / github-markdown-cheats.md
Created June 18, 2024 08:49
My notes for not so popular Markdown commands copied shamelessly from random repos

Warning

Embedded Swift is experimental. Some information on this page might be out of date with latest development.

Important

Use the latest downloadable 'main' Development Snapshot from swift.org to use Embedded Swift. Public releases of Swift do not yet support Embedded Swift.

Note

This repository contains code that is not continuously developed, instead it's presented "as is" for educational and demonstrational purposes. Making major improvements to existing examples is discouraged, but additions of new examples is welcome.

@PaulGoldschmidt
PaulGoldschmidt / qingping-awnser.json
Created May 25, 2024 18:24
Demo JSON Awnser (prettified) of Qingping API.
{
"total": 1,
"devices": [
{
"info": {
"mac": "YOUR_MAC_ADRESS",
"product": {
"id": 1203,
"code": "CGDN1",
"name": "青萍空气检测仪 Lite",
@PaulGoldschmidt
PaulGoldschmidt / zammad.conf
Created February 17, 2024 20:32
Zammad Docker Compose Internal server configuration
# this is the nginx config for zammad
#
upstream zammad-railsserver {
server 127.0.0.1:3000;
}
upstream zammad-websocket {
server 127.0.0.1:6042;
}
@PaulGoldschmidt
PaulGoldschmidt / Caddyfile-beta2
Created February 1, 2024 19:47
Minimal dual reverse proxy setup with Caddy Servers
{
auto_https off
}
:80 {
root * /site
file_server
}
@PaulGoldschmidt
PaulGoldschmidt / creostarter.bat
Created December 10, 2023 18:12
A helper script for CREO 10 at the HAW Hamburg (Dep. TI/M+P) to autostart and confirm the creo config with the VPN-Setup.
:: By Paul Goldschmidt, 12-10-2023 | https://paul-goldschmidt.de/
@echo off
start "" "C:\Program Files\eduVPN\Core\eduVPN.Client.exe"
:: Countdown timer for 5 seconds
for /l %%i in (5,-1,1) do (
cls
echo Waiting for confirmation... (%%i seconds remaining)
timeout /t 1 /nobreak >nul
@PaulGoldschmidt
PaulGoldschmidt / mils-dpi_to_resolution.py
Created December 4, 2023 00:02
Calculating the resolution needed to fill a canvas from mm with a given DPI.
# Convert millimeters to inches and then to pixels at given DPI
# Dimensions in millimeters
width_mm = 420
height_mm = 594
# Conversion factor from mm to inches
mm_to_inch = 1 / 25.4
# Convert dimensions to inches
@PaulGoldschmidt
PaulGoldschmidt / storagealert.sh
Last active September 7, 2023 11:14
A small script to notify via telegram if the storage on a linux server runs low. Tested on Ubuntu.
#!/bin/bash
# Telegram Bot API Token and Chat ID
TELEGRAM_API_TOKEN="YOUR_TELEGRAM_BOT_API_TOKEN"
CHAT_ID="YOUR_CHAT_ID"
# Set the threshold for used storage in percentage
THRESHOLD=85
# Function to check used storage