Skip to content

Instantly share code, notes, and snippets.

View wsdookadr's full-sized avatar
🎯
Focusing

Stefan Corneliu Petrea wsdookadr

🎯
Focusing
  • Nowhere
  • Nowhere
View GitHub Profile
@wsdookadr
wsdookadr / jq.md
Created March 23, 2025 11:40 — forked from jwbee/jq.md
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

@wsdookadr
wsdookadr / emmc_health.py
Last active March 8, 2025 14:49 — forked from kylemanna/parse-ext-csd.py
Parse eMMC Extended CSD and print useful things.
#!/usr/bin/env python
"""
Upstream: https://gist.github.com/kylemanna/5692543
Blog post: https://blog.kylemanna.com/linux/parse-emmc-extended-csd-ecsd-registers-with-python/
Description: Get eMMC health information
Tested on ASUS T100TA
Example:
root@fedora:/home/user# ./emmc_health.py | rg -i 'LIFE|HEALTH|EOL'
services:
r1:
image: alpine:3.20.3
tty: true
#command: /bin/sh -c "/bin/cat"
volumes:
- type: tmpfs
target: /logs
tmpfs:
size: "4294967296"
@wsdookadr
wsdookadr / software.md
Last active January 30, 2024 21:28
tag-based filesystem software
@wsdookadr
wsdookadr / dice.py
Last active November 25, 2023 17:23
#!/usr/bin/python3
# mawk's problem statement:
# the original question is: how many 6-sided (numbered from 1 to 6) fair dice are needed so that you can form 936 different products of the results?
# with 2 dice you can form the products 1·1, 1·2, …, 6·6
# the issue of course here is that 4 = 2² and 6 = 2·3
# if the dice were numbered with 1 2 3 5 7 11 it would be much easier
S=set([])
D=156
@wsdookadr
wsdookadr / script.sh
Last active January 7, 2024 18:00
split PDF to images for upload to Miro
#!/bin/bash
# same without cropping or merging
PDF="$1"
rm -rf A B C
mkdir A B C 2>/dev/null
pdftk $PDF burst output A/%04d.pdf
find A/*.pdf | xargs -P5 -I{} bash -c '
a={};
b=$(echo $a | sed -e "s/pdf/png/g" | sed -e "s/^A/B/g");
@wsdookadr
wsdookadr / gist:085f8b413d3a65f065dce2626819e7ea
Last active October 8, 2023 00:57
simplified frontends for popular websites
@wsdookadr
wsdookadr / README.md
Last active September 26, 2023 00:57
Elasticsearch Offline Documentation ( using Browsertrix + Kiwix )

Problem

The official Elasticsearch documentation site is protected with Cloudflare Captcha so it can't be directly scraped.

The built-docs repo isn't self-contained (there are external resources, both images and js) and I don't understand how their air_gapped docs work, nor are there instructions on how to use it.