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
@shtrom
shtrom / git2hg_thunderbird.csv
Last active June 2, 2026 01:44
Bug 2032766 - CommitMap: create git2hg.csv for Thunderbird
We can't make this file beautiful and searchable because it's too large.
git,hg
a5e1b64286aab71099ac2bfb681702067ee8d91c,2f69e0a3a05a4ca457c2d1472151573cf3825f59
cbd6e77b2aaf238c655368bcafcf74c3390d65d6,1a2269db784268294c185062ad1fccc7d6b552c9
954fd4b6eac194c264462a5b1f7c80cb6dd168a9,d6379755a5390980f0e6981d832326aca8dd00e3
f95c5e0988118422bc926c540b7f3f86d16991da,c9623c37501d57d05fc35f3dc673632b4479a756
1aedf473612ef4a81076410f103c21832fb7965d,279a7aa9624ffb41326b021ff7d8bc68b9b89551
83efae60f427c41b7d73cb3dc1a6c6503c9790b2,a86a99608c6520a6ee6638ba1cdb33c881bc82c9
c97babdeb088b649e154d0b10f57f447648ec95f,40aa5b77ae5f2b4956686f36887ddf0ee15fb501
ca753fb606fba95fb1423998074c82ad250f3780,30fe93cb92f687d87f2215041498528d06ab5bc9
f5c0918dd08d8013552c65d2f8f876e321575621,c1537be28a2cf77a06139cc03405e44fd7da63fe
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
268548fa2dc202b6b7c5c5ede550b7b0ae1433bd,2a4ae2694d465cea9714a6e604727fdb5ac6f41d
@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):