Skip to content

Instantly share code, notes, and snippets.

View antonkratz's full-sized avatar

Anton Kratz antonkratz

View GitHub Profile
@antonkratz
antonkratz / redact.md
Last active June 21, 2025 10:25
readact, flatten, PDF, Ubuntu

There is a sensitive document. Credit card statements. Reimbursement.

I want to redact (hide) parts of the document.

  1. Create a pitch black highlighter pen in Okular. Highlight the relevant text in black.
  2. The text is still there and can easily be seen, for example by highlighting (in the sense of Ctrl-A) the entire document.
  3. To flatten = actually remove the text beneath the black highlights:

pdf2ps in.pdf - | ps2pdf - out.pdf

@antonkratz
antonkratz / UTM.sh
Created November 14, 2023 02:54
quick fixes to Ubuntu under UTM
# When the network is down
sudo ip link set dev enp0s1 down
sudo ip link set dev enp0s1 up
# When the clock gets out of sync
sudo service ntp stop
sudo ntpd -gq
sudo service ntp start
@antonkratz
antonkratz / avoid.txt
Last active February 8, 2024 08:36
An optic for stract
Rule {
Matches { Url("reddit.com") },
Matches { Url("quora.com") },
Matches { Url("vice.com") },
Matches { Url("9to5mac.com") },
Matches { Url("techdirt.com") },
Action(Discard)
};
@antonkratz
antonkratz / akrestoredvimnotes.md
Created October 4, 2025 03:27
vim notes accidentally deleted, a very old version is resotres

Copy and paste with VIM across instances, SSH-borders, different clipboards Use registers for copying and pasting WITHIN one vim instance

Vim saves text in registers. Selecting text and pressing y copies (yanks) text into a register, and pressing p pastes (puts) it.

You can see the register contents with :reg.

Named registers: there are named registers a-z.

Typing "ay will yank the current selection into named register a, and typing "ap will paste text from named register a.