AnkiLab
Sign in
Download

Immediately suspended cards

A sample of cards I've created and immediately suspended. Explanation here: https://timot.cool/personal-memory-systems-2020

Showing cards 1-8 of 8
Front
pexpect commands
lang
py
Back
child = pexpect.spawn("command")
child.expect(regex)
-> raw output in child.before and child.after (referring to regex)
child.sendline() / child.send()
Front
apply a command (like rm -f myfile) to all commits
lang
git
Back
git filter-branch --tree-filter 'command' HEAD
Front
(gdb) GEF: configure what's displayed on each breakpoint, or change order
lang
Back
gef config context.layout "-legend regs stack code args -source -threads -trace extra memory"

To hide a feature, prepend with - or omit from the list.
Front
date: YYYY-MM-DD format
lang
sh
Back
date +%F
Front
regex flow in python
lang
py
Back
use raw strings (r"...")

import re

regex = r"my regex"
string = "my matching string"
result = re.match(regex, string)
(no need for separate compilation step if only a few regex are used at a time, as their compiled versions are cached)

Then:
result.group("named group 1", "named group 2")
result.group(0)  # entire match
result.group(1, 3)
Front
seconds to human-readable time (HH:MM:SS) using datetime
lang
py
Back
datetime.utcfromtimestamp(seconds).strftime("%H:%M:%S")
Front
(arch) show all the useless packages on the system (dependencies that weren't removed with the packages)
lang
linux
Back
pacman -Qdtq
(Q: query
d: installed as dependencies
t: not required by anything
q: quiet (only package name))
Front
(net) (tls) commands to analyze a TLS-protected Firefox session
lang
Back
sudo tcpdump -w /tmp/capture.pcap -i <interface>
SSLKEYLOGFILE=/tmp/secrets.txt firefox -P --no-remote (using a different profile than the usual one)
editcap --inject-secrets tls,/tmp/secrets.txt /tmp/capture.pcap /tmp/capture-secrets.pcapng
wireshark /tmp/capture-secrets.pcapng
Showing cards 1-8 of 8