Skip to content

Instantly share code, notes, and snippets.

@meyt
meyt / Dockerfile
Created August 22, 2026 06:16
Build xfce4 notes plugin for Debian 12
# syntax=docker/dockerfile:1.6
FROM debian:12-slim AS builder
ARG PKG_NAME=xfce4-notes-plugin
ARG PKG_VERSION=1.12.0
ARG PKG_RELEASE=1
ARG DEB_ARCH=amd64
ENV DEBIAN_FRONTEND=noninteractive
@meyt
meyt / altcha-swagger.html
Last active August 4, 2026 02:01
Altcha widget plugin for swagger-ui
<!-- modify the swagger-ui index file and register the plugin like this:
<script>
window.onload = () => {
const ui = SwaggerUIBundle({
url: "/swagger/doc.json",
dom_id: '#swagger-ui',
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
@meyt
meyt / esbuild.mjs
Created April 22, 2026 22:19
Build express.js app with all dependencies (wasm and native binary excluded) into single file
import path from 'path'
import { fileURLToPath } from 'url';
import * as esbuild from "esbuild";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
try {
await esbuild.build({
entryPoints: [path.resolve(__dirname, './server.mjs')],
bundle: true,
@meyt
meyt / mousewfix.sh
Last active April 16, 2026 16:39
Mouse wheel scroll jump fix
#!/bin/bash
# Mouse wheel scroll jump fix
#
# scenario: scrolling down or up on page using mouse wheel but sometime
# you see small jumps in reverse direction. (you can debug with 'xev' command)
#
# source: https://askubuntu.com/a/1546417/999831
#
# requirements:
@meyt
meyt / untilok.sh
Created April 14, 2026 12:11
Retry the command until its done (zsh compatible)
# Retry the command until its done.
# install: put it in .zshrc or .bashrc
# usage:
# untilok rsync ...
# RETRY_DELAY=2 untilok rsync ...
untilok() {
retrydelay=${RETRY_DELAY:-10} # seconds; override by exporting RETRY_DELAY
while true; do
@meyt
meyt / .htaccess
Created February 26, 2026 05:52
Simple theme for Apache auto-indexing (all-in-one html, no extra assets)
# assuming we serving https://site.com/mirror
# put the `.htaccess` and `header.html` inside `mirror` direcotry.
Options +Indexes
IndexOptions FancyIndexing VersionSort HTMLTable SuppressDescription NameWidth=* Charset=UTF-8
IndexIgnore header.html .htaccess .gitignore README.md *.log .DS_Store
HeaderName /mirror/header.html
#!/bin/bash
# Query the GNOME proxy mode
MODE=$(gsettings get org.gnome.system.proxy mode | tr -d "'")
if [ "$MODE" = "manual" ]; then
HOST=$(gsettings get org.gnome.system.proxy.http host | tr -d "'")
PORT=$(gsettings get org.gnome.system.proxy.http port)
# Check if host is local
@meyt
meyt / jfastload.php
Created January 30, 2026 20:44
jfastload.php
<?php
/**
* Plugin Name: jfastload - Disable Elementor editor CDN assets
* Description: Loads Elementor assets from local for air-gapped environment
* Version: 1.0.0
* Plugin URI: https://yourwebsite.com
* Author: Your Name
* License: GPL v2 or later
* Text Domain: jfastload
*/
@meyt
meyt / xfwm-maxunmax.sh
Created September 2, 2025 00:11
Fix xfce/xfwm lost maximized window state after second display attached/detached
#!/bin/bash
# Get list of maximized windows (both horizontal and vertical)
wmctrl -l | while read -r id desktop hostname title; do
# Check if window is maximized (both directions)
net_wm_state=$(xprop -id "$id" _NET_WM_STATE 2>/dev/null)
if [[ "$net_wm_state" == *"_NET_WM_STATE_MAXIMIZED_HORZ"* ]] && \
[[ "$net_wm_state" == *"_NET_WM_STATE_MAXIMIZED_VERT"* ]]; then
echo "Processing window: $title ($id)"
@meyt
meyt / keyboard-layout-ascii.md
Last active November 30, 2025 05:10
Keyboard Layout - ASCII
┌─────┐     ┌─────┬─────┬─────┬─────┐  ┌─────┬─────┬─────┬─────┐  ┌─────┬─────┬─────┬─────┐  ┌─────┬─────┬─────┐
│ESC  │     | F1  │ F2  │ F3  │ F4  |  │ F5  │ F6  │ F7  │ F8  │  | F9  │ F10 │ F11 │ F12 │  |PSCR │SLOCK│PAUSE│
└─────┘     └─────┴─────┴─────┴─────┘  └─────┴─────┴─────┴─────┘  └─────┴─────┴─────┴─────┘  └─────┴─────┴─────┘
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬───────────┐  ┌─────┬─────┬─────┐  ┌─────┬─────┬─────┬─────┐
│ `   │  1  │  2  │  3  │  4  │  5  │  6  │  7  │  8  │  9  │  0  │  -  │  =  │BACKSPACE  │  |INS  │HOME │PGUP │  │NLOCK│  /  │  *  │  -  │
├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬────────┤  ├─────┼─────┼─────┤  ├─────┼─────┼─────┼─────┤
│TAB     │  Q  │  W  │  E  │  R  │  T  │  Y  │  U  │  I  │  O  │  P  │  [  │  ]  │   \    │  |DEL  |END  |PGDN |  |  7  |  8  |  9  |     |
├────────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴────────┤ └─────┴─────┴─────┘ ├─────┼