Skip to content

Instantly share code, notes, and snippets.

@schorschii
schorschii / Github-Sponsorship-Created-Webhook.txt
Last active July 1, 2024 15:47
Github Sponsorship Webhook Example (when a new sponsorship was created)
{
"action": "created",
"sponsorship": {
"node_id": "xxx",
"created_at": "2024-06-14T15:34:44+00:00",
"sponsorable": {
"login": "<github-username>",
"id": 123,
"node_id": "xxx",
"avatar_url": "xxx",
@schorschii
schorschii / Schorschii's OpenLDAP Setup.md
Last active June 30, 2024 20:46
OpenLDAP Cheat Sheet

OpenLDAP Cookbook

Tested under Ubuntu 22.04

Abbreviations

  • "slapd" = Stand-alone LDAP Daemon
  • "CN" = Common Name (name of an LDAP object)
  • "DN" = Distinguished Name (definite path to an LDAP object)
  • "OU" = Organizational Unit (container for LDAP objects, e.g. a department of your company)
  • "LDIF" = LDAP Data Interchange Format
  • Class = "template" for an LDAP object
@schorschii
schorschii / firefox-context-menu-position-fix.txt
Last active June 4, 2024 07:37
Solution for Firefox showing context menus and password popups at the wrong position
In some constellations, Firefox shows context menus at a complete different position on the screen, especially when the window was dragged to the left or right screen side so that it snaps in and fills 50% of the screen (known as "Aero Snap" on Windows).
Fix:
1. Right-click on the title bar -> "Customize Toolbar..."
2. On the bottom, uncheck the checkbox "Title Bar"
That's it! Without the title bar, all menus and popups are shown on the correct position!
@schorschii
schorschii / index.php
Last active January 30, 2024 15:26
Simple WordPress plugin to set the "envelope sender" correctly, so that e.g. Gmail accepts them. Just create a folder "wp-content/plugins/fix-mail-sender" and put this file there. Don't forget to activate the plugin and enjoy. Note: if you are on Hetzner, you need to create a mailbox "wordpress@yourdomain.tld" too to make it work. Don't ask why.
<?php
/**
* Plugin Name: Fix Mail Sender
* Plugin URI: https://georg-sieber.de
* Description: Sets the envelope sender correctly to the "From" header address to enable mail delivery to Gmail from managed webservers.
* Version: 1.0
* Author: Georg Sieber
* Author URI: https://georg-sieber.de
* License: free
*/
@schorschii
schorschii / sato-graphic-converter.php
Last active November 27, 2023 14:07
SATO Label Printer SBPL Graphic Converter
<?php
# SATO Graphic Converter, (c) Georg Sieber 2023, https://github.com/schorschii
# open source implementation of the SATO label printer graphic format,
# generates SBPL command to print arbitrary graphic given as parameter
# supports hex and binary (more performant) format
# usage: php sato-graphics-converter.php 192.168.1.50 image.jpg 250 100
# important: the printer won't print if the image location is not on your label size, so please choose appropriate X/Y coordinates
@schorschii
schorschii / HPUnlocker.py
Last active May 21, 2024 08:57
HP Unlocker: Remove admin passwords from HP UEFI/BIOS images
#!/usr/bin/python3
# Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
import mmap, shutil, sys
if len(sys.argv) != 2:
print('Please provide a HP BIOS image .bin file as first parameter!')
sys.exit(1)
path = sys.argv[1]
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.provider.ContactsContract;
import android.util.Log;
@schorschii
schorschii / QuotedPrintable.java
Last active October 19, 2023 14:56
Encode and Decode Quoted Printable Strings (e.g. from VCF files)
package de.georgsieber.customerdb.importexport;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
class QuotedPrintable {
static String ASCII_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 ";
@SuppressWarnings("CharsetObjectCanBeUsed")
@schorschii
schorschii / iTunes12-Wine-Ubuntu.txt
Last active March 24, 2023 23:08
How to install iTunes 12 on Linux Mint 18 with working Store
Trying to run iTunes with Wine, i faced various problems. Here is a working solution how to install iTunes on Debian-based systems (in my case Linux Mint 18.1) - with support for the iTunes Store. Warning: Syncing i-devices is still not possible.
When installing it with the playonlinux-"iTunes 12"-script, log in into the Store was not possible in my case. Wine showed the follwing error when trying to log in: SecurityContext failed with error 0x80090304
1. Install current Wine version (2.0.1) directly from the winehq repository
wget -nc https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'
sudo apt-get update
sudo apt-get install --install-recommends winehq-stable
wine --version