Skip to content

Instantly share code, notes, and snippets.

View rcstanciu's full-sized avatar
🦄
Focusing

Rares Stanciu rcstanciu

🦄
Focusing
View GitHub Profile
@rcstanciu
rcstanciu / hand-modify-pdf.md
Created September 4, 2023 21:29 — forked from senderle/hand-modify-pdf.md
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@rcstanciu
rcstanciu / cross.sh
Created November 10, 2021 14:54
Docker cross-compilation mode
#!/usr/bin/env sh
: ${TARGETPLATFORM=}
: ${TARGETOS=}
: ${TARGETARCH=}
: ${TARGETVARIANT=}
: ${OUT_ARCH=}
: ${DPKG_ARCH=}
: ${PKG_PREFIX=}
@rcstanciu
rcstanciu / script.sh
Created November 10, 2021 14:32
Fix Docker BuildX
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name multiarch --driver docker-container --use
docker buildx inspect --bootstrap
# Bash best practices and style-guide
Just simple methods to keep the code clean.
Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/).
## Quick big rules
* All code goes in a function
* Always double quote variables