Skip to content

Instantly share code, notes, and snippets.

Avatar

Oliver Gerlich oliver

View GitHub Profile
@oliver
oliver / fix_search_hash.py
Last active Dec 5, 2021
moz_hash.py reimplements the getVerificationHash() method from Mozilla SearchUtils.jsm. fix_search_hash.py uses that to modify the search engine entry.
View fix_search_hash.py
#!/usr/bin/env python3
#
# Adjusts the metaData.hash value in the supplied search.json.mozlz4 file to match the supplied profile path value.
#
import io
import json
import mozlz4a
import os
@oliver
oliver / firefox-priv.sh
Last active Sep 1, 2020
Start Firefox with new profile
View firefox-priv.sh
#!/bin/bash
#
# Starts Firefox with a new temporary profile which is deleted when FF exits.
#
tempdir=$(mktemp -d --tmpdir firefox-priv.XXXXXX)
echo "$(date): starting Firefox with temporary profile at '$tempdir'"
cleanupOnExit ()
@oliver
oliver / dl-cccmedia.py
Last active Dec 31, 2017
fetches video URLs from media.ccc.de
View dl-cccmedia.py
#!/usr/bin/env python
#
# Downloads URLs for all talks of a conference from media.ccc.de.
# Prefers HD videos with many languages.
# Prints a list of URLs, for use eg. with wget -i .
#
import requests
@oliver
oliver / gist:5ed673edc8521b63827b
Created Sep 21, 2014
[PATCH] change test to cover the original problem from rt-84767
View gist:5ed673edc8521b63827b
From 856ce484fc090725525e9781baab2fd02610400f Mon Sep 17 00:00:00 2001
From: Oliver Gerlich <oliver.gerlich@gmx.de>
Date: Sun, 21 Sep 2014 12:46:23 +0200
Subject: [PATCH] change test to cover the original problem from rt-84767
---
t/rt-84767.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/rt-84767.t b/t/rt-84767.t
@oliver
oliver / dct-demo.py
Created Apr 14, 2014
create an animation showing Discrete Cosine Transform and what its frequency levels look like
View dct-demo.py
#!/usr/bin/python
import sys, os
from PIL import Image
import numpy
import scipy.fftpack
sourceImage = sys.argv[1]
image = Image.open(sourceImage)
View mgedit
#!/bin/sh
# Start Gedit in new process (by setting TMPDIR to different value)
export TMPDIR=/tmp/mgedit/
mkdir -p $TMPDIR
NEWTMPDIR=`mktemp -d -t mgedit.XXXXXXXXXX` || exit 1
export TMPDIR=$NEWTMPDIR
/usr/bin/gedit $@ &> $TMPDIR/gedit.log