Skip to content

Instantly share code, notes, and snippets.

View shtrom's full-sized avatar
💭
When you're coding, noone needs to see your mouth.

Olivier Mehani shtrom

💭
When you're coding, noone needs to see your mouth.
View GitHub Profile
We can't make this file beautiful and searchable because it's too large.
git,hg
31ce89451eb3aace441ca4d78060a6ffc3947861,884a7edc89061113f6d82fbed6668e7c9d263a9d
7030b0ac2a93a8da87c67c7806783135534dccab,256a83eeb911bfb268685e7978de230670082802
5e217900aa150e3ab2105b6d866d164d18dcdba6,3a57041d71e228b32ae13df93a44c4522cbe050c
dac7a7fb41781ebaddcf5461ce828141030c097b,a5eaa5ec3199119115f997714a0162e45450377a
e368db29fcb2033c8e996ec5492b812cb5c1e1f6,245db101c6d847fed3cacdaaae653918d6391229
9e4bfa36b3f6f7d28b79e4d4fb111f441c106dce,866bc156769bc99dfb3453ffc9d1962f86c45b00
ae4447ac4dc4a90a4f5b269e812eed1f965efce1,991c7b5963514a11c373e6b24ff2de290f44d890
4e2af88d459ca582f1c7141bffceca2fdb19c485,50818d46cbea5a7ea80ccb610c7682c137d3aed3
@shtrom
shtrom / GitHub Lando linker.user.js
Last active January 7, 2026 02:29
GitHub Lando linker
// ==UserScript==
// @name GitHub Lando linker
// @version 1
// @author Olivier Mehani <omehani@mozilla.com>
// @downloadURL https://gist.github.com/shtrom/20aeb11b6b6c07f9b392786b4d01067b
// @grant none
// @match https://github.com/mozilla-firefox/firefox/*
// @match https://github.com/mozilla-conduit/lando/*
// @run-at document-idle
// ==/UserScript==
@shtrom
shtrom / gpg-use-primary.sh
Created April 26, 2025 06:24
Utility script to create a temporary environment with a primary GPG key, complete with reminders about how to do maintenance tasks
#!/bin/bash -eux
if [ ${#} -lt 1 ]; then
echo "usage: ${0} <KEY_FILE>" >&2
exit 1
fi
KEY="${1}"
GPG=gpg
@shtrom
shtrom / GitHub BMO Linker.user.js
Last active January 20, 2026 03:24
Github BMO Linker GreaseMonkey script
// ==UserScript==
// @name GitHub BMO Linker
// @version 5
// @author Olivier Mehani <omehani@mozilla.com>
// @downloadURL https://gist.github.com/shtrom/e9c25e103aaf2f8ede6f740787b50e33
// @grant none
// @match https://github.com/*
// @run-at document-idle
// ==/UserScript==
@shtrom
shtrom / post_to_wallabag.sh
Last active February 22, 2025 05:48
Bash script to post a local HTML file to a Wallabag instance https://blog.narf.ssji.net/2025/01/17/manually-sending-document-contents-to-wallabag/
#!/bin/bash -u
# Bash script to post a local HTML file to a Wallabag instance
#
# This assumes client and user credentials are in a pass(1) entry formatted as
# follows:
#
# <PASSWORD>
# login: <USERNAME>
# client_id: <CLIENT_ID>
# client_secret: <CLIENT_SECRET>
#!/usr/bin/env python
import base64
import hashlib
import json
import logging
import random
import requests
import string
import uuid
@shtrom
shtrom / ssi-extractor.Dockerfile
Last active April 25, 2023 08:37
A Dockerfile to proccess Apache Server-side Include and dump the fully rendered static files https://blog.narf.ssji.net/2023/04/24/render-apache-server-side-includes-docker/
# usage:
#
# docker build -t ssi-extractor - < Dockerfile
# docker run -v ./www:/usr/local/apache2/htdocs/ -v ./out:/out ssi-extractor
FROM httpd:alpine
RUN apk update \
&& apk add wget
RUN sed -i \

Fix magisk stock backup does not exist

# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
@shtrom
shtrom / html_url_encode.py
Last active July 4, 2022 08:08
urlencode, and escape as html entities, all characters
def encode_all(string):
'''
From https://gist.github.com/Paradoxis/6336c2eaea20a591dd36bb1f5e227da2 via https://stackoverflow.com/a/67629249/10660788
>>> encode_all('<script>console.log("hello")</script>')
'%3c%73%63%72%69%70%74%3e%63%6f%6e%73%6f%6c%65%2e%6c%6f%67%28%22%68%65%6c%6c%6f%22%29%3c%2f%73%63%72%69%70%74%3e'
'''
return "".join("%{0:0>2}".format(format(ord(char), "x")) for char in string)
def escape_all(string):
@shtrom
shtrom / CACert.sh
Last active July 30, 2025 06:40
Backport of CACert update scripts (https://www.qnapclub.eu/fr/qpkg/238) for manual use on Qnap QTS 4.3
#!/bin/sh
CONF=/etc/config/qpkg.conf
QPKG_NAME="CACert"
#QPKG_ROOT=`/sbin/getcfg $QPKG_NAME Install_Path -f ${CONF}`
QPKG_ROOT=$(cd $(dirname ${0}); pwd)
QPKG_NAME1="QPerl"
QPKG_ROOT1=`/sbin/getcfg $QPKG_NAME1 Install_Path -f ${CONF}`
export QNAP_QPKG=$QPKG_NAME