====== Braindump ======
===== SSH =====
==== sshd: error: Failed to allocate internet-domain X11 display socket. ====
/etc/ssh/sshd_config:
AddressFamily inet
[[http://forums.fedoraforum.org/showthread.php?t=270333]]
==== Upgrade your SSH keys! ====
[[https://blog.g3rt.nl/upgrade-your-ssh-keys.html]]
==== Mozilla OpenSSH Security Guidelines ====
[[https://wiki.mozilla.org/Security/Guidelines/OpenSSH]]
===== DHCP Server mit dnsmasq =====
dnsmasq --no-daemon --log-dhcp --dhcp-range=192.1.1.100,192.1.1.150 --dhcp-option=option:router,192.1.1.1 --dhcp-option=option:dns-server,192.1.1.10
==== Linux Performance Analyse ====
* ps -o wchan - name of the kernel function in which the process is sleeping
* Ein CPU bound und ein I/O bound Prozess laufen auf dem gleichen CPU Kern: Dieser Kern wird zu 100% vom userspace und 0% für I/O wait verwendet; Der I/O bound Prozess wartet aber trotzdem auf I/O, im Monitoring evtl. nicht mehr sichtbar
* iostat: Paralleler I/O: Extended stats: Solange await nicht (signifikant) ansteigt (aber evtl. avgrq-sz) kann das storage backend diese Menge an parallelem I/O gut verarbeiten und die Gesamtleistung steigt. Steigt await ebenfalls an, ist das storage backend an der Grenze seiner Leistungsfähigkeit angelangt.
* MySQL: ps_helper (performance schema)
* lxcfs: Angepasstes /proc für LXC container
* netstat -s: Auf buffer overruns prüfen (und evtl. TCP buffer vergrößern)
* Tools:
* dstat
* nicstat
* procinfo
* nethogs
* atop
* innotop (MySQL)
==== Various ====
* MySQL Benchmarking: 16kB single threaded random writes
* [[http://wiki.openstreetmap.org/wiki/Overpass_API|OpenStreetMap Overpass API]]
===== DDoS protection using Netfilter/iptables =====
[[http://rhelblog.redhat.com/2014/04/11/mitigate-tcp-syn-flood-attacks-with-red-hat-enterprise-linux-7-beta/]]
[[http://people.netfilter.org/hawk/presentations/devconf2014/]]
* SYNPROXY
* state INVALID (sysctl net/netfilter/nf_conntrack_tcp_loose)
===== Exchange EWS Provider (Thunderbird) =====
[[https://github.com/Ericsson/exchangecalendar/releases]]
===== reredirect (dynamically redirect outputs of a running program) =====
[[https://github.com/jerome-pouiller/reredirect/]]
===== reptyr (Reparent a running program to a new terminal) =====
[[https://github.com/nelhage/reptyr]]
===== OOM relation to vm.swappiness=0 in new kernel =====
[[https://www.percona.com/blog/2014/04/28/oom-relation-vm-swappiness0-new-kernel/]]
===== /proc/meminfo =====
[[http://blog.famzah.net/tag/procmeminfo/]]
===== AsItHappens (real-time network statistic collector and grapher) =====
[[http://www.abrahams.co.nz/asithappens/]]
===== BGP for SPAM blacklist distribution =====
[[http://www.bgp-spamd.net/index.html]]
[[http://www.debian-administration.org/article/715/Preventing_SPAM_connections_with_bird.]]
===== MySQL: restore single table from dump =====
sed -n -e '/Table structure for.*`mytable/,/Table structure for/p' whole.sql > mytable.sql
===== MySQL: restore single database from dump =====
sed -n -e '/Current Database: `mydatabase/,/Current Database: `/p' whole.sql > mydatabase.sql
===== The art of command line =====
[[https://github.com/jlevy/the-art-of-command-line]]
===== Froscon 2015 =====
==== Linux Storage Stack ====
* bcache: Entwickler scheint eher chaotisch zu sein, Code eher instabil
* NVMe bietet die Möglichkeit für mehrere queues in HW
* XFS metadata checksums: Neues on-disk Format (v5) [[https://www.kernel.org/doc/Documentation/filesystems/xfs-self-describing-metadata.txt|XFS Self Describing Metadata]]
* dm-compression: teilweise sehr gute Resultate auf flash basiertem Speicher
* dm-dedup: sehr viel versprechend, online (!) deduplication [[https://www.kernel.org/doc/ols/2014/ols2014-tarasov.pdf|Slides]]
==== Linux Netzwerk Stack ====
* [[http://www.strlen.de/talks/linux_netzwerk.pdf|Slides]]
* software interrupts laufen erst komplett am scheduler vorbei, wenn zuviel Zeit auf deren Bearbeitung verwendet wird kümmert sich der ksoftirqd unter der Kontrolle des schedulers um die Bearbeitung
* skb: in-kernel Datenstruktur eines Netzwerkpakets (oder mehrerer, bei aktiven Optimierungen)
==== Various ====
* FlatODF (diffbares OpenDocument) [[http://plugfest.opendocsociety.org/lib/exe/fetch.php?media=plugfests:201210_berlin:fridrichplugfestberlin2012.pdf|Beispiel]]
* Kernel bleibt bei "Calibrating delay loop" stehen: Problem mit Interruptcontroller
* JavaScript "source linking": Verknüpfung zwischen minified und non-minified JS
* "early flushing": Website zB. nach schon an client flushen bevor der Rest der Seite überhaupt gerendert wurde (meist schnellerer Seitenaufbau)
* Probleme: HTTP status code ging schon an client raus (falls später ein Fehler auftritt) => reverse proxies cachen auf dem Weg auch fehlerhafte Seiten (weil HTTP 200, trotz Fehler)
===== ctypes (Funktionen in C libs aus bash ausführen) =====
ctypes.sh is a bash plugin that provides a foreign function interface directly in your shell. In other words, it allows you to call routines in shared libraries from within bash.
[[http://ctypes.sh/]]
===== The TTY demystified =====
[[http://www.linusakesson.net/programming/tty/index.php]]
===== exiftool: strip all EXIF data =====
exiftool -all= -overwrite_original
===== dehydrated deb mit fpm bauen =====
[[https://github.com/lukas2511/dehydrated]]
fpm --input-type dir --output-type deb --name dehydrated --version $(git show --date=short --no-patch --format=format:'%ad-git%H' HEAD) --architecture all --depends curl ./dehydrated=/usr/bin/ ./docs/=/usr/share/doc/dehydrated $(mktemp -d)/=/etc/dehydrated
===== minio deb mit fpm bauen =====
wget https://dl.minio.io/server/minio/release/linux-amd64/minio
chmod +x minio
fpm --input-type dir --output-type deb --name minio --version $(./minio version | awk '/^Version/ { print $2 }') ./minio=/usr/bin/
===== iptables debugging (TRACE target) =====
[[http://backreference.org/2010/06/11/iptables-debugging/]]
===== iproute2 cheat sheet =====
[[http://baturin.org/docs/iproute2/]]
===== IT Landscape for sysadmins =====
[[https://sysadmin.it-landscape.info/]]
===== Moneyplex FP3 in CSV wandeln =====
xmlstarlet sel --text --template --match 'preparedreport/previewpages/page0/b2' --value-of "concat(substring(m27/@u, 1, 10),';',m21/@u,';',m24/@u)" --nl INPUTFILE.fp3
===== JavaCard =====
* [[https://www.motechno.com/uploads/media/J3D081-JCOP2.4.2.pdf|Red Team Pentesting JavaCard Datenblatt]]
* [[https://github.com/Yubico/ykneo-openpgp|OpenPGP Applet (RSA 2048 max)]]
* [[https://github.com/OpenJavaCard/openjavacard-ndef|NDEF Applet]]
* [[https://github.com/Yubico/ykneo-oath|OATH HOTP/TOTP Applet]]
* [[http://frankmorgner.github.io/vsmartcard/remote-reader/README.html|Android NFC reader am PC nutzen]]
* [[https://github.com/martinpaljak/GlobalPlatformPro|Applet Management Tool]]
* [[http://javacard.vetilles.com/tutorial/|JavaCard Programming Tutorial]]
* [[https://github.com/martinpaljak/AppletPlayground|Applet Playground]]
* [[https://github.com/EnigmaBridge/javacard-curated-list|Curated list of JavaCard applications]]
===== Photomatix: Ubuntu 24.04 Container =====
buildah from --name ubuntu-photomatix ubuntu:24.04
wget 'https://www.hdrsoft.com/download/linux/ubuntu/PhotomatixLinux2.0.1_Ubuntu23_24.deb'
buildah add ubuntu-photomatix PhotomatixLinux2.0.1_Ubuntu23_24.deb
buildah run ubuntu-photomatix /bin/bash
apt update
apt install sudo libglib2.0-bin libcurl4t64 libgomp1 dbus-x11 dconf-cli strace
apt install /PhotomatixLinux2.0.1_Ubuntu23_24.deb
dbus-run-session dconf write '/apps/photomatix/license-key' "'the-license-key-goes-here'"
buildah commit ubuntu-photomatix ubuntu-photomatix
podman run -v /tmp/.X11-unix:/tmp/.X11-unix -v /run/user/1000:/run/user/1000 -v $HOME/tmp:/media/tmp --security-opt=label=type:container_runtime_t -e DISPLAY -e XAUTHORITY -e WAYLAND_DISPLAY -e XDG_RUNTIME_DIR localhost/ubuntu-photomatix photomatix