Skip to content

Instantly share code, notes, and snippets.

View numpde's full-sized avatar

numpde

View GitHub Profile
@numpde
numpde / sim_1hnmr.py
Created March 29, 2025 07:01
How to run MestReNova quietly (on Linux)
def sim_1hnmr(smiles: str):
if not smiles:
return
if not MolFromSmiles(smiles):
return
smiles = CanonSmiles(smiles)
@numpde
numpde / reexport.qs
Created February 12, 2025 15:55
MestReNova script to batch-reexport NMR spectra from .mnova files
/**
* Batch Export Script for LOGS Data Bundle (.zip)
*
* This script processes all `.mnova` files in the specified directory,
* extracts 1D NMR spectra, and exports each file as a LOGS Data Bundle (.zip).
*
* It's partially based on the `LOGSDataBundle.qs` script by MestReNova.
*
* - Uses `saveAsLOGSDataBundle()` to perform the export.
* - Opens each `.mnova` file using `serialization.open()`.
@numpde
numpde / vpn-tray-ubuntu-gnome.sh
Created February 10, 2025 17:33
Sets up a tray icon to connect to the ETHZ VPN
#!/bin/bash
set -euo pipefail
LOGIN_NAME="[email protected]"
GENERAL_PASSWORD=''
OTP_SECRET="..."
HOST="sslvpn.ethz.ch"
OPTS=""
export GDK_BACKEND=x11 # Ensure yad works on Wayland
@numpde
numpde / keyd-setup-asus-rog-falchion.md
Last active October 18, 2025 13:15
Installation and remapping process for key remapping using keyd (ASUS ROG FALCHION)

Keyd Setup for ASUS ROG FALCHION Keyboard

This guide installs and configures keyd to remap keys on the ASUS ROG FALCHION keyboard.

  1. Install keyd
    sudo add-apt-repository ppa:keyd-team/ppa
    sudo apt update
    sudo apt install keyd
    sudo systemctl enable --now keyd
@numpde
numpde / disable_falchion_system_control.sh
Last active October 19, 2025 10:01
The script detects the ROG Falchion System Control device and creates a udev rule to disable it as a system input device, preventing unwanted suspend actions, then reloads udev rules and optionally reboots to apply the change.
#!/bin/bash
# Disable the ROG Falchion *System Control* interface in libinput (Wayland-safe)
# Ref: https://wayland.freedesktop.org/libinput/doc/latest/ignoring-devices.html
set -euo pipefail
(( EUID == 0 )) || { echo "Run as root (sudo)"; exit 1; }
# Defaults for the Falchion 2.4G dongle; override via env if needed.
VID="${VID:-0B05}"
PID="${PID:-193E}"
@numpde
numpde / disable_rog_falchion_power_keys.sh
Last active October 19, 2025 09:59
Disables the power and sleep keys on the ROG Falchion keyboard via udev hwdb rules.
#!/bin/bash
# Disable bogus Power/Sleep/Wakeup from "ASUSTeK ROG FALCHION System Control"
# Requires: systemd-hwdb (or udevadm hwdb), udevadm
set -euo pipefail
hwdb_update(){ command -v systemd-hwdb &>/dev/null && systemd-hwdb update || udevadm hwdb --update; }
(( EUID == 0 )) || { echo "Run as root (sudo)"; exit 1; }
echo "[1/6] Locating 'ASUSTeK ROG FALCHION System Control'…"
evnode=""
@numpde
numpde / disable_rog_falchion_autosuspend.sh
Last active January 31, 2025 17:00
This script disables USB autosuspend for the ASUS ROG FALCHION keyboard persistently by creating a udev rule, reloading the rules, and verifying the change.
#!/bin/bash
set -euo pipefail
# ASUS ROG FALCHION USB Vendor and Product ID
VENDOR_ID="0b05"
PRODUCT_ID="193e"
# Udev rule file path
RULE_FILE="/etc/udev/rules.d/99-rog-falchion.rules"
@numpde
numpde / issues.json
Created November 10, 2024 10:33
WA/TA: Typesense collection for an issue tracker
{
"name": "issues",
"fields": [
{
"name": "thread_id",
"type": "string",
"facet": true,
"optional": false,
"index": true,
"sort": false,
@numpde
numpde / wa-ts_collection_schema.json
Last active October 27, 2024 07:48
WA/TS: Typesense collection schema
{
"name": "wa_conversations",
"fields": [
{
"name": "contacts.wa_id",
"type": "string",
"facet": true,
"optional": false,
"index": true,
"sort": false,
@numpde
numpde / gpt-action-feedback.php
Last active October 25, 2024 11:19
WP: Custom REST API endpoint to report using GPT actions
<?php
/*
Plugin Name: GPT Action Feedback
Description: Allows custom GPTs to report issues or concerns via a REST API endpoint, restricted to users with a specific capability.
Version: 1.0
Author: RA
*/
// Register the custom REST API endpoint only when the plugin is active.
add_action('rest_api_init', 'gpt_register_feedback_endpoint');