Skip to content

Instantly share code, notes, and snippets.

View phlummox's full-sized avatar

phlummox phlummox

View GitHub Profile
@phlummox
phlummox / README.md
Last active September 17, 2025 14:23
Vagrantfile for debian arm64 guest on x64 host, known to work with vagrant+libvirt

Vagrantfile for a debian 12 guest with arm64 architecture.

Known to work on an Ubuntu 22.04 x64 host, using

  • Vagrant 2.4.9
  • qemu-system-arm 1:6.2+dfsg-2ubuntu6.27
  • vagrant-libvirt 0.12.2

The /usr/share/AAVMF/AAVMF_{CODE,VARS}.fd files are installed as part of qemu-efi-aarch64, so that needs to be installed as well:

@phlummox
phlummox / ds-project-organization.md
Created August 6, 2025 11:27 — forked from ericmjl/ds-project-organization.md
How to organize your Python data science project

UPDATE: I have baked the ideas in this file inside a Python CLI tool called pyds-cli. Please find it here: https://github.com/ericmjl/pyds-cli

How to organize your Python data science project

Having done a number of data projects over the years, and having seen a number of them up on GitHub, I've come to see that there's a wide range in terms of how "readable" a project is. I'd like to share some practices that I have come to adopt in my projects, which I hope will bring some organization to your projects.

Disclaimer: I'm hoping nobody takes this to be "the definitive guide" to organizing a data project; rather, I hope you, the reader, find useful tips that you can adapt to your own projects.

Disclaimer 2: What I’m writing below is primarily geared towards Python language users. Some ideas may be transferable to other languages; others may not be so. Please feel free to remix whatever you see here!

@phlummox
phlummox / translation-style.md
Last active April 16, 2024 16:20
"Problems of translation", by Douglas Hofstadter (from Gödel, Escher, Bach: an Eternal Golden Braid)

Different Styles of Translating Novels

... Suppose you are translating a novel from Russian to English, and come across a sentence whose literal translation is, "She had a bowl of borscht." Now perhaps many of your readers will have no idea what borscht is. You could attempt to replace it by the "corresponding" item in their culture – thus, your translation might run, "She had a bowl of Campbell's soup." Now if you think this is a silly exaggeration, take a look at the first sentence of Dostoevsky's novel Crime and Punishment in Russian and then in a few different English translations. I happened to look at three different

@phlummox
phlummox / delegate.c
Created July 26, 2023 13:57 — forked from rusek/delegate.c
Interpreter path relative to script location in shebang
/*
Helper program for resolving the path to the interpreter executable
relative to the script location in shebangs.
Sample usage:
#!/usr/bin/delegate ../my-virtualenv/bin/python
import sys
def main():
@phlummox
phlummox / Makefile
Last active July 26, 2023 13:58
"relative executor" program
CFLAGS = -pedantic -Wall -Wextra -std=c11 -O2
rel: rel.o
rel.o:
clean:
-rm *.o rel
@phlummox
phlummox / readability-bookmarklets.md
Last active July 9, 2023 08:04
(Mobile) readability bookmarklets

Looking for a bookmarklet which improves readability on mobile devices. Such bookmarklets are sometimes called "declutterers" or "simplifiers".

readable from tastefulwords.com is one of the best-known examples.

Here is a modified and customised version of it by @akaleeroy and others.

But I've found the Mozilla customization of it tends to work better: https://github.com/mozilla/readability.

Readable Bookmarklet

Bookmarklet Browser Enhancement Readability

Readable dark theme

rdbl.us

Readable is an application that helps you read more of the web. It reformats text — on any website — according to your exact specifications.

@phlummox
phlummox / gist:062f8e3faf5524c881714daf5def44f7
Created May 1, 2023 05:40
Debug output of "vagrant up" of box generic/alpine310, version 4.2.16
This file has been truncated, but you can view the full file.
Script started on 2023-05-01 12:07:01+08:00 [TERM="xterm-256color" TTY="/dev/pts/6" COLUMNS="116" LINES="31"]
INFO global: Vagrant version: 2.3.4
INFO global: Ruby version: 2.7.6
INFO global: RubyGems version: 3.1.6
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/mnt/data/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_EXECUTABLE="/mnt/data/opt/vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/bin/vagrant"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
@phlummox
phlummox / emulator-install-using-avdmanager.md
Created February 7, 2023 12:01 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@phlummox
phlummox / new-python-project-with-tox-and-pytest.md
Created January 17, 2023 05:07 — forked from gene1wood/new-python-project-with-tox-and-pytest.md
Example of the directory structure, setup.py, tox.ini and pytest tests for a new python project

Directory structure

projectname/                 [1]
├── projectname              [2]
│   ├── __init__.py
├── README.md
├── setup.py
├── tests
│   └── test_projectname.py