Skip to content

Instantly share code, notes, and snippets.

View Sancus's full-sized avatar

Andrei Sancus

  • Mozilla
  • Vancouver, British Columbia
View GitHub Profile
@Sancus
Sancus / tb_uptake_history.py
Last active August 25, 2025 21:06
A script that outputs two graphs graph showing the uptake rate of Thunderbird ESRs and the # of support questions relative to uptake, respectively.
#!/usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import json, re
from pathlib import Path
from typing import Dict, Any, Optional
import pandas as pd
import matplotlib.pyplot as plt
@Sancus
Sancus / awsauth.sh
Last active July 17, 2025 18:02
AWS Boto/CLI MFA Authentication
#!/bin/bash
# https://us-east-1.console.aws.amazon.com/iam/home?region=us-east-1#/security_credentials
# Get your MFA ARN from the URL above.
MFA_ARN="arn:aws:iam::<yoursgoeshere>"
DURATION=129600 # 36 hours
# Prompt for MFA code
read -p "Enter MFA code: " MFA_CODE
@Sancus
Sancus / langpack_upload.py
Created April 8, 2022 04:31
Upload language packs to addons.thunderbird.net
import datetime
import glob
import jwt
import random
import requests
import string
import time
from pathlib import Path
# Example download command:
@Sancus
Sancus / bootstrap.js
Created July 7, 2018 23:39
Modify prefs to test addons.thunderbird.net
Components.utils.import("resource://gre/modules/Services.jsm");
function install(aData, aReason) {
Services.prefs.setCharPref("extensions.getAddons.link.url", "https://addons.thunderbird.net/%LOCALE%/%APP%/")
Services.prefs.setCharPref("extensions.getAddons.recommended.url", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/%OS%/%VERSION%?src=thunderbird")
Services.prefs.setCharPref("extensions.getAddons.search.browseURL", "https://addons.thunderbird.net/%LOCALE%/%APP%/search/?q=%TERMS%")
Services.prefs.setCharPref("extensions.getAddons.search.url", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%/%COMPATIBILITY_MODE%?src=thunderbird")
Services.prefs.setCharPref("extensions.getAddons.themes.browseURL", "https://addons.thunderbird.net/%LOCALE%/thunderbird/themes/?src=thunderbird")
Services.prefs.setCharPref("extensions.update.background.url", "https://versioncheck-bg.
package main
import (
"encoding/json"
"fmt"
"github.com/PuerkitoBio/goquery"
"net/http"
)
type PageData struct {