Skip to content

Instantly share code, notes, and snippets.

@schorschii
schorschii / cursor.sh
Created November 12, 2024 12:08
Change default cursor (for Firefox on Mint 22)
sudo update-alternatives --config x-cursor-theme
@schorschii
schorschii / audio-reboot.sh
Created August 14, 2024 12:18
Force reloading audio devices if not detected automatically
pacmd load-module module-udev-detect
@schorschii
schorschii / Datalogic-Scanner-Return-Linux.txt
Last active August 8, 2024 16:47
Configure Datalogic QR/barcode scanner to send line break (\n) as ENTER
Datalogic scanners are normally sending CTRL+J when reading a line feed (LF) character and ENTER when reading carriage return (CR).
That's not cool if you use the scanner with Linux or Android since QR codes mostly use Unix line endings (LF only) when they contain line breaks.
You can work around by using the character replacement feature of these scanners.
Use the Datalogic online tool to create a config code: https://aladdin.datalogic.com/
1. Select your scanner
2. Go to "Data Format" -> "Character Replacement"
3. Enter "0A0D" for "Character Conversion" to tell the scanner to replace LF (hex "0A") with CR (hex "0D")
@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 July 3, 2024 17:08
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 November 20, 2024 16:24
HP Unlocker: Remove admin passwords from HP UEFI/BIOS images. Need help? Contact me for professional BIOS repair services in Germany: https://georg-sieber.de/?page=blog-bios
#!/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;