for

$ ls *.zip | parallel unzip {}
$ find . -type f -name "*.zip" -exec unzip '{}' \;
$ kubectl config view
apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://35.228.189.126:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED

PDF commands

$ pdfcrop 1300_math_formulas.pdf
$ pdftk 1300_math_formulas-crop.pdf burst
$ for pdf in pg_*.pdf
do
  echo "${pdf##*/}"
  n=$(basename "${pdf##*/}" .pdf)
  convert -density 300 "${pdf}" -resize 36% "png/${n}-%03d.png"
done
$ mogrify -format jpg -background white -alpha remove -alpha off -quality 75%  *.png
$ rename 's/pg_/m1k3-pg_/g' *.jpg
---
$ pdfimages -all -p a.pdf
$ pdftotext a.pdf
$ for png in *.png
do
  echo "${png##*/}"
  tesseract -l eng "${png}" ./eng/"${png##*/}"
done

FFmpeg

$ ffmpeg -i oo3.mp4 -vf scale=700:-1 -r 10 screenshot-3.gif
$ ffplay https://upload.wikimedia.org/wikipedia/commons/transcoded/d/dc/Galton_box.webm/Galton_box.webm.480p.vp9.webm

https://crontab.guru/

ryoji@ubuntu:~$ sudo iptables -L

Chain DOCKER (6 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             172.22.0.2           tcp dpt:4444
ACCEPT     tcp  --  anywhere             172.22.0.3           tcp dpt:5900
ryoji@ubuntu:~$ ping 172.21.0.1
PING 172.21.0.1 (172.21.0.1) 56(84) bytes of data.
64 bytes from 172.21.0.1: icmp_seq=1 ttl=64 time=0.108 ms
64 bytes from 172.21.0.1: icmp_seq=2 ttl=64 time=0.090 ms
^C
--- 172.21.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1014ms
rtt min/avg/max/mdev = 0.090/0.099/0.108/0.009 ms

ryoji@ubuntu:~$ ping 172.22.0.1
PING 172.22.0.1 (172.22.0.1) 56(84) bytes of data.
64 bytes from 172.22.0.1: icmp_seq=1 ttl=64 time=0.114 ms
^C
--- 172.22.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.114/0.114/0.114/0.000 ms

ryoji@ubuntu:~$ ping 172.22.0.2
PING 172.22.0.2 (172.22.0.2) 56(84) bytes of data.
64 bytes from 172.22.0.2: icmp_seq=1 ttl=64 time=0.112 ms
^C
--- 172.22.0.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1029ms
rtt min/avg/max/mdev = 0.101/0.106/0.112/0.005 ms

ryoji@ubuntu:~$ ping 172.22.0.3
PING 172.22.0.3 (172.22.0.3) 56(84) bytes of data.
64 bytes from 172.22.0.3: icmp_seq=1 ttl=64 time=0.087 ms
^C
--- 172.22.0.3 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2030ms
rtt min/avg/max/mdev = 0.087/0.099/0.111/0.009 ms

ryoji@ubuntu:~$ ping 172.22.0.4
PING 172.22.0.4 (172.22.0.4) 56(84) bytes of data.
From 172.22.0.1 icmp_seq=1 Destination Host Unreachable
^C
--- 172.22.0.4 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3062ms
pipe 4

image.png

image.png

image.png

image.png

kind: ConfigMap
apiVersion: v1
metadata:
  name: config
  namespace: metallb-system
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - 192.168.49.50 - 192.168.49.60

Network Address Port Translation

ryoji@ubuntu:~$ sudo iptables -L
Chain DOCKER (2 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             192.168.49.2         tcp dpt:32443
ACCEPT     tcp  --  anywhere             192.168.49.2         tcp dpt:8443
ACCEPT     tcp  --  anywhere             192.168.49.2         tcp dpt:5000
ACCEPT     tcp  --  anywhere             192.168.49.2         tcp dpt:2376
ACCEPT     tcp  --  anywhere             192.168.49.2         tcp dpt:ssh

Classless Inter-Domain Routing

image.png

image.png

image.png

gateway & router

$ mtr yahoo.co.jp

image.png

image.png

image.png

For example, add NAPT settings that let it go from the internet to a server with a local address.

image.png

Find the global address of the gateway.

image.png

Theoretically this request will be forwarded to port 22 of one of my docker services.

ssh -p 34567 user@111.239.178.96

kubernetes CoreDNS

image.png

image.png

Other stuff

ryoji@ubuntu:~$ sudo pmap 36900
36900:   w
00005567d18f5000     32K r---- w
00005567d18fd000    336K r-x-- w
00005567d1951000  43388K r---- w
00005567d43b0000     20K r---- w
00005567d43b5000      4K rw--- w
00005567d4499000  47088K rw---   [ anon ]
00007f28b5e68000   6148K rw---   [ anon ]
00007f28b6469000   3076K rw---   [ anon ]
00007f28b6a0d000      8K rw---   [ anon ]
00007f28b6a0f000    148K r---- libc-2.31.so
00007f28b6a34000   1504K r-x-- libc-2.31.so
00007f28b6bac000    296K r---- libc-2.31.so
00007f28b6bf6000      4K ----- libc-2.31.so
00007f28b6bf7000     12K r---- libc-2.31.so
00007f28b6bfa000     12K rw--- libc-2.31.so
00007f28b6bfd000     16K rw---   [ anon ]
00007f28b6c01000      4K r---- libdl-2.31.so
00007f28b6c02000      8K r-x-- libdl-2.31.so
00007f28b6c04000      4K r---- libdl-2.31.so
00007f28b6c05000      4K r---- libdl-2.31.so
00007f28b6c06000      4K rw--- libdl-2.31.so
00007f28b6c07000     60K r---- libm-2.31.so
00007f28b6c16000    668K r-x-- libm-2.31.so
00007f28b6cbd000    604K r---- libm-2.31.so
00007f28b6d54000      4K r---- libm-2.31.so
00007f28b6d55000      4K rw--- libm-2.31.so
00007f28b6d56000     28K r---- libpthread-2.31.so
00007f28b6d5d000     68K r-x-- libpthread-2.31.so
00007f28b6d6e000     20K r---- libpthread-2.31.so
00007f28b6d73000      4K r---- libpthread-2.31.so
00007f28b6d74000      4K rw--- libpthread-2.31.so
00007f28b6d75000     16K rw---   [ anon ]
00007f28b6d79000     12K r---- libgcc_s.so.1
00007f28b6d7c000     72K r-x-- libgcc_s.so.1
00007f28b6d8e000     16K r---- libgcc_s.so.1
00007f28b6d92000      4K r---- libgcc_s.so.1
00007f28b6d93000      4K rw--- libgcc_s.so.1
00007f28b6d94000      8K rw---   [ anon ]
00007f28b6dc8000      4K -----   [ anon ]
00007f28b6dc9000      8K rw---   [ anon ]
00007f28b6dcb000      4K r---- ld-2.31.so
00007f28b6dcc000    140K r-x-- ld-2.31.so
00007f28b6def000     32K r---- ld-2.31.so
00007f28b6df8000      4K r---- ld-2.31.so
00007f28b6df9000      4K rw--- ld-2.31.so
00007f28b6dfa000      4K rw---   [ anon ]
00007ffc0eb38000    136K rw---   [ stack ]
00007ffc0eba1000     12K r----   [ anon ]
00007ffc0eba4000      4K r-x--   [ anon ]
ffffffffff600000      4K --x--   [ anon ]
 total           104068K
ryoji@ubuntu:~$ ldd .local/bin/w
    linux-vdso.so.1 (0x00007ffd61da7000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f624afe2000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f624afbf000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f624ae70000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f624ae6a000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f624ac78000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f624daf5000)