Skip to content

Instantly share code, notes, and snippets.

View chapmanjacobd's full-sized avatar
🥅
goal_net

Jacob Chapman chapmanjacobd

🥅
goal_net
View GitHub Profile
@chapmanjacobd
chapmanjacobd / getty_museum_license.txt
Last active January 18, 2025 21:25
Getty Museum Media Licenses
┌──────────────────────────────────────────────────────────────┬──────────┐
│ license │ count(*) │
├──────────────────────────────────────────────────────────────┼──────────┤
│ https://rightsstatements.org/vocab/CNE/1.0/ │ 2249 │
├──────────────────────────────────────────────────────────────┼──────────┤
│ https://rightsstatements.org/vocab/UND/1.0/ │ 2902 │
├──────────────────────────────────────────────────────────────┼──────────┤
│ https://rightsstatements.org/vocab/InC-RUU/1.0/ │ 3526 │
├──────────────────────────────────────────────────────────────┼──────────┤
│ https://rightsstatements.org/vocab/InC/1.0/ │ 23436 │
@chapmanjacobd
chapmanjacobd / comparing_oss_photo_organizers.md
Last active January 3, 2025 11:46
Comparing OSS Photo Organizers

PhotoPrism, LibrePhotos, Damselfly, and Immich

I chose to compare PhotoPrism, LibrePhotos, and Damselfly, because they seemed like the strongest freely available candidates for a large library of photographs.

I am mostly interested in face clustering (DBSCAN) and other "AI" capabilities like auto-categorization. Import speed is not as important to me as "playback" speed. I don't mind if it takes a few days but once everything is indexed and processed then it should be fast to explore everything.

The dataset that I used for this comparison was under 22GiB but over 750,000 images. Mostly AVIF files but some PNG and some JPEG.

Ease of installation

@chapmanjacobd
chapmanjacobd / un_json.py
Created December 12, 2024 16:53
unjson nested columns
def un_json(input_dict: dict[str, str | float]):
processed_dict = {}
for key, value in input_dict.items():
if isinstance(value, str) and value.startswith(('{', '[')):
try:
processed_dict[key] = json.loads(value)
except json.JSONDecodeError:
processed_dict[key] = value
else:
processed_dict[key] = value
@chapmanjacobd
chapmanjacobd / re_sparse.fish
Created September 7, 2024 12:41
re-sparse hydrated files
function is_sparse_file
set actual_size (du --block-size=1 "$argv" | awk '{print $1}')
set apparent_size (du --block-size=1 --apparent-size "$argv" | awk '{print $1}')
if test $actual_size -eq $apparent_size
return 1
else
return 0
end
end
@chapmanjacobd
chapmanjacobd / btrfs_metadata_corruption.md
Created September 4, 2024 08:29
when lightning strikes
  • reboot
  • sudo btrfs rescue zero-log /dev/sdf1
  • sudo btrfs check -s 1 -b /dev/sdf1
  • sudo mount -o ro,rescue=all /mnt/d1
@chapmanjacobd
chapmanjacobd / not.words.txt
Created September 3, 2024 12:14
13,353 unusual words that are not in /usr/share/dict/linux.words
aaliyah
abbatis
abbrevs
abditos
abdominousness
abductee
abductees
abductive
aber
abest
// ==UserScript==
// @name Hide Seen Rows
// @namespace http://tampermonkey.net/
// @version 0.31
// @description Remember and hide unique rows based on URL
// @author Jacob Chapman
// @match *://*/*
// @grant none
// ==/UserScript==
# tag target commits as demo-start, demo-end
# move to the start of your presentration with `git checkout demo-start`
# use to `git next`, `git prev` to jump between "slides"
git config --global alias.next '!git checkout `git rev-list HEAD..demo-end | tail -1`'
git config --global alias.prev 'checkout HEAD^'
@chapmanjacobd
chapmanjacobd / oops.txt
Last active August 7, 2024 15:46
fixing /etc/security/limits.conf without rebooting
sudoedit /etc/security/limits.conf
# 9223372036854775807 LOL ulimit -n unlimited ?! the max might be 1048576 or 1073741816 but you should just leave this file blank unless you have multiple users that access the system
oops...
sudo: pam_open_session: Permission denied
sudo: policy plugin failed session initialization
Segmentation fault (core dumped)
... terminated by signal SIGSEGV (Address boundary error)
from fractions import Fraction
def f(y, z):
return 108 - (815 - 1500 / z) / y
# Initialize exact values using Fraction for exact arithmetic
xExact = {0: Fraction(4), 1: Fraction(17, 4)}
# Initialize floating point values
xFloat = {0: 4.0, 1: 4.25}