Site Tools


onny:notizen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
onny:notizen [2023/05/10 08:40] – [ip] 10.200.0.1onny:notizen [2026/09/17 13:08] (current) – [kernel] 10.250.0.1
Line 1: Line 1:
-===== kernel ===== 
- 
-grep kernel config running system 
-<code bahs> 
-zcat /proc/config.gz | grep VDSO 
-</code> 
- 
-===== fish ===== 
- 
-unset history 
-<code> 
-fish --private 
-</code> 
- 
 ===== bash ===== ===== bash =====
  
Line 101: Line 87:
 chmod +x $FILE chmod +x $FILE
 $FILE "$@" $FILE "$@"
-</code> 
-==== sed ==== 
-Mit sed inplace eine Zeile zu einer Datei hinzufügen: 
-<code bash> 
-sed -i '9i#include <algorithm>' liboffsetfinder64/vmem.cpp 
-</code> 
-add to end of file  
-<code bash> 
-sed -i -e '$aretry $@' retry.sh 
-</bash> 
-Comment out specific line matching a string 
-<code bash> 
-sudo sed -e '/pam_securetty.so/ s/^#*/#/' -i delugecontainer/etc/pam.d/login 
-</code> 
-comment out multiple lines / range 
-<code bash> 
-sed -i "28,33 s/# *//" autogen.sh 
-</code> 
-regex parse value of xml tags 
-<code bash> 
-sed -n 's/.*<id>\(.*\)<\/id>.*/\1/p' myfile.txt 
-</code> 
-delete multiple lines 
-<code bash> 
-sed -i '2,3d;5d;8d' file 
 </code> </code>
  
-insert line after match 
-<code bash> 
-sed  '/\[option\]/a Hello World' input 
-</code> 
 ==== grep ==== ==== grep ====
 regex match group regex match group
Line 138: Line 95:
 </code> </code>
  
-==== fd ==== 
-search for all files with specific extension in directory / 
-<code bash> 
-fd --type f -e fm . / 
-</code> 
- 
-zip all files with specific file extension 
-<code bash> 
-fd -t f -e fm . / | zip source -@ 
-</code> 
- 
-file creation timespan 
-<code bash> 
-fd --type f -e pdf --change-newer-than "2020-09-09" --changed-before "2020-10-01" . 
-</code> 
- 
-execute command 
-<code bash> 
-fd --type f -e doc -e docx -e pdf -i gabriel -x cp --backup=t {} /tmp/gabriel/ 
-</code> 
- 
-find filenames unallowed characters 
-<code bash> 
-fd '[^A-Z a-züö@0-9._-]' remote/200_Archiv/CP_Dont_Touch 
-</code> 
- 
-==== curl ==== 
-post data 
-<code bash> 
-curl --data "UserId=eb8c2ec5352843d3a16ca11c26d3551c&Name=lolorollo&api_key=a5dc4e***9c9e0a***3" "https://turbotux.de/Playlists?UserId=eb8c2ec5352843d3a16ca11c26d3551c&Name=lolorollo&api_key=a5***d***9e0***3" 
-</code> 
-download and extract archive 
-<code bash> 
-curl http://wordpress.org/latest.tar.gz | tar xvz 
-</code> 
-set host header 
-<code bash> 
-torify curl --header "Host: http.pi" blog.project-insanity.org 
-</code> 
  
 ==== patching ==== ==== patching ====
Line 197: Line 115:
 <code> <code>
 fd . | xargs -I {} rm "{}" fd . | xargs -I {} rm "{}"
 +</code>
 +===== date =====
 +
 +convert date to unix timestamp
 +
 +<code bash>
 +date -d "1990-01-01" +%s
 +</code>
 +
 +convert unix timestamp to datetime
 +
 +<code bash>
 +date -d @1254330900 '+%Y-%m-%d %H:%M:%S'
 </code> </code>
 ===== rsync ===== ===== rsync =====
Line 222: Line 153:
 </file> </file>
 ===== networking ===== ===== networking =====
 +==== ip ====
 +
 +set new address
 +
 +<code bash>
 +ip addr flush dev enp7s0f4u2
 +ip addr add 10.42.0.2/24 dev enp7s0f4u2
 +ip link set enp7s0f4u2 up
 +</code>
 +
 +add route
 +
 +<code bash>
 +ip route add default via 10.42.0.1 dev usb0
 +</code>
 ==== nftables ==== ==== nftables ====
 +
 <code bash> <code bash>
 nft list ruleset nft list ruleset
Line 228: Line 175:
 nft -f ruleset.nft nft -f ruleset.nft
 </code> </code>
 +
 display handles, insert rule at position display handles, insert rule at position
 +
 <code bash> <code bash>
 nft -a list ruleset nft -a list ruleset
Line 347: Line 296:
 Constant quality AV1.  The CRF value can be from 0–63. Lower values mean better quality. Constant quality AV1.  The CRF value can be from 0–63. Lower values mean better quality.
 <code bash> <code bash>
-ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -strict experimental av1_test.mp4+ffmpeg -i input.mov -c:v libsvtav1 -crf 30 -preset 6 -svtav1-params tune=0 -c:a libopus -b:a 128k output.webm
 </code> </code>
 Burn subtitles, fast video conversion Burn subtitles, fast video conversion
Line 353: Line 302:
 ffmpeg -i Kawamata\ -\ La\ passage\ des\ chaises.mkv -vf subtitles=Kawamata\ -\ La\ passage\ des\ chaises.mkv -acodec copy -preset:v ultrafast Kawamata\ -\ La\ passage\ des\ chaises.mp4 ffmpeg -i Kawamata\ -\ La\ passage\ des\ chaises.mkv -vf subtitles=Kawamata\ -\ La\ passage\ des\ chaises.mkv -acodec copy -preset:v ultrafast Kawamata\ -\ La\ passage\ des\ chaises.mp4
 </code> </code>
-==== batch convert images ==== +
-<code bash> +
-for i in *.jpeg; convert -resize 30% $i (string replace jpeg jpg $i); end +
-</code>+
 ==== lossless mp3 merge ==== ==== lossless mp3 merge ====
 <code bash> <code bash>
Line 373: Line 319:
 </code> </code>
 ===== security ===== ===== security =====
 +
 +==== age ====
 +
 +encrypt secret
 +<code>
 +echo -n "mypassword" > /tmp/hannypw
 +age -e -r "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAABCDEFGMbPeQlq4nw3jQPqG4qYV3TEVCCSz4Aa4gH picloud@picloudrv" -o stalwart-mail-user-crux.age /tmp/hannypw
 +</code>
  
 ==== web discovery ==== ==== web discovery ====
Line 434: Line 388:
 chromium --ignore-gpu-blacklist chromium --ignore-gpu-blacklist
 </code> </code>
-===== docker =====+===== vscodium =====
  
-Pull+shortcut toggle block comment
 <code bash> <code bash>
-docker pull ubuntu:22.04 +Ctrl + Shift + A
-docker pull rootlogin/nextcloud:develop+
 </code> </code>
  
-Run+add and jump to bookmark (requires extension)
 <code bash> <code bash>
-docker run -td ubuntu:22.04+Ctrl + Alt + K 
 +Ctrl + Alt + J
 </code> </code>
- 
-Executing 
-<code bash> 
-docker exec -it ffffdfdfsdfsdfsfsffsdfs /bin/bash 
-</code> 
- 
-Nextcloud 
-<code bash> 
-docker run -d -p 80:80 rootlogin/nextcloud 
-docker run -v /home/onny/projects/nextcloud-app-radio:/opt/nextcloud/apps/radio -d --name nextcloud -p 80:80 rootlogin/nextcloud 
-</code> 
- 
-Debugging it 
-<code bash> 
- docker run -i -t e326cbb922aa /bin/bash # exec shell of image 
- docker exec -i -t e326cbb922aa /bin/bash # exec new shell running container  
-</code> 
- 
-Pull from repository 
-<code> 
- docker pull eugeneware/docker-wordpress-nginx 
- docker run -p 80:80 -d docker-wordpress-nginx 
- docker ps 
- docker commit e5a70884ac44 eugeneware/docker-wordpress-nginx:aenderungen1 
- # docker stop / run 
- docker run -t -i -v /home/onny/projects/web-whackspace:/usr/share/nginx/www/wp-content/themes/whackspace -p 80:80 -d e326cbb922aa 
- docker run -i -t e326cbb922aa /bin/bash 
-</code> 
- 
-Build from Dockerfile 
-<code> 
- cd  ~/projects/docker-invoiceplane-nginx 
- sudo docker build -t="docker-invoiceplane-nginx" . 
- sudo docker run -p 80:80 -d docker-invoiceplane-nginx 
-</code> 
-Build from URL 
-<code bash> 
-docker build -t nextcloud-testing github.com/onny/docker-nextcloud 
-</code> 
-Delete image 
-<code bash> 
-docker rmi <image name / id> 
-</code> 
-Export and load image 
-<code bash> 
-docker save myimage > myimage.tar 
-docker load < myimage.tar 
-</code> 
-Remove all images and containers 
-<code> 
-docker system prune -a 
-</code> 
-docker stop all container 
-<code bash> 
-docker stop (docker ps -a -q) 
-</code> 
-prevent from auto start 
-<code bash> 
-docker update --restart=no client-iaro_db_1 
-</code> 
-docker commit container and rerun 
-<code bash> 
-$ docker ps  -a 
-CONTAINER ID        IMAGE                 COMMAND                  CREATED              STATUS                          PORTS               NAMES 
-    5a8f89adeead        ubuntu:14.04          "/bin/bash"              About a minute ago   Exited (0) About a minute ago                       agitated_newton 
-$ docker commit 5a8f89adeead newimagename 
-$ docker run -ti -v "$PWD/dir1":/dir1 -v "$PWD/dir2":/dir2 newimagename /bin/bash 
-</code> 
- 
-Run emulated multiarch images 
-<code bash> 
-docker run --rm --privileged multiarch/qemu-user-static --reset -p yes 
-docker run --rm -t arm32v7/alpine uname -m 
-docker run -it --rm arm32v7/alpine ash 
-# keep it running 
-docker run -d -it --name alpine-armv7 --platform linux/arm/v7 arm32v7/alpine /bin/sh 
-</code> 
- 
-==== wordpress docker image ==== 
-<file yml docker-compose.yml> 
-version: '3' 
- 
-services: 
-   db: 
-     image: mysql:5.7 
-     volumes: 
-       - db_data:/var/lib/mysql 
-     restart: always 
-     environment: 
-       MYSQL_ROOT_PASSWORD: somewordpress 
-       MYSQL_DATABASE: wordpress 
-       MYSQL_USER: wordpress 
-       MYSQL_PASSWORD: wordpress 
- 
-   wordpress: 
-     depends_on: 
-       - db 
-     image: wordpress:latest 
-     volumes: 
-       - .:/var/www/html/wp-content/themes/ausstellung-virtuell         
-     ports: 
-       - "8000:80" 
-     restart: always 
-     environment: 
-       WORDPRESS_DB_HOST: db:3306 
-       WORDPRESS_DB_USER: wordpress 
-       WORDPRESS_DB_PASSWORD: wordpress 
-volumes: 
-    db_data: 
-</file> 
-Note the mount instruction in the volumes section, providing the local theme to the wordpress container. 
-<code bash> 
-docker-compose up -d 
-</code> 
-Visit 127.0.0.1:8000 
- 
 ===== eigenes system setup ===== ===== eigenes system setup =====
 ==== signatures ==== ==== signatures ====
Line 568: Line 406:
 </code> </code>
  
-===== ansible ===== +
-Run single command +
-<code bash> +
-ansible playground.pi -i hosts -m shell -a "whoami" +
-</code> +
-Limit playbook to specific host from group +
-<code bash> +
-ansible-playbook -i hosts archlinux-syssetup.yml -l playground.pi --ask-become-pass +
-</code> +
-Running single ansible role +
-<file - picloud.yml> +
-  roles: +
-     - { role: nsupdate, tags: nsupdate } +
-</file> +
-<code bash> +
- ansible-playbook -i hosts --ask-become-pass picloud.yml --tags 'nsupdate' +
-</code> +
-Directly define server without inventory file +
-<code bash> +
-ansible-playbook -i "192.168.1.23," wgnas.yml --ask-become-pass +
-</code> +
-Skip specific role by tag +
-<code bash> +
-ansible-playbook --inventory-file=.vagrant/provisioners/ansible/inventory -v picloud.yml --skip-tags mount +
-</code> +
-==== playbook ==== +
-Include distribution specific vars, e.g. ''vars/Archlinux.yml'' or ''vars/Debian.yml'' +
-<file - tasks/main.yml> +
-- name: Include OS-specific variables. +
-  include_vars: "{{ ansible_os_family }}.yml" +
-</file> +
-use encrypted vars with vault +
-<code bash> +
-ansible-vault encrypt_string --vault-password-file ~/.ansible_vault_pw my_secret +
-</code> +
-<file - vars/auth.yml> +
-notsecret: myvalue +
-mysecret: !vault | +
-          $ANSIBLE_VAULT;1.1;AES256 +
-          66386439653236336462626566653063336164663966303231363934653561363964363833313662 +
-          6431626536303530376336343832656537303632313433360a626438346336353331386135323734 +
-          62656361653630373231613662633962316233633936396165386439616533353965373339616234 +
-          3430613539666330390a313736323265656432366236633330313963326365653937323833366536 +
-          34623731376664623134383463316265643436343438623266623965636363326136 +
-other_plain_text: othervalue +
-</file> +
-<code bash> +
-ansible-playbook -i hosts -v piradio.yml --ask-become-pass --vault-password-file ~/.ansible_vault_pw +
-</code> +
-conditions +
-<code yml> +
-- name: Enable ufw service +
-  service: +
-    name: ufw +
-    enabled: yes +
-  when: ufw_state == "enabled" +
-</code>+
  
 ===== podcasts ===== ===== podcasts =====
Line 670: Line 452:
 </code> </code>
 ==== git ==== ==== git ====
 +
 +git fetch remote branch of a pull request
 +<code>
 +git fetch upstream pull/518799/head:pr-518799
 +git checkout pr-518799
 +</code>
 +
 +git show, list only affected files
 +<code bash>
 +git show 45d2d903d507e8c8ce0c766243af103baa1bbe24 --name-only
 +</code>
 +
 +unstage changes to a specific file of a specific commit
 +<code bash>
 +git rebase -i 19d0900f23e0b29fc2706dbbf8a806cea7c3e0f2^
 +git restore --staged --source=HEAD^ -- pkgs/by-name/op/openproject/package.nix
 +git restore -- pkgs/by-name/op/openproject/package.nix
 +git commit --amend
 +git rebase --continue
 +</code>
 +
 +git rebase --onto, change base of current branch to one commit before 2c1231... but keep every commits after 52d639995...
 +
 +<code bash>
 +git rebase --onto 2c1231d61dad184b6ebcff43bb5487a2cdfcc760~1 52d639995ffe58e3dc9de3c9d4193c2188133793
 +</code>
 +
 +merge changes into last commit
 +<code bash>
 +git commit -a --amend --no-edit
 +</code>
 +
 show remote origin show remote origin
 <code bash> <code bash>
 git remote show origin git remote show origin
 </code> </code>
 +
 change remote origin change remote origin
 <code bash> <code bash>
 git remote set-url origin gitlab@http-new.pi:onny/web-wikidict.git git remote set-url origin gitlab@http-new.pi:onny/web-wikidict.git
 </code> </code>
-tagging +
-<code bash> +
-git tag -a v0.1 -m 'whackspace wordpress theme init' +
-</code>+
 merge commits from a remote repository merge commits from a remote repository
 +
 <code bash> <code bash>
 git fetch https://github.com/rfc2822/davdroid.git master git fetch https://github.com/rfc2822/davdroid.git master
Line 758: Line 571:
 git rebase upstream/master git rebase upstream/master
 </code> </code>
 +
 squash commits squash commits
 +
 <code bash> <code bash>
 git rebase -i upstream/master git rebase -i upstream/master
 # < choose squash for all of your commits, except the first one > # < choose squash for all of your commits, except the first one >
 # < Edit the commit message to make sense, and describe all your changes > # < Edit the commit message to make sense, and describe all your changes >
-git push origin omgpull -f +# or
-</code> +
-alternatively +
-<code bash>+
 git rebase -i HEAD~3 git rebase -i HEAD~3
-</code> +# or (replace main with origin branch) 
-alternatively +git rebase -i $(git merge-base HEAD main) 
-<code bash>+# or
 git merge --squash apple-a9 git merge --squash apple-a9
 </code> </code>
 +
 rerun tests with empty commit rerun tests with empty commit
 <code bash> <code bash>
 git commit --allow-empty -m 'run tests again' git commit --allow-empty -m 'run tests again'
 git push --set-upstream USERNAME mynewbranch git push --set-upstream USERNAME mynewbranch
-</code> 
-change message of last git commit 
-<code bash> 
-git commit --amend 
 </code> </code>
 force push, remove latest commit of remote repository (origin) force push, remove latest commit of remote repository (origin)
Line 807: Line 616:
 git commit --all --amend --no-edit git commit --all --amend --no-edit
 git rebase --continue git rebase --continue
-</code> 
- 
-add co-author / co-authors to commit 
-<code bash> 
-git commit --amend 
-# Add line: Co-authored-by: name <name@example.com> 
 </code> </code>
 ===== yum ===== ===== yum =====
Line 848: Line 651:
 nmap -p 80 192.168.188.0/24 -n --open --script /usr/share/nmap/scripts/http-title.nse nmap -p 80 192.168.188.0/24 -n --open --script /usr/share/nmap/scripts/http-title.nse
 </code> </code>
-===== debian ===== +
-which package provides file XY +
-<code bash> +
-apt-file update +
-apt-file search netstat +
-</code> +
-extract deb package +
-<code bash> +
-ar x *.deb +
-</code>+
 ===== Makefile ===== ===== Makefile =====
 define variables with preset which can be overwritten define variables with preset which can be overwritten
Line 889: Line 683:
 </code> </code>
 ===== mail ===== ===== mail =====
 +
 +test imap login
 +<code>
 +openssl s_client -connect mx1.project-insanity.org:993 -crlf
 +# a1 LOGIN <username> <password>
 +# a2 LOGOUT
 +</code>
 +
 echo mail server echo mail server
 <code> <code>
Line 894: Line 696:
 </code> </code>
   * check spamminess of email server: https://www.mail-tester.com/   * check spamminess of email server: https://www.mail-tester.com/
-  * manual imap login +
-openssl imaps login +
-<code> +
-openssl s_client -connect mail.sexypump.de:993 -crlf +
-A login cypherpunk cypherpunk +
-</code> +
-get quota +
-<code> +
-a GETQUOTAROOT INBOX +
-</code> +
-get msg count of folder +
-<code> +
-a LIST INBOX * +
-* LIST (\HasChildren) "." INBOX +
-* LIST (\HasNoChildren \UnMarked) "." "INBOX.Deleted Messages" +
-* LIST (\HasNoChildren \UnMarked) "." "INBOX.Sent Messages" +
-* LIST (\HasNoChildren \UnMarked \Trash) "." INBOX.Trash +
-* LIST (\HasNoChildren \UnMarked \Sent) "." INBOX.Sent +
-* LIST (\HasNoChildren \UnMarked) "." INBOX.Notes +
-* LIST (\HasNoChildren \UnMarked \Junk) "." INBOX.Junk +
-* LIST (\HasNoChildren \UnMarked \Drafts) "." INBOX.Drafts +
-* LIST (\HasNoChildren \UnMarked) "." INBOX.AntiSpam +
-a OK List completed (0.001 + 0.000 secs). +
-a SELECT INBOX +
-</code>+
 send smtp mail send smtp mail
 <code> <code>
Line 934: Line 712:
 DONE DONE
 </code> </code>
-===== Android ===== +
-installed apps +
-<code> +
-antennapod davx5 dbnavigator fdroid fennec icsx5 jellyfin keepassdx libreoffice vlc nextcloud quicklyric radiodroid signal soundhound spotify tasks documentviewer fdroid-privilegedextension +
-</code> +
-configurations +
-  * antennpod subscriptions +
-  * fdroid pi repo +
-  * davx calendar & contacts +
-  * jellyfin config +
-  * nextcloud config +
-  * signal backup +
-  * radiodroid station list +
-  * spotify config +
-flash recovery +
-<code bash> +
-heimdall flash --RECOVERY twrp-3.2.1-1-serranoltexx.img +
-</code> +
-anbox +
-<code bash> +
-pacman -S anbox-git anbox-image anbox-modules-dkms-git +
-modprobe binder_linux ashmem_linux +
-systemctl restart anbox-container-manager +
-systemctl --user restart anbox-session-manager +
-anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity +
-wget "https://f-droid.org/FDroid.apk" +
-adb install FDroid.apk +
-</code>+
 ====== davdroid ====== ====== davdroid ======
 <code> <code>
Line 1062: Line 813:
 </code> </code>
 ===== systemd ===== ===== systemd =====
 +
 +systemctl show unit environment
 +<code>
 +systemctl show rsshub --property=Environment
 +</code>
 +
 service hardening service hardening
 <code> <code>
Line 1095: Line 852:
 RestrictNamespaces=true RestrictNamespaces=true
 </code> </code>
-===== nixos =====+===== nix =====
  
-apply changes to system+nix repl usage 
 + 
 +<code bash> 
 +nix repl --expr 'let eval = import <nixpkgs/nixos/lib/eval-config.nix>system = "x86_64-linux"; modules = []; }; in eval' 
 +:p options.services.nextcloud.settings 
 +</code>
  
 <code> <code>
-sudo nixos-rebuild switch --flake '/etc/nixos#joes-desktop' +nix repl nixpkgs 
-sudo nixos-rebuild boot --flake '/etc/nixos#joes-desktop' # raspi specific+> legacyPackages.x86_64-linux.hello
 </code> </code>
  
-update channel, rebuild and switch+run tests interactive
  
 <code bash> <code bash>
-nixos-rebuild switch --upgrade+nix build -L .#nixosTests.quake3.driverInteractive 
 +./result/bin/nixos-test-driver 
 +start_all()
 </code> </code>
  
-search package+get attributes of test
  
 <code bash> <code bash>
-nix search gedit+nix eval .#nixosTests.nextcloud --apply builtins.attrNames --json 
 +["with-imaginary34"
 +nix build -L .#nixosTests.nextcloud.with-imaginary34
 </code> </code>
  
-nixos testing environement+===== nixos =====
  
-<code bash+apply changes to system 
-nix-shell -p toilet+ 
 +<code> 
 +sudo nixos-rebuild switch --flake '/etc/nixos#joes-desktop'
 </code> </code>
  
-install unstable package+search package
  
 <code bash> <code bash>
-nix-channel --add https://nixos.org/channels/nixos-unstable unstable +nix search gedit
-nix-channel --update unstable +
-nix-env -iA unstable.pdfarranger+
 </code> </code>
  
Line 1164: Line 930:
   ];   ];
 </code> </code>
 +
 garbade collector garbade collector
 <code bash> <code bash>
 nix-collect-garbage -d nix-collect-garbage -d
 </code> </code>
 +
 list package files list package files
 <code bash> <code bash>
 find $(nix eval -f /etc/nixos/apps --raw xerox6000-6010.outPath) find $(nix eval -f /etc/nixos/apps --raw xerox6000-6010.outPath)
 </code> </code>
 +
 install package install package
 <code bash> <code bash>
 nix-env -i icecat nix-env -i icecat
 </code> </code>
 +
 remove package remove package
 <code bash> <code bash>
Line 1205: Line 975:
 source venv/bin/activate source venv/bin/activate
 pip install -r requirements.txt pip install -r requirements.txt
-</code> 
- 
-local repository (nixpkgs clone) as systemwide channel  
- 
-<code bash> 
-$ nix-build nixos/release.nix -A channel --arg nixpkgs  '{ outPath = ./. ; revCount = "'$(git rev-list HEAD | wc -l)'"; shortRev = "'$(git rev-parse --short HEAD)'"; }' 
-... 
-/nix/store/hash-name/ 
-$ sudo nix-channel --remove nixos 
-$ sudo nix-channel --add file:///nix/store/hash-name/tarballs/thetarball.tar.xz nixos 
-$ sudo nix-channel --update 
 </code> </code>
  
Line 1250: Line 1009:
 curl -sL https://github.com/NixOS/nixpkgs/pull/64977.patch \ curl -sL https://github.com/NixOS/nixpkgs/pull/64977.patch \
                 | head -n 1 | grep -o -E -e "[0-9a-f]{40}"                 | head -n 1 | grep -o -E -e "[0-9a-f]{40}"
-</code> 
-allow unfree package installation nix-env 
-<code bash> 
-env NIXPKGS_ALLOW_UNFREE=1 nix-env -f /home/onny/projects/nur-packages -iA ocenaudio 
 </code> </code>
  
Line 1285: Line 1040:
  
 <code bash> <code bash>
-git clone https://github.com/NixOS/nixpkgs.git 
-cd nixpkgs 
 nixpkgs-review pr 98044 nixpkgs-review pr 98044
 +nixpkgs-review wip --build-args="-j3"
 </code> </code>
  
Line 1301: Line 1055:
 <code> <code>
 command-not-found telnet command-not-found telnet
-</code> 
- 
-use module from unstable 
- 
-<code> 
-let  
- 
-  # FIXME 
-  unstableTarball = 
-    fetchTarball 
-      https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz; 
- 
-in 
-{ 
- 
-  disabledModules = [ 
-    "programs/firejail.nix" 
-    "services/web-apps/nextcloud.nix" 
-  ]; 
- 
-  imports = [ 
-    "${fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"}/nixos/modules/services/security/opensnitch.nix" 
-    /home/onny/projects/nixpkgs2/nixos/modules/services/networking/create_ap.nix 
-  ]; 
-  nixpkgs.config.packageOverrides = pkgs: rec { 
-    unstable = import unstableTarball { }; 
-    opensnitch = unstable.opensnitch; 
-  }; 
-  #services.opensnitch.enable = true; 
-</code> 
- 
-overlay: use / overwrite package from custom remote or local repo / fork: 
- 
-<code> 
-  nixpkgs.overlays = [ 
-    (self: super: { 
-      foo2zjs = (import (builtins.fetchTarball { 
-        url = 
-          "https://github.com/onny/nixpkgs/archive/foo2zjs.tar.gz"; 
-        sha256 = "1jp98jhc4mw9bipdiq7qdrzn3lslk4mi7prqfh2v43isgsvpd6bg"; 
-      }) { config = { allowUnfree = true; }; }).foo2zjs; 
-      linux-wifi-hotspot = (import /home/onny/projects/nixpkgs2 {}).linux-wifi-hotspot; 
-    }) 
-  ]; 
 </code> </code>
  
Line 1363: Line 1073:
 </code> </code>
  
-use local src / source+override only source hash
  
 <code> <code>
-  src /home/onny/projects/linux-wifi-hotspot+django-oauth-toolkit super.django-oauth-toolkit.overrideAttrs (old: { 
-  unpackPhase ''cp -r --no-preserve=mode $src/* .'';+  version = "3.3.0"; 
 + 
 +  src old.src.override { 
 +    hash = "sha256-eRQzAFUvSgoDiP7LW/+hMrNxHuXVxY+wc/E3VU/zeXo="; 
 +  }; 
 +});
 </code> </code>
  
Line 1376: Line 1091:
 </code> </code>
  
-package overlay and override attributes+locate / search file belongs to which package 
 +<code> 
 +nix-locate -w libnss3.so 
 +</code>
  
 +list package content
 <code> <code>
-  nixpkgs.overlays = [ +tree (nix-instantiate --eval -'with import <nixpkgs> {}; glibcLocales.outPath' | xargs)
-    (self: super: { +
-      foo2zjs = (import (builtins.fetchTarball { +
-        url = +
-          "https://github.com/onny/nixpkgs/archive/foo2zjs.tar.gz"; +
-        sha256 = "0dsix1vp4canialzj4rp51i35lhdk28yndnnj62i0brzlng7jdrk"; +
-      }) {} ).foo2zjs; +
-      wordpress = super.wordpress.overrideAttrs (oldAttrs: rec { +
-        # Remove default plugins and themes +
-        installPhase = oldAttrs.installPhase + '' +
-          rm -r $out/share/wordpress/wp-content/plugins/+
-          rm -r $out/share/wordpress/wp-content/themes/+
-        ''; +
-      }); +
-      foo2zjs = super.foo2zjs.overrideAttrs (oldAttrs: rec { +
-        src = builtins.fetchurl { +
-          url = "https://github.com/onny/nixpkgs/archive/foo2zjs-colorfix.tar.gz"; +
-          sha256 = "0xksz2p2l0jx083hlbrh295ncb2lgsp9b8nwdig3lyinl5x"; +
-        }; +
-        patches = (oldAttrs.patches or []++ [ +
-          (pkgs.fetchpatch { +
-            url = "https://raw.githubusercontent.com/onny/nixpkgs/12b6026fb0a4119e40a095aae224eaaf27098c10/pkgs/misc/drivers/foo2zjs/dell1250c-a4fix.patch"; +
-            sha256 = "0lvbryw6ymh0ahwkhqsgmjimg5saa8b1xnxmyyjxrbi3l3a6flll"; +
-          }) +
-        ]; +
-      }); +
-    }) +
-  ];+
 </code> </code>
  
-fetchpatch+nixos-shell usage 
 + 
 +<code bash> 
 +QEMU_NET_OPTS="hostfwd=tcp::8080-:80" NIX_PATH=nixpkgs=/home/onny/projects/nixpkgs nixos-shell vm-invoiceplane.nix 
 +sudo -E QEMU_NET_OPTS="hostfwd=tcp::80-:80" NIX_PATH=nixpkgs=/home/onny/projects/nixpkgs nixos-shell vm-invoiceplane.nix 
 +</code> 
 + 
 +systemd one shot service
  
 <code> <code>
-  patches [ +  # Symlink nvim user config for root user 
-    # Support HBPL1 printers https://www.dechifro.org/hbpl+  systemd.services.nvim-symlink { 
-    ./hbpl1.patch+    script = '' 
 +      if [[ ! -h "/root/.config/nvim" ]]; then 
 +        ln -s "/home/onny/.config/nvim" "/root/.config/" 
 +      fi 
 +    ''; 
 +    wantedBy = [ "multi-user.target" ]; 
 +    serviceConfig = { 
 +      Type = "oneshot"; 
 +    }; 
 +  }; 
 +</code>
  
-    # Fix "Unimplemented paper code" error for hbpl1 printers +update package
-    # https://github.com/mikerr/foo2zjs/pull/+
-    (fetchpatch { +
-      url = "https://patch-diff.githubusercontent.com/raw/mikerr/foo2zjs/pull/2.patch"; +
-      sha256 = "0lvbryw6ymh0ahwkhqsgmjimg5saa8b1xnxmyyjxrbi3l3a6fbvy"; +
-      stripLen = 1; +
-      name = "fix_papercode_error.patch"; +
-    })+
  
-  ];+<code> 
 +nix-update gelly 
 +nix-update stamp --version=branch=main 
 +nix-update --use-update-script python3Packages.django-filingcabinet 
 +</code> 
 +==== configuration ==== 
 + 
 +prepend list to existing default configuration of option 
 + 
 +<code nix> 
 +enabledPreviewProviders = lib.mkOptionDefault ( 
 +  lib.mkBefore [ 
 +    "OC\\Preview\\Imaginary" 
 +    "OC\\Preview\\ImaginaryPDF" 
 +  ] 
 +); 
 +</code> 
 + 
 +==== packaging ==== 
 + 
 +template 
 +<code> 
 +
 +  lib, 
 +  buildGoModule, 
 +  fetchFromCodeberg, 
 +}: 
 + 
 +buildGoModule (finalAttrs:
 +  pname = "slurp"; 
 +  version = "1.1.1"; 
 +  __structuredAttrs = true; 
 +  strictDeps = true; 
 + 
 +  src = fetchFromCodeberg { 
 +    owner = "vyr"; 
 +    repo = "slurp"; 
 +    rev = "v${finalAttrs.version}"; 
 +    hash = "sha256-bqIX+kG/VXLvw/ORqS+Gq8fezd0QW6dlKdLr2vW0YY0="; 
 +  }; 
 + 
 +  vendorHash = "sha256-i/xoMJORuJbAQW+g9H95xQ5O3811NncCgJIL9OY+B5k="; 
 + 
 +  # Tests require networking 
 +  doCheck = false; 
 + 
 +  meta = { 
 +    description = "Tool for exporting data from and importing data to Fediverse instances"; 
 +    homepage = "https://codeberg.org/vyr/slurp"; 
 +    license = lib.licenses.gpl3Only; 
 +    maintainers = with lib.maintainers; [ onny ]; 
 +    mainProgram = "slurp"; 
 +  }; 
 +}) 
 +</code> 
 + 
 +fetchpatch 
 + 
 +<code> 
 +patches = [ 
 +  (fetchpatch { 
 +    url = "https://salsa.debian.org/webkit-team/webkit/-/raw/debian/2.44.1-1/debian/patches/fix-ftbfs-riscv64.patch"; 
 +    hash = "sha256-MgaSpXq9l6KCLQdQyel6bQFHG53l3GY277WePpYXdjA="; 
 +    name = "fix_ftbfs_riscv64.patch"; 
 +  }) 
 +];
 </code> </code>
  
Line 1450: Line 1217:
 </code> </code>
  
-locate / search file belongs to which package+python modules hooks 
 <code> <code>
-nix-locate -w libnss3.so+nativeCheckInputs = [ 
 +  pytestCheckHook 
 +  writableTmpDirAsHomeHook 
 +]
 </code> </code>
  
-list package content+update script git updater 
 <code> <code>
-tree (nix-instantiate --eval -E 'with import <nixpkgs> {}; glibcLocales.outPath' | xargs)+passthru.updateScript = gitUpdater { 
 +  ignoredVersions = "_rc"; 
 +};
 </code> </code>
  
-nixos-shell usage+debuggig, run commands inside derivation
  
-<code bash+<code> 
-QEMU_NET_OPTS="hostfwd=tcp::8080-:80" NIX_PATH=nixpkgs=/home/onny/projects/nixpkgs nixos-shell vm-invoiceplane.nix +nix develop -f . stamp -c bash -c 'pkg-config --cflags --print-errors gio-unix-2.0' 
-sudo -E QEMU_NET_OPTS="hostfwd=tcp::80-:80" NIX_PATH=nixpkgs=/home/onny/projects/nixpkgs nixos-shell vm-invoiceplane.nix+nix develop -f . stamp -c bash -c 'pkg-config --variable=includedir gio-unix-2.0' 
 +nix develop -f . stamp -c bash -c 'pkg-config --modversion gio-unix-2.0; pkg-config --path gio-unix-2.0 2>/dev/null || pkg-config --debug gio-unix-2.0 2>&1 | grep -i "gio-unix-2.0.pc"' 
 +2.88.1
 </code> </code>
  
-systemd one shot service+===== python ===== 
 + 
 +python relax dependency
  
 <code> <code>
-  # Symlink nvim user config for root user +pythonRelaxDeps = [ "pydantic" ]; 
-  systemd.services.nvim-symlink = { +</code> 
-    script '' +==== packaging module ==== 
-      if [[ ! -h "/root/.config/nvim]]; then + 
-        ln -"/home/onny/.config/nvim" "/root/.config/+systemd hardening 
-      fi + 
-    ''+<code> 
-    wantedBy = [ "multi-user.target" ]; +
-    serviceConfig = { +  ..
-      Type = "oneshot";+}: 
 + 
 +let 
 + 
 +  defaultServiceConfig = { 
 +    User "openproject"; 
 +    Group = "openproject"; 
 +    WorkingDirectory = "${pkgs.openproject}"
 +    StateDirectory = cfg.stateDir; 
 +    # Service hardening 
 +    ReadWritePaths = [ cfg.stateDir ]; 
 +    CacheDirectory = "openproject"; 
 +    AmbientCapabilities = ""; 
 +    CapabilityBoundingSet = ""; 
 +    # ProtectClock adds DeviceAllow=char-rtc r 
 +    DeviceAllow = ""
 +    DevicePolicy = "closed"
 +    LockPersonality = true; 
 +    # Loosening setting, required by Ruby daemon 
 +    MemoryDenyWriteExecute = false; 
 +    NoNewPrivileges = true; 
 +    RemoveIPC = true; 
 +    PrivateDevices = true; 
 +    PrivateMounts = true; 
 +    PrivateTmp = true; 
 +    PrivateUsers = true; 
 +    ProtectClock = true; 
 +    ProtectHome = true; 
 +    ProtectHostname = true; 
 +    ProtectSystem = "strict"; 
 +    ProtectControlGroups = true; 
 +    ProtectKernelLogs = true; 
 +    ProtectKernelModules = true; 
 +    ProtectKernelTunables = true; 
 +    ProtectProc = "invisible"; 
 +    ProcSubset = "pid"; 
 +    RestrictAddressFamilies = [ 
 +      "AF_UNIX" 
 +      "AF_INET" 
 +      "AF_INET6" 
 +    ]
 +    RestrictNamespaces = true; 
 +    RestrictRealtime = true; 
 +    RestrictSUIDSGID = true; 
 +    SystemCallArchitectures = "native"; 
 +    SystemCallFilter = [ 
 +      "@system-service" 
 +      # Loosening setting, required by Ruby daemon 
 +      #"~@privileged @setuid @keyring" 
 +    ]; 
 +    UMask = "0077"; 
 +  }; 
 + 
 +in 
 +
 + 
 +  [...] 
 +    systemd.services."openproject-seeder" = { 
 +      serviceConfig = defaultServiceConfig // { 
 +</code> 
 + 
 +settings option 
 + 
 +<code> 
 +settings = lib.mkOption { 
 +  type = lib.types.submodule { 
 +    freeformType = lib.types.attrsOf ( 
 +      lib.types.nullOr ( 
 +        lib.types.oneOf [ 
 +          lib.types.str 
 +          lib.types.bool 
 +          lib.types.int 
 +          lib.types.port 
 +          lib.types.path 
 +        ] 
 +      ) 
 +    ); 
 +    options = { 
 +      OPENPROJECT_HOST__NAME = lib.mkOption { 
 +        type = lib.types.str; 
 +        default = "localhost"
 +        description = "Hostname to use"; 
 +      }; 
 +      PORT = lib.mkOption { 
 +        type = lib.types.port; 
 +        default = 6346; 
 +        description = "Port for the puma daemon to bind to."; 
 +      };
     };     };
   };   };
 +  default = { };
 +  description = ''
 +    Extra configuration options to append or override.
 +    For available and default option values see
 +    [upstream configuration file](https://www.openproject.org/docs/installation-and-operations/configuration/environment/).
 +  '';
 +};
 </code> </code>
  
-nix repl+merge settings with defaults
  
-<code bash+<code> 
-nix repl '<nixpkgs>' +config = lib.mkIf cfg.enable { 
-# wordpressPackages.plugins.gutenberg.meta.license+ 
 +  services.openproject.settings = lib.mkMerge [ 
 +    { 
 +      OPENPROJECT_RAILS_CACHE_STORE = "memcache"; 
 +      OPENPROJECT_CACHE__MEMCACHE__SERVER = "unix:///run/memcached/memcached.sock"; 
 +      OPENPROJECT_CACHE__NAMESPACE = "openproject"; 
 +    } 
 +  ];
 </code> </code>
-==== packaging ====+ 
 +migrate option 
 + 
 +<code> 
 +  imports 
 +    (mkRenamedOptionModule 
 +      [ "services" "nextcloud" "logLevel" ] [ "services" "nextcloud" "settings" "loglevel" ]) 
 +  ]; 
 +   
 +  options.services.nextcloud 
 +    enable mkEnableOption "nextcloud"; 
 +</code> 
 + 
 +lib.getExe 
 + 
 +<code> 
 +"${lib.getExe' quake3pkg "quake3-server"} +set g_gametype 0 " 
 +</code> 
 +===== tools ===== 
 + 
 +run / test update script 
 +<code> 
 +nix-shell maintainers/scripts/update.nix --argstr package openproject 
 +</code> 
 + 
 +===== snippets =====
  
 fetchurl fetchurl
Line 1784: Line 1688:
   '';   '';
 </code> </code>
-==== tests ==== 
  
-run tests interactively+==== system config ====
  
-<code bash+use module and package from remote repo 
-nix build -L -f . nixosTests.invoiceplane.driverInteractive + 
-./result/bin/nixos-test-driver +<code> 
-> startAll +{ 
-> testScript +  inputs = { 
-> $machine->succeed("touch /tmp/foo") +    nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; 
-> print($machine->succeed("pwd")) # Show stdout of command+    invoiceplane-unstable.url = "nixpkgs/master"; 
 +  }; 
 +};
 </code> </code>
  
-==== nixops ====+<code> 
 +disabledModules 
 +  "services/web-apps/invoiceplane.nix" 
 +]; 
 +imports 
 +  "${inputs.invoiceplane-unstable}/nixos/modules/services/web-apps/invoiceplane.nix" 
 +];
  
-setup +nixpkgs.overlays = [ 
-<file - /etc/nixos/configuration.nix> +  (self: super: { 
-virtualisation.libvirtd.enable = true; +    invoiceplane = inputs.invoiceplane-unstable.legacyPackages.x86_64-linux.invoiceplane; 
-users.extraUsers.myuser.extraGroups = [ "libvirtd" ]; +    plausible = inputs.plausible-riscv.legacyPackages.x86_64-linux.pkgsCross.riscv64.plausible; 
-</file> +  }) 
- +];
-<code bash> +
-nix-env -iA nixos-unstable.nixopsUnstable +
-sudo mkdir /var/lib/libvirt/images +
-sudo chgrp libvirtd /var/lib/libvirt/images +
-sudo chmod g+w /var/lib/libvirt/images +
-sudo virsh pool-define-as default dir --target /var/lib/libvirt/images +
-sudo virsh pool-autostart default +
-sudo virsh pool-start default +
-nixops create -d example-libvirtd examples/trivial-virtd.nix +
-nixops deploy -d example-libvirtd +
-nixops list+
 </code> </code>
  
-connect to instance (deployment nameexample-libvirtd, machine namemachine+overlay examples 
-<code bash> + 
-nixops ssh -d example-libvirtd machine+<code> 
 +nixpkgs.overlays = [ 
 +  (selfsuper: { 
 + 
 +    python3 = super.python3.override { 
 +      packageOverrides = python-finalpython-prev:
 +        mypy = python-prev.mypy.overridePythonAttrs (old: { 
 +          nativeBuildInputs = (old.nativeBuildInputs or []++ [ 
 +            super.librt 
 +          ]; 
 +        }); 
 +      }; 
 +    }; 
 + 
 +    bcachefs-tools = super.bcachefs-tools.overrideAttrs (final: oldAttrs: { 
 +      version = "1.38.7-unstable-2026-07-02"; 
 +      src = super.fetchFromGitHub { 
 +        owner = "koverstreet"; 
 +        repo = "bcachefs-tools"; 
 +        rev = "7f0cce3cf4d5241569674bbc92af8a75e78ade75"; 
 +        hash = "sha256-RXerSh8gRyODncfLZsSz+5Foi6JShUI3dO1zZT/NMZU="; 
 +      }; 
 +      cargoHash = null; 
 +      cargoDeps = pkgs.rustPlatform.fetchCargoVendor { 
 +        src = final.src; 
 +        hash = "sha256-DV0YPv+WtqtbTjwDdqj1r1jySVM8mgkscj+8NqVum2M="; 
 +      }; 
 +    }); 
 + 
 +  }) 
 +];
 </code> </code>
 +==== modules ====
  
-delete deployment, delete machine +converting cfg.settings to strings only for systemd environment variables etc
-<code bash> +
-nixops delete -d example-libvirtd+
  
-nixops destroy --include nix-http+<code> 
 +let 
 +  configEnv = concatMapAttrs ( 
 +    name: value: 
 +    optionalAttrs (value != null) { 
 +      ${name} = if isBool value then boolToString value else toString value; 
 +    } 
 +  ) cfg.settings; 
 +in
 </code> </code>
 +==== flake ====
  
-start, stop destroy machine foo +local file path as flake input 
-<code bash+<code> 
-nixops start --include foo +inputs.verwaltungstracker.url = "git+file:///home/onny/projects/verwaltungstracker";
-nixops stop --include foo +
-nixops destroy --include foo+
 </code> </code>
  
-list machines +development flake.nix 
-<code bash+<code> 
-nixops info+
 +  description = "Invoiceplane invoice template development shell"; 
 + 
 +  inputs.nixpkgs.url = "nixpkgs/nixos-25.11"; 
 + 
 +  outputs = { self, nixpkgs, ... }@inputs: 
 +    let 
 +      pkgs = nixpkgs.legacyPackages.x86_64-linux; 
 +    in { 
 +    devShells.x86_64-linux.default = pkgs.mkShell { 
 +      packages = [ pkgs.pnpm ]; 
 +    }; 
 + 
 +  }; 
 +}
 </code> </code>
 ===== filesystem ===== ===== filesystem =====
Line 1850: Line 1800:
 <code bash> <code bash>
 fatlabel /dev/sdb1 "mystick" fatlabel /dev/sdb1 "mystick"
-</code> 
- 
-grow ext4 partition live 
-<code bash> 
-$ growpart /dev/sda 2 
-$ resize2fs /dev/sda2 
 </code> </code>
  
Line 1944: Line 1888:
 </code> </code>
  
-===== avahi ===== + 
-discover local services+ 
 +===== npm ===== 
 + 
 +check for major updates
 <code bash> <code bash>
-avahi-browse --all --ignore-local --resolve --terminate +npm-check-updates -u
-</code> +
-===== curlftpfs ===== +
-<code bash> +
-curlftpfs ftp.example.com /mnt/ftp/ -o user=username:password,allow_other+
 </code> </code>
  
 ===== pnpm ===== ===== pnpm =====
 +
 <code bash> <code bash>
 pnpm init pnpm init
 pnpm install jquery@3.5.1 --save # see npmjs.com pnpm install jquery@3.5.1 --save # see npmjs.com
 </code> </code>
-update packages+ 
 +check package updates 
 <code bash> <code bash>
 pnpm outdated pnpm outdated
 +</code>
 +
 +update specific package
 +<code bash>
 +pnpm update @nextcloud/dialogs --latest
 </code> </code>
 ===== gitlab-ci ===== ===== gitlab-ci =====
Line 1981: Line 1932:
  
 ===== postmarketOS ===== ===== postmarketOS =====
 +
 +====== personal setup ======
 +  * enable beacondb in geoclue conf
 +
 +====== notes ======
 +update checksum
 +<code bash>
 +pmbootstrap checksum device-samsung-dream
 +</code>
  
 general chroot management general chroot management
Line 2043: Line 2003:
 md5sum -t recovery.tar >> recovery.tar md5sum -t recovery.tar >> recovery.tar
 mv recovery.tar recovery.tar.md5 mv recovery.tar recovery.tar.md5
 +</code>
 +
 +apk list installed files
 +
 +<code>
 +apk info -L calls-systemd
 </code> </code>
 ===== parted ===== ===== parted =====
Line 2098: Line 2064:
 </code> </code>
  
-===== cups ===== 
  
-list printers +===== qemu =====
-<code> +
-$ lpstat -p -d +
-printer Dell_1250c is idle.  enabled since Tue 28 Dec 2021 09:44:59 AM UTC +
-printer Dell_1250c_USB is idle.  enabled since Tue 28 Dec 2021 09:44:59 AM UTC +
-</code>+
  
-print file +booting armv7 alpinelinux 
-<code> +<code bash
-lp -d Dell_1250c_USB -o fit-to-page -o media=A4 scared_cat.png+# download kernel and stuff from here http://dl-cdn.alpinelinux.org/alpine/edge/releases/armv7/netboot/ 
 +qemu-system-arm -M virt -m 512M -cpu cortex-a15 -kernel vmlinuz-lts -initrd initramfs-lts -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/" -nographic
 </code> </code>
  
-list jobs +===== mariadb =====
-<code> +
-$ lpstat +
-Dell_1250c_USB-2        root            340992   Tue 28 Dec 2021 09:57:08 AM UTC +
-</code>+
  
-cancel job +import dump 
-<code> +<code bash
-cancel 1+mariadb -u root nextcloud < mydump.sql
 </code> </code>
  
-===== qemu ===== +list tables and size of database nextcloud
- +
-booting armv7 alpinelinux+
 <code bash> <code bash>
-# download kernel and stuff from here http://dl-cdn.alpinelinux.org/alpine/edge/releases/armv7/netboot/ +SELECT  
-qemu-system-arm -M virt -m 512M -cpu cortex-a15 -kernel vmlinuz-lts -initrd initramfs-lts -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/" -nographic+    table_name AS `Table`, 
 +    ROUND(((data_length + index_length) 1024 1024), 2) AS `Size (MB)`, 
 +    table_rows AS `Approx Rows` 
 +FROM information_schema.tables 
 +WHERE table_schema 'nextcloud' 
 +ORDER BY (data_length + index_length) DESC;
 </code> </code>
  
Line 2182: Line 2142:
 </code> </code>
  
 +===== helix =====
  
 +multi-cursor selection mode
 +
 +<code>
 +Normal mode -> V (visual mode) -> Shift+C (multiple times) -> i (insert mode) -> Enter something
 +ESC -> ,
 +</code>
 +
 +sort
 +
 +<code>
 +- select multiple lines
 +- press Alt-S
 +- type ":sort"
 +</code>
 +
 +copy to clipboard
 +
 +
 +<code>
 +- select area
 +- press <space>+y
 +</code>
 +
 +select all lines
 +
 +<code>
 +%
 +</code>
 +
 +buffer close
 +
 +<code>
 +:bc
 +</code>
 +
 +helix editor vertical split
 +
 +<code>
 +Ctrl-w v
 +</code>
 +===== traceroute =====
 +
 +traceroute TCP packages specific port
 +<code>
 +traceroute -T -p 25 mail.karlsruhe.de
 +</code>
 +
 +===== curl =====
 +
 +fetch headers
 +<code>
 +curl -sI https://project-insanity.org/
 +</code>
 +
 +===== ripgrep =====
 +
 +multiline regex whole file
 +
 +<code>
 +rg -U --multiline-dotall 'bundlerEnv.*updateScript'
 +</code>
 +
 +with proximity, only 1-2 lines in between
 +
 +<code bash>
 +rg -U --multiline-dotall "depsBuildBuild(?:[^\n]*\n){0,2}[^\n]*buildInputs"
 +</code>
 +
 +search only in specific file extensions
 +
 +<code>
 +rg -g "*.sh" -l "src.tag" pkgs/by-name/
 +</code>
 +
 +===== act =====
 +
 +manually run github workflow locally
 +
 +<code>
 +act -W .github/workflows/lint-eslint.yml
 +</code>
 +
 +map custom docker image to some other
 +
 +<code>
 +act -W .github/workflows/lint-eslint.yml -P ubuntu-latest-low=catthehacker/ubuntu:act-latest
 +</code>
 +
 +===== composer =====
 +
 +upgrade to new major version
 +
 +<code bash>
 +composer outdated
 +composer require --dev psalm/phar:^6.0
 +</code>
 +
 +===== namei =====
 +
 +list permissions, users file path
 +
 +<code bash>
 +[picloud@picloudrv:~]$ sudo namei -l /nix/store/c12wcqvlkcildargvd0nnxryl07r731x-invoiceplane-invoice.project-insanity.org-riscv64-unknown-linux-gnu-1.7.1/uploads/temp/Rechnung_129.xml
 +f: /nix/store/c12wcqvlkcildargvd0nnxryl07r731x-invoiceplane-invoice.project-insanity.org-riscv64-unknown-linux-gnu-1.7.1/uploads/temp/Rechnung_129.xml
 +drwxr-xr-x root         root   /
 +drwxr-xr-x root         root   nix
 +drwxrwxr-t root         nixbld store
 +dr-xr-xr-x root         root   c12wcqvlkcildargvd0nnxryl07r731x-invoiceplane-invoice.project-insanity.org-riscv64-unknown-linux-gnu-1.7.1
 +lrwxrwxrwx root         root   uploads -> /var/lib/invoiceplane/invoice.project-insanity.org/uploads
 +drwxr-xr-x root         root     /
 +drwxr-xr-x root         root     var
 +drwxr-xr-x root         root     lib
 +drwxr-xr-x root         root     invoiceplane
 +drwxr-x--- invoiceplane caddy    invoice.project-insanity.org
 +drwxr-x--- invoiceplane caddy    uploads
 +drwxr-x--- invoiceplane caddy  temp
 +                                Rechnung_129.xml - No such file or directory
 +</code>
 +
 +===== reuse =====
 +
 +general usage
 +
 +<code bash>
 +reuse download MIT
 +reuse annotate --copyright "Jonas Heinrich <heinrich@synyx.de>" --license MIT \
 +  .github/pull_request_template.md flake.nix nextcloud-extras.nix psalm.xml
 +reuse lint
 +</code>
 +
 +===== kernel =====
 +
 +query config of current running kernel 
 +
 +<code bash>
 +zcat /proc/config.gz | rg CONFIG_RUST
 +</code>
 +
 +===== fd =====
 +
 +search for all files with specific extension in directory /
 +
 +<code bash>
 +fd --type f -e fm . /
 +</code>
 +
 +zip all files with specific file extension
 +
 +<code bash>
 +fd -t f -e fm . / | zip source -@
 +</code>
 +
 +file creation timespan
 +
 +<code bash>
 +fd --type f -e pdf --change-newer-than "2020-09-09" --changed-before "2020-10-01" .
 +</code>
 +
 +execute command
 +
 +<code bash>
 +fd --type f -e doc -e docx -e pdf -i gabriel -x cp --backup=t {} /tmp/gabriel/
 +</code>
 +
 +find filenames unallowed characters
 +
 +<code bash>
 +fd '[^A-Z a-züö@0-9._-]' remote/200_Archiv/CP_Dont_Touch
 +</code>
 +
 +remove empty dirs in dir "data"
 +
 +<code bash>
 +fd --type empty --type directory . /path/to/specific/dir -X rmdir
 +</code>
onny/notizen.1683708036.txt.gz · Last modified: by 10.200.0.1 · Currently locked by: 10.250.0.1