Skip to content

Instantly share code, notes, and snippets.

View wsdookadr's full-sized avatar
🎯
Focusing

Stefan Corneliu Petrea wsdookadr

🎯
Focusing
View GitHub Profile
@wsdookadr
wsdookadr / adapting-elilo.txt
Last active March 10, 2024 03:53
Slackware 15 install procedure
Adapting elilo to storage changes
=================================
Suppose you've installed Slackware 15 on a laptop with
/dev/sda1 (boot)
/dev/sda2 (root)
/dev/sda3 (swap)
But then you upgrade to a different SSD which instead of
/dev/sda{1,2,3} has /dev/nvme0n1p{1,2,3}.
@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.

@wsdookadr
wsdookadr / Dockerfile
Created September 10, 2023 03:08
docker setup template based on slackware image
FROM vbatts/slackware:15.0
LABEL maintainer "Stefan Corneliu Petrea <stefan.petrea@gmail.com>"
RUN slackpkg update
COPY bashrc /root/.bashrc
RUN source ~/.bashrc && slackpkg_unatt install ca-certificates perl rsync lz4 cyrus-sasl curl zstd xxHash nghttp2 brotli gcc make binutils patch
RUN update-ca-certificates -f
RUN wget -O sbopkg.tgz https://github.com/sbopkg/sbopkg/releases/download/0.38.2/sbopkg-0.38.2-noarch-1_wsr.tgz
RUN upgradepkg --install-new sbopkg.tgz
RUN mkdir -p /var/lib/sbopkg/queues /var/lib/sbopkg/SBo/15.0