Skip to content

Instantly share code, notes, and snippets.

View olejorgenb's full-sized avatar

Ole Jørgen Brønner olejorgenb

View GitHub Profile
thesamesam /
Last active July 25, 2024 09:00
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.


On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

schacon /
Created January 13, 2024 18:41
Better Git Branch output
# Colors
jscher2000 / syncedTabsToBookmarksHTML.js
Last active July 23, 2024 20:45
Export Synced Tabs List to "bookmarks.html" file (Browser Console script)
// Run code in Browser Console after enabling chrome debugging --
// about:config => => true
try {
var tabPromise = SyncedTabs._internal.getTabClients();
tabPromise.then((arrDevices) => {
if (arrDevices && arrDevices.length > 0){
// Generate a string with the format of a bookmark export file
var d, e, out = '<!DOCTYPE NETSCAPE-Bookmark-file-1>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">\n<TITLE>Bookmarks</TITLE>\n<H1>Bookmarks Menu</H1>\n<DL><p>\n';
const escapeHtmlEntities = function(aText){return (aText || '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;')};
bmaupin /
Last active July 24, 2024 13:32
Alternatives to Llama for Android


Find a replacement for Llama (R.I.P. 😢)


🦙 Keep using Llama! 🦙

  • Llama still works and no other application seems to match Llama in terms of ease of use and cell-tower location (Llama's killer feature)
  • Cell-tower location UX seems to be unmatched by the alternatives (training new locations, ignoring towers, seeing location events)
hurryabit / merge-speedscope-json.js
Last active March 14, 2023 17:06
Merge multiple profiles in Speedscope's JSON format into one file
#!/usr/bin/env node
"use strict";
const fs = require("fs");
const [node, prog, ...options] = process.argv;
if (options[options.length - 2] !== "-o") {
onlurking /
Last active July 22, 2024 13:14
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

JacobHayes /
Last active January 30, 2024 06:22
Reformat python files in git history w/ Black (line=100, py3.7/3.8)
#!/usr/bin/env python3
# Modified from
# pip3 install git-filter-repo black
# git pull
# git remote prune origin # clean up associated local branches too
# python3
# git remote add origin <url>
# git push -u origin --mirror --no-verify
mkows /
Created July 31, 2019 15:16
Allow CORS with python Simple HTTP Server – for Python 3
Based on (in Python 2) -> quick-migrated to Python 3
Usage: python server-cors
import http.server as httpserver
class CORSHTTPRequestHandler(httpserver.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
johnhw /
Last active January 6, 2024 16:09
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
import random
ddevault / Makefile
Last active February 20, 2024 14:17
Tiny Wayland compositor
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h