onny:notizen
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
onny:notizen [2023/05/10 08:40] – [ip] 10.200.0.1 | onny:notizen [2024/05/22 12:10] (current) – [batch convert images] 10.250.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== kernel ===== | ||
- | |||
- | grep kernel config running system | ||
- | <code bahs> | ||
- | zcat / | ||
- | </ | ||
- | |||
- | ===== fish ===== | ||
- | |||
- | unset history | ||
- | < | ||
- | fish --private | ||
- | </ | ||
- | |||
===== bash ===== | ===== bash ===== | ||
Line 101: | Line 87: | ||
chmod +x $FILE | chmod +x $FILE | ||
$FILE " | $FILE " | ||
- | </ | ||
- | ==== sed ==== | ||
- | Mit sed inplace eine Zeile zu einer Datei hinzufügen: | ||
- | <code bash> | ||
- | sed -i ' | ||
- | </ | ||
- | add to end of file | ||
- | <code bash> | ||
- | sed -i -e ' | ||
- | </ | ||
- | Comment out specific line matching a string | ||
- | <code bash> | ||
- | sudo sed -e '/ | ||
- | </ | ||
- | comment out multiple lines / range | ||
- | <code bash> | ||
- | sed -i "28,33 s/# *//" autogen.sh | ||
- | </ | ||
- | regex parse value of xml tags | ||
- | <code bash> | ||
- | sed -n ' | ||
- | </ | ||
- | delete multiple lines | ||
- | <code bash> | ||
- | sed -i ' | ||
</ | </ | ||
- | insert line after match | ||
- | <code bash> | ||
- | sed '/ | ||
- | </ | ||
==== grep ==== | ==== grep ==== | ||
regex match group | regex match group | ||
Line 164: | Line 121: | ||
</ | </ | ||
- | ==== curl ==== | ||
- | post data | ||
- | <code bash> | ||
- | curl --data " | ||
- | </ | ||
- | download and extract archive | ||
- | <code bash> | ||
- | curl http:// | ||
- | </ | ||
- | set host header | ||
- | <code bash> | ||
- | torify curl --header "Host: http.pi" | ||
- | </ | ||
==== patching ==== | ==== patching ==== | ||
Line 353: | Line 297: | ||
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 | ||
</ | </ | ||
- | ==== batch convert images ==== | + | |
- | <code bash> | + | |
- | for i in *.jpeg; convert -resize 30% $i (string replace jpeg jpg $i); end | + | |
- | </ | + | |
==== lossless mp3 merge ==== | ==== lossless mp3 merge ==== | ||
<code bash> | <code bash> | ||
Line 498: | Line 439: | ||
docker system prune -a | docker system prune -a | ||
</ | </ | ||
- | docker stop all container | + | |
- | <code bash> | + | |
- | docker stop (docker ps -a -q) | + | |
- | </ | + | |
prevent from auto start | prevent from auto start | ||
+ | |||
<code bash> | <code bash> | ||
docker update --restart=no client-iaro_db_1 | docker update --restart=no client-iaro_db_1 | ||
Line 678: | Line 617: | ||
git remote set-url origin gitlab@http-new.pi: | git remote set-url origin gitlab@http-new.pi: | ||
</ | </ | ||
- | tagging | + | |
- | <code bash> | + | |
- | git tag -a v0.1 -m ' | + | |
- | </ | + | |
merge commits from a remote repository | merge commits from a remote repository | ||
+ | |||
<code bash> | <code bash> | ||
git fetch https:// | git fetch https:// | ||
Line 777: | Line 714: | ||
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 | ||
- | </ | ||
- | change message of last git commit | ||
- | <code bash> | ||
- | git commit --amend | ||
</ | </ | ||
force push, remove latest commit of remote repository (origin) | force push, remove latest commit of remote repository (origin) | ||
Line 807: | Line 740: | ||
git commit --all --amend --no-edit | git commit --all --amend --no-edit | ||
git rebase --continue | git rebase --continue | ||
- | </ | ||
- | |||
- | add co-author / co-authors to commit | ||
- | <code bash> | ||
- | git commit --amend | ||
- | # Add line: Co-authored-by: | ||
</ | </ | ||
===== yum ===== | ===== yum ===== | ||
Line 894: | Line 821: | ||
</ | </ | ||
* check spamminess of email server: https:// | * check spamminess of email server: https:// | ||
- | * manual imap login | + | |
- | openssl imaps login | + | |
- | < | + | |
- | openssl s_client -connect mail.sexypump.de: | + | |
- | A login cypherpunk cypherpunk | + | |
- | </ | + | |
- | get quota | + | |
- | < | + | |
- | a GETQUOTAROOT INBOX | + | |
- | </ | + | |
- | get msg count of folder | + | |
- | < | + | |
- | a LIST INBOX * | + | |
- | * LIST (\HasChildren) " | + | |
- | * LIST (\HasNoChildren \UnMarked) " | + | |
- | * LIST (\HasNoChildren \UnMarked) " | + | |
- | * LIST (\HasNoChildren \UnMarked \Trash) " | + | |
- | * LIST (\HasNoChildren \UnMarked \Sent) " | + | |
- | * LIST (\HasNoChildren \UnMarked) " | + | |
- | * LIST (\HasNoChildren \UnMarked \Junk) " | + | |
- | * LIST (\HasNoChildren \UnMarked \Drafts) " | + | |
- | * LIST (\HasNoChildren \UnMarked) " | + | |
- | a OK List completed (0.001 + 0.000 secs). | + | |
- | a SELECT INBOX | + | |
- | </ | + | |
send smtp mail | send smtp mail | ||
< | < | ||
Line 1306: | Line 1209: | ||
< | < | ||
- | let | + | nixpkgs.config.packageOverrides = pkgs: rec { |
- | + | unstable = import unstableTarball { }; | |
- | # FIXME | + | opensnitch = unstable.opensnitch; |
- | unstableTarball = | + | }; |
- | fetchTarball | + | |
- | https:// | + | |
- | + | ||
- | in | + | |
- | { | + | |
- | + | ||
- | disabledModules = [ | + | |
- | " | + | |
- | " | + | |
- | ]; | + | |
- | + | ||
- | imports = [ | + | |
- | " | + | |
- | / | + | |
- | ]; | + | |
- | | + | |
- | unstable = import unstableTarball { }; | + | |
- | opensnitch = unstable.opensnitch; | + | |
- | }; | + | |
- | # | + | |
</ | </ | ||
Line 1361: | Line 1244: | ||
''; | ''; | ||
}); | }); | ||
- | </ | ||
- | |||
- | use local src / source | ||
- | |||
- | < | ||
- | src = / | ||
- | unpackPhase = '' | ||
</ | </ | ||
Line 1374: | Line 1250: | ||
<code bash> | <code bash> | ||
nix-shell -p ' | nix-shell -p ' | ||
- | </ | ||
- | |||
- | package overlay and override attributes | ||
- | |||
- | < | ||
- | nixpkgs.overlays = [ | ||
- | (self: super: { | ||
- | foo2zjs = (import (builtins.fetchTarball { | ||
- | url = | ||
- | " | ||
- | sha256 = " | ||
- | }) {} ).foo2zjs; | ||
- | wordpress = super.wordpress.overrideAttrs (oldAttrs: rec { | ||
- | # Remove default plugins and themes | ||
- | installPhase = oldAttrs.installPhase + '' | ||
- | rm -r $out/ | ||
- | rm -r $out/ | ||
- | ''; | ||
- | }); | ||
- | foo2zjs = super.foo2zjs.overrideAttrs (oldAttrs: rec { | ||
- | src = builtins.fetchurl { | ||
- | url = " | ||
- | sha256 = " | ||
- | }; | ||
- | patches = (oldAttrs.patches or []) ++ [ | ||
- | (pkgs.fetchpatch { | ||
- | url = " | ||
- | sha256 = " | ||
- | }) | ||
- | ]; | ||
- | }); | ||
- | }) | ||
- | ]; | ||
- | </ | ||
- | |||
- | fetchpatch | ||
- | |||
- | < | ||
- | patches = [ | ||
- | # Support HBPL1 printers https:// | ||
- | ./ | ||
- | |||
- | # Fix " | ||
- | # https:// | ||
- | (fetchpatch { | ||
- | url = " | ||
- | sha256 = " | ||
- | stripLen = 1; | ||
- | name = " | ||
- | }) | ||
- | |||
- | ]; | ||
</ | </ | ||
Line 1482: | Line 1306: | ||
}; | }; | ||
}; | }; | ||
- | </ | ||
- | |||
- | nix repl | ||
- | |||
- | <code bash> | ||
- | nix repl '< | ||
- | # wordpressPackages.plugins.gutenberg.meta.license | ||
</ | </ | ||
==== packaging ==== | ==== packaging ==== | ||
Line 1783: | Line 1600: | ||
--add-flags "-jar $out/ | --add-flags "-jar $out/ | ||
''; | ''; | ||
- | </ | ||
- | ==== tests ==== | ||
- | |||
- | run tests interactively | ||
- | |||
- | <code bash> | ||
- | nix build -L -f . nixosTests.invoiceplane.driverInteractive | ||
- | ./ | ||
- | > startAll | ||
- | > testScript | ||
- | > $machine-> | ||
- | > print($machine-> | ||
</ | </ | ||
Line 1850: | Line 1655: | ||
<code bash> | <code bash> | ||
fatlabel /dev/sdb1 " | fatlabel /dev/sdb1 " | ||
- | </ | ||
- | |||
- | grow ext4 partition live | ||
- | <code bash> | ||
- | $ growpart /dev/sda 2 | ||
- | $ resize2fs /dev/sda2 | ||
</ | </ | ||
Line 1944: | Line 1743: | ||
</ | </ | ||
- | ===== avahi ===== | + | |
- | discover local services | + | |
- | <code bash> | + | |
- | avahi-browse --all --ignore-local --resolve --terminate | + | |
- | </ | + | |
===== curlftpfs ===== | ===== curlftpfs ===== | ||
<code bash> | <code bash> | ||
Line 2098: | Line 1893: | ||
</ | </ | ||
- | ===== cups ===== | ||
- | |||
- | list printers | ||
- | < | ||
- | $ 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 | ||
- | </ | ||
- | |||
- | print file | ||
- | < | ||
- | lp -d Dell_1250c_USB -o fit-to-page -o media=A4 scared_cat.png | ||
- | </ | ||
- | |||
- | list jobs | ||
- | < | ||
- | $ lpstat | ||
- | Dell_1250c_USB-2 | ||
- | </ | ||
- | |||
- | cancel job | ||
- | < | ||
- | cancel 1 | ||
- | </ | ||
===== qemu ===== | ===== qemu ===== |
onny/notizen.1683708036.txt.gz · Last modified: 2023/05/10 08:40 by 10.200.0.1