Skip to content

Instantly share code, notes, and snippets.

@mikegerber
mikegerber / Fix WSL2 vs VPN networking.md
Last active April 18, 2024 15:32
Fix WSL2 vs VPN networking

The problem

WSL2 uses a random network from the 172.16.0.0/12 RFC1918 private IP address block. And our VPN uses that address block, too, with a route metric of 1 (= most preferred.)

This breaks networking for WSL2. Meh!

The solution

While messing around with the interface/route metric of the VPN network may work around the problem, it also reduces the priority of the VPN. We do not really want this. Additionally, changing the interface metric does not seem to be permanent, so it requires more work when it breaks again.

@mikegerber
mikegerber / digisam - How many pages for the year 1666?.ipynb
Created April 28, 2023 17:39
digisam - How many pages in the year 1666?.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mikegerber
mikegerber / dinglehopper_extract.py
Created April 15, 2021 15:56
Extract metrics from dinglehopper JSON exports
import glob
import json
FIELDS = ["gt", "ocr", "cer", "wer", "n_characters", "n_words"]
FILES = glob.glob("*.json")
print("file;" + ";".join(FIELDS))
for f in FILES:
@mikegerber
mikegerber / ocrevaluation_extract.py
Created April 13, 2021 13:20
Extract metrics from ocrevalUAtion HTML reports
from bs4 import BeautifulSoup
import glob
METRICS = ["CER", "WER", "WER (order independent)"]
FILES = glob.glob("*.html")
print("file;" + ";".join(METRICS))
  • Debian 10
  • g++-8 8.3.0-6

To reproduce:

git clone https://github.com/OCR-D/olena.git OCR-D-olena
cd OCR-D-olena
./configure --disable-dependency-tracking --enable-scribo
make -j8
@mikegerber
mikegerber / jpageviewer-profile.sh
Last active July 13, 2021 15:18
jpageviewer alias/function that looks for a mets.xml, i.e. in a OCR-D workspace. For use in `~/.zshrc` or similiar.
_jpageviewer_jar=~/opt/jpageviewer/JPageViewer.jar
if [ -e "$_jpageviewer_jar" ]; then
jpageviewer() {
# --resolve-dir defaults to the file's directory
_jpageviewer_resolve_dir=`dirname "$1"`
# ... unless a mets.xml file exists one directory down (OCR-D workspace)
if [ -e "$_jpageviewer_resolve_dir"/../mets.xml ]; then
_jpageviewer_resolve_dir="$_jpageviewer_resolve_dir"/..
fi
@mikegerber
mikegerber / fix-mets-xlink-hrefs.sh
Created September 25, 2019 16:18
Fix mets.xml for easy cases
@mikegerber
mikegerber / rosenkohl-in-erdnusssoße.md
Created December 10, 2017 22:07
rosenkohl in erdnusssoße

1 netz rosenkohl 1 zwiebel etwas gemüsebrühe

3el erdnussbutter 1-2el sojasoße etwas zitronensaft (nach geschmack) heißes wasser

nicht probiert: zucker