Skip to content

Instantly share code, notes, and snippets.

Firefox: default page zoom without extensions

Big thanks to SeriogaM for finding this out.

https://bugzilla.mozilla.org/show_bug.cgi?id=332275#c52

Background

Firefox by default doesn't have a preference for setting the default page zoom level so you need to use extensions or go changing zoom leven on per-page basis,

@bryanjhv
bryanjhv / vsceext.bash
Created August 25, 2019 08:10
Bash script for downloading VSCode extensions faster
#!/usr/bin/env bash
if [[ $# -lt 2 ]]; then
echo "ERR: Missing arguments."
# requires an SSH server
# arg1: {package}.{extension}@{version}
# arg2 {host}
exit 1
fi
@bryanjhv
bryanjhv / MouseForm.cs
Last active September 24, 2019 07:28
Simple screen area picker for WinForms apps.
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Common
{
public class MouseForm : Form
{
bool down;
Point start;
/**
* Creates ~/.android/{env}.keystore with given arguments
* Requires bcpkix-jdk15on-156.jar and bcprov-jdk15on-156.jar
* Extracted from com.android.ide.common.signing.KeystoreHelper
*/
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigInteger;
@bryanjhv
bryanjhv / find-installed-sap-in-active-directory.ts
Last active June 4, 2023 03:54
Find SAP installation in ActiveDirectory using WScript
;(function(WSH) {
function trim(msg) {
return msg.replace(/\s+/g, '')
}
function log(tag, msg) {
WSH.StdOut.WriteLine(`[${tag}] ${msg}`)
}
function fail(msg) {
log('E', msg)
WSH.Quit(1)
@bryanjhv
bryanjhv / getppa
Last active June 15, 2020 03:10
Get PPA .gpg and .list files easily on Ubuntu
#!/usr/bin/python3
# USAGE:
# getppa git-core/ppa bionic
# getppa certbot/certbot bionic
# getppa git-core/ppa bionic git.%s
# getppa certbot/certbot bionic certbot.%s
from shutil import rmtree
from sys import argv, exit
@bryanjhv
bryanjhv / fake-webcam
Created May 3, 2020 09:38
Create fake webcam for Raspberry Pi (3B+ tested)
#!/usr/bin/env sh
# REQUIRES BUILDING+INSTALLING THIS FIRST:
# https://github.com/umlaeute/v4l2loopback#install
NUM=${2:-0}
PIC=${1:-/usr/share/plymouth/themes/pix/splash.png}
if [ ! -r "$PIC" ]
then
@bryanjhv
bryanjhv / turn.js
Last active May 17, 2020 20:44
TURN REST API for the browser (INSECURE!).
/*
USAGE:
TURN('mysecret', 24 * 60 * 60)
.then(({ username, credential }) => {
console.log({ username, credential })
})
*/
const TURN = ((crypto, encoder) => {
@bryanjhv
bryanjhv / jbadel.py
Created May 19, 2020 21:48
Delete JetBrains IDE Settings Sync (JBA Account) data
#!/usr/bin/env python3
# USAGE:
# 1. Download https://account.jetbrains.com/profile-details/JetBrainsPersonalData.xlsx
# 2. Open with Excel, go to Account sheet (default) and copy "Account ID" value (token)
# 3. Go to your IDE's folder and copy the "name" property from "product-info.json"
# 4. Run:
# export TOKEN=... # step 2
# export PRODUCT=... # step 3
# python3 jbadel.py
import os
import sys
import os.path
import hashlib
base = sys.argv[1]
if not os.path.exists(base):
sys.exit(1)
dirs = []