In the middle of the desert you can say anything you want
TIL from my wife in the context of checkbox detection! letters detection fourier transform – Google Suche
TL;DR you can use fourier transforms on letters, that then lead to differentiable results! Bright lines perpendicular to lines in the original letter etc.
Good-bye old personal wiki, AKA Fiamma. Here are some screenshots which will soon become old and nostalgic:
I’ve also archived it, hopefully won’t turn out to be a bad idea down the line (but that ship has sailed long ago…):
Will be using the Links blog from now on: https://serhii.net/links
python - How to have actual values in matplotlib Pie Chart displayed - Stack Overflow:
def absolute_value(val):
a = numpy.round(val/100.*sizes.sum(), 0)
return a
plt.pie(sizes, labels=labels, colors=colors,
autopct=absolute_value, shadow=True)
Can be also used to add more complex stuff inside the wedges (apparently the term for parts of the ‘pie’).
I did this:
def absolute_value(val):
a = int(np.round(val/100.*np.array(sizes).sum(), 0))
res = f"{a} ({val:.2f}%)"
return res
for this:
Based on feedback on a paper I wrote:
Stumbled upon zyedidia/micro: A modern and intuitive terminal-based text editor. Simple text editor that wants to be the successor of nano, CLI-based. The static .tar.gz contains an executable that can be directly run. Played with it for 30 seconds and it’s really neat**.
(Need something like vim for someone who doesn’t like vim, but wants to edit files on servers in an easy way in case nano isn’t installed and no sudo rights.)
There are online resources:
SO thread1 version:
diff <(jq --sort-keys . A.json) <(jq --sort-keys . B.json)
Wrapped it into a function in my .zshrc:
jdiff() {
diff <(jq --sort-keys . "$1") <(jq --sort-keys . "$2")
}
vimdiff is a thing and does this by default!
Otherwise2 diff has the parameters -y, and --suppress-common-lines is useful.
This led to jdiff’s brother jdiffy:
jdiffy() {
diff -y --suppress-common-lines <(jq --sort-keys . "$1") <(jq --sort-keys . "$2")
}
git diff --no-index allows to use git diff without the thing needing to be inside a repo. Used it heavily previously for some of its fancier functions. Say hi to gdiff:
gdiff() {
git diff --no-index "$1" "$2"
}
This is neat: xlsxgrep · PyPI
Supports many grep options.
Rancher
Two ways to run stuff
kubectlVia yaml:
- name: podname
image: "docker/image"
command:
- /bin/sh
- -c
- while true; do echo $(date) >> /tmp/out; sleep 1; done
Kubernetes Workloads and Pods | Rancher Manager
Assigning Pods to Nodes | Kubernetes:
nodeName is a simple direct way
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx
nodeName: kube-01
You can set contexts, and then e.g. the same namespace will be applied to all your commands:
k config set-context main --namespace=my-namespacekubectl to k in the CLI)k get pods -o wide -w returns a detailed overview that is live updated (a la watch)
TIL - when looking how to clean printer heads - that some printers can do it automatically! Can be started both through the OS GUI or the printer itself (if it has buttons and stuff).
Wikihow (lol) as the first result in Google gave me enough to learn about automatic cleaning being a thing: How to Clean Print Heads: Clogged & Dried Up Print Heads; How to Clean a Printhead for Better Ink Efficiency < Tech Takes - HP.com Singapore +