From 920d16436e0d5f37e9f6d31236ee87b716f3c82f Mon Sep 17 00:00:00 2001
From: johannst Process substitution allows to redirect the stdout of multiple processes at
+once.I/O redirections
+
+Process substitution
+vim -d <(grep foo bar) <(grep foo moose)
+
Argument parsing with
zparseopts
@@ -589,6 +596,11 @@ contains some nice visualization to explain bash redirections.zparseopts [-D] [-E] [-A assoc] specs
fd 1
to fd 2
, effectively redirecting stderr
to stdout
stdout
to file
Process substitution allows to redirect the stdout of multiple processes at +once.
+vim -d <(grep foo bar) <(grep foo moose)
+
getopts
The getopts
builtin uses following global variables:
# 'noclobber', fail if 'log' already exists
echo foo >? log
+Redirect output of multiple processes. Same as <(..)
in bash.
diff (sort a | psub) (sort b | psub)
+
if
/ else
if grep foo bar
diff --git a/searchindex.js b/searchindex.js
index c0b199c..b18b7fa 100644
--- a/searchindex.js
+++ b/searchindex.js
@@ -1 +1 @@
-Object.assign(window.search, {"doc_urls":["intro.html#notes","tools/index.html#tools","tools/zsh.html#zsh1","tools/zsh.html#keybindings","tools/zsh.html#parameter","tools/zsh.html#variables","tools/zsh.html#expansion-flags","tools/zsh.html#argument-parsing-with-zparseopts","tools/zsh.html#example","tools/zsh.html#regular-expressions","tools/zsh.html#completion","tools/zsh.html#installation","tools/zsh.html#completion-variables","tools/zsh.html#completion-functions","tools/zsh.html#example-1","tools/zsh.html#example-with-optional-arguments","tools/bash.html#bash1","tools/bash.html#expansion","tools/bash.html#generator","tools/bash.html#parameter","tools/bash.html#pathname","tools/bash.html#io-redirection","tools/bash.html#explanation","tools/bash.html#argument-parsing-with-getopts","tools/bash.html#example","tools/bash.html#regular-expressions","tools/bash.html#completion","tools/bash.html#example-1","tools/fish.html#fish1","tools/fish.html#quick-info","tools/fish.html#variables","tools/fish.html#setunset-variables","tools/fish.html#special-variables--ref","tools/fish.html#lists","tools/fish.html#command-handling","tools/fish.html#io-redirection","tools/fish.html#control-flow","tools/fish.html#if--else","tools/fish.html#switch","tools/fish.html#while-loop","tools/fish.html#for-loop","tools/fish.html#functions","tools/fish.html#autoloading","tools/fish.html#helper","tools/fish.html#argument-parsing-and-completion","tools/fish.html#prompt","tools/fish.html#useful-builtins","tools/fish.html#keymaps","tools/fish.html#debug","tools/tmux.html#tmux1","tools/tmux.html#tmux-cli","tools/tmux.html#scripting","tools/tmux.html#bindings","tools/tmux.html#command-mode","tools/git.html#git1","tools/git.html#working-areas","tools/git.html#staging","tools/git.html#remote","tools/git.html#branching","tools/git.html#tags","tools/git.html#merging","tools/git.html#worktree","tools/git.html#log--commit-history","tools/git.html#diff--commit-info","tools/git.html#patching","tools/git.html#resetting","tools/git.html#submodules","tools/git.html#inspection","tools/git.html#revision-specifier","tools/awk.html#awk1","tools/awk.html#input-processing","tools/awk.html#program","tools/awk.html#special-pattern","tools/awk.html#special-variables","tools/awk.html#special-statements--functions","tools/awk.html#examples","tools/awk.html#filter-records","tools/awk.html#negative-patterns","tools/awk.html#range-patterns","tools/awk.html#access-last-fields-in-records","tools/awk.html#capture-in-variables","tools/awk.html#capture-in-array","tools/awk.html#run-shell-command-and-capture-output","tools/emacs.html#emacs1","tools/emacs.html#help","tools/emacs.html#package-manager","tools/emacs.html#window","tools/emacs.html#buffer","tools/emacs.html#ibuffer","tools/emacs.html#isearch","tools/emacs.html#occur","tools/emacs.html#grep","tools/emacs.html#yankpaste","tools/emacs.html#register","tools/emacs.html#blockrect","tools/emacs.html#mass-edit","tools/emacs.html#narrow","tools/emacs.html#org","tools/emacs.html#org-source","tools/emacs.html#comapny","tools/emacs.html#tags","tools/emacs.html#lisp","tools/emacs.html#ido","tools/emacs.html#evil","tools/emacs.html#dired","tools/gpg.html#gpg1","tools/gpg.html#generate-new-keypair","tools/gpg.html#list-keys","tools/gpg.html#edit-keys","tools/gpg.html#export--import-keys","tools/gpg.html#search--send-keys","tools/gpg.html#encrypt-passphrase","tools/gpg.html#encrypt-public-key","tools/gpg.html#signing","tools/gpg.html#signing-detached","tools/gpg.html#abbreviations","tools/gpg.html#keyservers","tools/gpg.html#examples","tools/gpg.html#list-basic-key-information-from-file-with-long-keyids","tools/gpg.html#extend-expiring-key","tools/gdb.html#gdb1","tools/gdb.html#cli","tools/gdb.html#interactive-usage","tools/gdb.html#misc","tools/gdb.html#breakpoints","tools/gdb.html#watchpoints","tools/gdb.html#catchpoints","tools/gdb.html#inspection","tools/gdb.html#signal-handling","tools/gdb.html#multi-threading","tools/gdb.html#multi-process","tools/gdb.html#source-file-locations","tools/gdb.html#configuration","tools/gdb.html#text-user-interface-tui","tools/gdb.html#user-commands-macros","tools/gdb.html#hooks","tools/gdb.html#examples","tools/gdb.html#automatically-print-next-instr","tools/gdb.html#conditional-breakpoints","tools/gdb.html#set-breakpoint-on-all-threads-except-one","tools/gdb.html#catch-sigsegv-and-execute-commands","tools/gdb.html#run-backtrace-on-thread-1-batch-mode","tools/gdb.html#script-gdb-for-automating-debugging-sessions","tools/gdb.html#hook-to-automatically-save-breakpoints-on-quit","tools/gdb.html#watchpoint-on-struct--class-member","tools/gdb.html#know-bugs","tools/gdb.html#workaround-command--finish-bug","tools/gdbserver.html#gdbserver1","tools/gdbserver.html#cli","tools/gdbserver.html#example","tools/gdbserver.html#wrapper-example-set-environment-variables-just-for-the-debugee","tools/radare2.html#radare21","tools/radare2.html#print","tools/radare2.html#flags","tools/radare2.html#help","tools/radare2.html#relocation","tools/radare2.html#examples","tools/radare2.html#patch-file-alter-bytes","tools/radare2.html#assemble--disassmble-rasm2","tools/qemu.html#qemu1","tools/qemu.html#keybindings","tools/qemu.html#vm-config-snippet","tools/qemu.html#cpu--ram","tools/qemu.html#graphic--display","tools/qemu.html#boot-menu","tools/qemu.html#block-devices","tools/qemu.html#usb","tools/qemu.html#debugging","tools/qemu.html#io-redirection","tools/qemu.html#network","tools/qemu.html#shared-drives","tools/qemu.html#debug-logging","tools/qemu.html#tracing","tools/qemu.html#vm-snapshots","tools/qemu.html#vm-migration","tools/qemu.html#appendix-direct-kernel-boot","tools/qemu.html#appendix-cheap-instruction-tracer","tools/qemu.html#references","tools/pacman.html#pacman1","tools/pacman.html#remote-package-repositories","tools/pacman.html#remove-packages","tools/pacman.html#local-package-database","tools/pacman.html#local-file-database","tools/pacman.html#hacks","tools/dot.html#dot1","tools/dot.html#example-dot-file-to-copy--paste-from","tools/dot.html#references","tools/ffmpeg.html#ffmpeg-1","tools/ffmpeg.html#screen-capture-specific-window-x11","tools/column.html#column1","tools/column.html#examples","tools/sort.html#sort1","tools/sort.html#examples","tools/sed.html#sed1","tools/sed.html#examples","tools/sed.html#delete-lines","tools/sed.html#insert-lines","tools/sed.html#substitute-lines","tools/sed.html#multiple-scripts","monitor/index.html#resource-analysis--monitor","monitor/lsof.html#lsof8","monitor/lsof.html#examples","monitor/lsof.html#file-flags","monitor/lsof.html#open-tcp-connections","monitor/lsof.html#open-connection-to-specific-host","monitor/lsof.html#open-connection-to-specific-port","monitor/lsof.html#ipv4-tcp-connections-in-established-state","monitor/lsof.html#list-open-files-in-a-mounted-directory","monitor/ss.html#ss8","monitor/ss.html#examples","monitor/pidstat.html#pidstat1","monitor/pidstat.html#page-fault-and-memory-utilization","monitor/pidstat.html#io-statistics","monitor/pgrep.html#pgrep1","monitor/pgrep.html#debug-newest-process","monitor/pmap.html#pmap1","monitor/pstack.html#pstack1","trace_profile/index.html#trace-and-profile","trace_profile/time.html#usrbintime1","trace_profile/strace.html#strace1","trace_profile/strace.html#examples","trace_profile/ltrace.html#ltrace1","trace_profile/ltrace.html#example","trace_profile/perf.html#perf1","trace_profile/perf.html#flamegraph","trace_profile/perf.html#flamegraph-with-single-event-trace","trace_profile/perf.html#flamegraph-with-multiple-event-traces","trace_profile/oprofile.html#oprofile","trace_profile/callgrind.html#callgrind","trace_profile/callgrind.html#profile-specific-part-of-the-target","binary/index.html#binary","binary/od.html#od1","binary/od.html#ascii-to-hex-string","binary/od.html#extract-parts-of-file","binary/xxd.html#xxd1","binary/xxd.html#ascii-to-hex-stream","binary/xxd.html#hex-to-binary-stream","binary/xxd.html#ascii-to-binary","binary/xxd.html#ascii-to-c-array-hex-encoded","binary/readelf.html#readelf1","binary/objdump.html#objdump1","binary/objdump.html#disassemble-section","binary/objdump.html#example-disassemble-raw-binary","binary/objdump.html#example-disassemble-specific-symbol","binary/nm.html#nm1","development/index.html#development","development/c++filt.html#cfilt1","development/c++filt.html#demangle-symbol","development/c++filt.html#demangle-stream","development/c++.html#c","development/c++.html#type-deduction","development/c++.html#strict-aliasing-and-type-punning","development/c++.html#__restrict-keyword","development/c++.html#type-punning","development/c++.html#variadic-templates--parameter-pack-","development/c++.html#forwarding-reference--fwd-ref-","development/c++.html#example-any_of-template-meta-function","development/c++.html#example--sfinae---enable_if-","development/c++.html#example-minimal-templatized-test-registry","development/c++.html#example-concepts-pre-c20","development/c++.html#template-selection-with-partially--fully-specializations","development/c++.html#example-perfect-forwarding","development/glibc.html#glibc","development/glibc.html#malloc-tracer--mtrace3","development/glibc.html#malloc-check--mallopt3","development/gcc.html#gcc1","development/gcc.html#cli","development/gcc.html#preprocessing","development/gcc.html#target-options","development/gcc.html#warnings--optimizations","development/gcc.html#builtins","development/gcc.html#__builtin_expectexpr-cond","development/gcc.html#abi-linux","development/cmake.html#cmake1","development/cmake.html#private--public--interface","development/make.html#make1","development/make.html#anatomy-of-make-rules","development/make.html#pattern-rules--automatic-variables","development/make.html#pattern-rules","development/make.html#automatic-variables","development/make.html#arguments","development/make.html#useful-functions","development/make.html#substitution-references","development/make.html#patsubst--ref-","development/make.html#filter","development/make.html#filter-out","development/make.html#abspath","development/ld.so.html#ldso8","development/ld.so.html#environment-variables","development/ld.so.html#ld_library_path-and-dlopen3","development/ld.so.html#ld_preload-initialization-order-and-link-map","development/ld.so.html#dynamic-linking-x86_64","development/symbolver.html#elf-symbol-versioning","development/symbolver.html#example-version-script","development/symbolver.html#references","development/python.html#python","development/python.html#decorator--run-","development/python.html#walrus-operator--run-","development/python.html#unittest---run-","development/python.html#doctest---run-","development/python.html#timeit","development/gcov.html#gcov1","development/gcov.html#example","development/pgo.html#profile-guided-optimization-pgo","development/pgo.html#clang","development/pgo.html#gcc","linux/index.html#linux","linux/systemd.html#systemd","linux/systemd.html#systemctl","linux/systemd.html#example-list-failed-units","linux/systemd.html#example-trivial-user-unit","linux/systemd.html#journalctl","linux/systemd.html#references","linux/coredump.html#core5","linux/coredump.html#naming-of-coredump-files","linux/coredump.html#control-which-segments-are-dumped","linux/coredump.html#some-examples-out-there","linux/coredump.html#coredumpctl-systemd","linux/coredump.html#apport-ubuntu","linux/ptrace_scope.html#ptrace_scope","linux/cryptsetup.html#cryptsetup8","linux/cryptsetup.html#example-create-luks-encrypted-disk","linux/cryptsetup.html#example-using-an-existing-luks-device","linux/swap.html#swap","linux/swap.html#list-active-swap-areas","linux/swap.html#manual-swapfile-setup","linux/swap.html#using-dphys-swapfile-service","linux/input.html#linux-input","linux/input.html#mousex--mice","linux/input.html#eventx","linux/input.html#identifying-device-files","linux/input.html#example-toying-with-devinputeventx","linux/acl.html#access-control-list-acl","linux/acl.html#show-acl-entries","linux/acl.html#modify-acl-entries","linux/acl.html#masking-of-acl-entries","linux/acl.html#references","linux/zfs.html#zfs","linux/zfs.html#zfs-pool-management","linux/zfs.html#create-modify-and-destroy-zfs-pools","linux/zfs.html#inspect-zfs-pools","linux/zfs.html#modify-vdevs","linux/zfs.html#replace-faulty-disk","linux/zfs.html#import-or-export-zfs-pools","linux/zfs.html#zfs-dataset-management","linux/zfs.html#create-and-destroy-zfs-datasets","linux/zfs.html#list-all-zfs-datasets","linux/zfs.html#mount-zfs-datasets","linux/zfs.html#encrypted-datasets","linux/zfs.html#manage-zfs-encryption-keys","linux/zfs.html#manage-dataset-properties","linux/zfs.html#snapshots","linux/zfs.html#access-control-list","linux/zfs.html#example-zfs-pool-import-during-startup-systemd","network/index.html#network","network/tcpdump.html#tcpdump1","network/tcpdump.html#cli","network/tcpdump.html#examples","network/tcpdump.html#capture-packets-from-remote-host","network/tshark.html#tshark-1","network/tshark.html#examples","network/tshark.html#capture-and-filter-packet-to-file","network/firewall-cmd.html#firewall-cmd1","network/firewall-cmd.html#list-current-status-of-the-firewall","network/firewall-cmd.html#add-entries","network/firewall-cmd.html#remove-entries","network/firewall-cmd.html#references","network/nftables.html#nftables","network/nftables.html#ruleset","network/nftables.html#examples-save-rules-to-files-and-re-apply","network/nftables.html#example-fully-trace-evaluation-of-nftables-rules","network/nftables.html#example-ipv4-port-forwarding","network/nftables.html#example-base-vs-regular-chain","network/nftables.html#mental-model-for-netfilter-packet-flow","web/index.html#web","web/html.html#html","web/html.html#collapsible-element","web/html.html#minimal-2-column-layout","web/html.html#minimal-grid-area","web/html.html#minimal-tabs","web/css.html#css","web/css.html#selector","web/chartjs.html#chartjs","web/chartjs.html#minimal-example-with--external--tooltips","arch/index.html#arch","arch/x86_64.html#x86_64","arch/x86_64.html#registers","arch/x86_64.html#general-purpose-register","arch/x86_64.html#special-register","arch/x86_64.html#flags-register","arch/x86_64.html#model-specific-register-msr","arch/x86_64.html#size-directives","arch/x86_64.html#addressing","arch/x86_64.html#string-instructions","arch/x86_64.html#example-simple-memset","arch/x86_64.html#sysv-x86_64-abi","arch/x86_64.html#passing-arguments-to-functions","arch/x86_64.html#return-values-from-functions","arch/x86_64.html#caller-saved-registers","arch/x86_64.html#callee-saved-registers","arch/x86_64.html#stack","arch/x86_64.html#function-prologue--epilogue","arch/x86_64.html#windows-x64-abi","arch/x86_64.html#passing-arguments-to-functions--ref-","arch/x86_64.html#return-values-from-functions-1","arch/x86_64.html#caller-saved-registers-1","arch/x86_64.html#callee-saved-registers-1","arch/x86_64.html#asm-skeleton","arch/x86_64.html#references","arch/arm64.html#arm64","arch/arm64.html#registers","arch/arm64.html#general-purpose-registers","arch/arm64.html#special-registers-per-el","arch/arm64.html#instructions-cheatsheet","arch/arm64.html#accessing-system-registers","arch/arm64.html#control-flow","arch/arm64.html#addressing","arch/arm64.html#offset","arch/arm64.html#index","arch/arm64.html#pair-access","arch/arm64.html#procedure-call-standard-arm64--aapcs64-","arch/arm64.html#passing-arguments-to-functions","arch/arm64.html#return-values-from-functions","arch/arm64.html#callee-saved-registers","arch/arm64.html#stack","arch/arm64.html#frame-chain","arch/arm64.html#function-prologue--epilogue","arch/arm64.html#asm-skeleton","arch/arm64.html#references","arch/armv7.html#armv7a","arch/armv7.html#registers","arch/armv7.html#general-purpose-registers","arch/armv7.html#special-registers","arch/armv7.html#cpsr-register","arch/armv7.html#instructions-cheatsheet","arch/armv7.html#accessing-system-registers","arch/armv7.html#control-flow","arch/armv7.html#loadstore","arch/armv7.html#procedure-call-standard-arm--aapcs32-","arch/armv7.html#passing-arguments-to-functions","arch/armv7.html#return-values-from-functions","arch/armv7.html#callee-saved-registers","arch/armv7.html#stack","arch/armv7.html#frame-chain","arch/armv7.html#function-prologue--epilogue","arch/armv7.html#asm-skeleton","arch/armv7.html#references","arch/riscv.html#riscv","arch/riscv.html#registers","arch/riscv.html#general-purpose-registers","arch/riscv.html#asm-skeleton","arch/riscv.html#references"],"index":{"documentStore":{"docInfo":{"0":{"body":8,"breadcrumbs":2,"title":1},"1":{"body":18,"breadcrumbs":2,"title":1},"10":{"body":0,"breadcrumbs":3,"title":1},"100":{"body":38,"breadcrumbs":3,"title":1},"101":{"body":49,"breadcrumbs":3,"title":1},"102":{"body":24,"breadcrumbs":3,"title":1},"103":{"body":28,"breadcrumbs":3,"title":1},"104":{"body":16,"breadcrumbs":3,"title":1},"105":{"body":21,"breadcrumbs":3,"title":1},"106":{"body":4,"breadcrumbs":5,"title":3},"107":{"body":13,"breadcrumbs":4,"title":2},"108":{"body":55,"breadcrumbs":4,"title":2},"109":{"body":19,"breadcrumbs":5,"title":3},"11":{"body":36,"breadcrumbs":3,"title":1},"110":{"body":14,"breadcrumbs":5,"title":3},"111":{"body":19,"breadcrumbs":4,"title":2},"112":{"body":26,"breadcrumbs":5,"title":3},"113":{"body":55,"breadcrumbs":3,"title":1},"114":{"body":32,"breadcrumbs":4,"title":2},"115":{"body":12,"breadcrumbs":3,"title":1},"116":{"body":3,"breadcrumbs":3,"title":1},"117":{"body":0,"breadcrumbs":3,"title":1},"118":{"body":5,"breadcrumbs":9,"title":7},"119":{"body":28,"breadcrumbs":5,"title":3},"12":{"body":25,"breadcrumbs":4,"title":2},"120":{"body":0,"breadcrumbs":3,"title":1},"121":{"body":52,"breadcrumbs":3,"title":1},"122":{"body":0,"breadcrumbs":4,"title":2},"123":{"body":66,"breadcrumbs":3,"title":1},"124":{"body":118,"breadcrumbs":3,"title":1},"125":{"body":37,"breadcrumbs":3,"title":1},"126":{"body":66,"breadcrumbs":3,"title":1},"127":{"body":31,"breadcrumbs":3,"title":1},"128":{"body":42,"breadcrumbs":4,"title":2},"129":{"body":28,"breadcrumbs":4,"title":2},"13":{"body":93,"breadcrumbs":4,"title":2},"130":{"body":43,"breadcrumbs":4,"title":2},"131":{"body":33,"breadcrumbs":5,"title":3},"132":{"body":77,"breadcrumbs":3,"title":1},"133":{"body":20,"breadcrumbs":6,"title":4},"134":{"body":25,"breadcrumbs":5,"title":3},"135":{"body":24,"breadcrumbs":3,"title":1},"136":{"body":0,"breadcrumbs":3,"title":1},"137":{"body":24,"breadcrumbs":6,"title":4},"138":{"body":25,"breadcrumbs":4,"title":2},"139":{"body":18,"breadcrumbs":7,"title":5},"14":{"body":62,"breadcrumbs":3,"title":1},"140":{"body":13,"breadcrumbs":6,"title":4},"141":{"body":9,"breadcrumbs":8,"title":6},"142":{"body":36,"breadcrumbs":7,"title":5},"143":{"body":20,"breadcrumbs":7,"title":5},"144":{"body":214,"breadcrumbs":6,"title":4},"145":{"body":0,"breadcrumbs":4,"title":2},"146":{"body":27,"breadcrumbs":6,"title":4},"147":{"body":0,"breadcrumbs":3,"title":1},"148":{"body":15,"breadcrumbs":3,"title":1},"149":{"body":12,"breadcrumbs":3,"title":1},"15":{"body":69,"breadcrumbs":5,"title":3},"150":{"body":16,"breadcrumbs":8,"title":6},"151":{"body":0,"breadcrumbs":3,"title":1},"152":{"body":11,"breadcrumbs":3,"title":1},"153":{"body":16,"breadcrumbs":3,"title":1},"154":{"body":9,"breadcrumbs":3,"title":1},"155":{"body":15,"breadcrumbs":3,"title":1},"156":{"body":0,"breadcrumbs":3,"title":1},"157":{"body":19,"breadcrumbs":6,"title":4},"158":{"body":18,"breadcrumbs":5,"title":3},"159":{"body":11,"breadcrumbs":3,"title":1},"16":{"body":0,"breadcrumbs":3,"title":1},"160":{"body":31,"breadcrumbs":3,"title":1},"161":{"body":37,"breadcrumbs":5,"title":3},"162":{"body":40,"breadcrumbs":4,"title":2},"163":{"body":30,"breadcrumbs":4,"title":2},"164":{"body":10,"breadcrumbs":4,"title":2},"165":{"body":105,"breadcrumbs":4,"title":2},"166":{"body":41,"breadcrumbs":3,"title":1},"167":{"body":18,"breadcrumbs":3,"title":1},"168":{"body":48,"breadcrumbs":4,"title":2},"169":{"body":11,"breadcrumbs":3,"title":1},"17":{"body":0,"breadcrumbs":3,"title":1},"170":{"body":22,"breadcrumbs":4,"title":2},"171":{"body":20,"breadcrumbs":4,"title":2},"172":{"body":32,"breadcrumbs":3,"title":1},"173":{"body":38,"breadcrumbs":4,"title":2},"174":{"body":89,"breadcrumbs":4,"title":2},"175":{"body":30,"breadcrumbs":6,"title":4},"176":{"body":63,"breadcrumbs":6,"title":4},"177":{"body":22,"breadcrumbs":3,"title":1},"178":{"body":0,"breadcrumbs":3,"title":1},"179":{"body":33,"breadcrumbs":5,"title":3},"18":{"body":16,"breadcrumbs":3,"title":1},"180":{"body":9,"breadcrumbs":4,"title":2},"181":{"body":37,"breadcrumbs":5,"title":3},"182":{"body":31,"breadcrumbs":5,"title":3},"183":{"body":57,"breadcrumbs":3,"title":1},"184":{"body":2,"breadcrumbs":3,"title":1},"185":{"body":91,"breadcrumbs":7,"title":5},"186":{"body":8,"breadcrumbs":3,"title":1},"187":{"body":0,"breadcrumbs":4,"title":2},"188":{"body":86,"breadcrumbs":7,"title":5},"189":{"body":0,"breadcrumbs":3,"title":1},"19":{"body":69,"breadcrumbs":3,"title":1},"190":{"body":20,"breadcrumbs":3,"title":1},"191":{"body":28,"breadcrumbs":3,"title":1},"192":{"body":52,"breadcrumbs":3,"title":1},"193":{"body":39,"breadcrumbs":3,"title":1},"194":{"body":0,"breadcrumbs":3,"title":1},"195":{"body":52,"breadcrumbs":4,"title":2},"196":{"body":30,"breadcrumbs":4,"title":2},"197":{"body":9,"breadcrumbs":4,"title":2},"198":{"body":10,"breadcrumbs":4,"title":2},"199":{"body":6,"breadcrumbs":6,"title":3},"2":{"body":0,"breadcrumbs":3,"title":1},"20":{"body":92,"breadcrumbs":3,"title":1},"200":{"body":102,"breadcrumbs":5,"title":1},"201":{"body":0,"breadcrumbs":5,"title":1},"202":{"body":10,"breadcrumbs":6,"title":2},"203":{"body":21,"breadcrumbs":7,"title":3},"204":{"body":9,"breadcrumbs":8,"title":4},"205":{"body":10,"breadcrumbs":8,"title":4},"206":{"body":4,"breadcrumbs":9,"title":5},"207":{"body":17,"breadcrumbs":9,"title":5},"208":{"body":52,"breadcrumbs":5,"title":1},"209":{"body":28,"breadcrumbs":5,"title":1},"21":{"body":38,"breadcrumbs":4,"title":2},"210":{"body":26,"breadcrumbs":5,"title":1},"211":{"body":50,"breadcrumbs":8,"title":4},"212":{"body":6,"breadcrumbs":6,"title":2},"213":{"body":25,"breadcrumbs":5,"title":1},"214":{"body":14,"breadcrumbs":7,"title":3},"215":{"body":27,"breadcrumbs":5,"title":1},"216":{"body":6,"breadcrumbs":5,"title":1},"217":{"body":6,"breadcrumbs":4,"title":2},"218":{"body":6,"breadcrumbs":4,"title":1},"219":{"body":135,"breadcrumbs":4,"title":1},"22":{"body":26,"breadcrumbs":3,"title":1},"220":{"body":26,"breadcrumbs":4,"title":1},"221":{"body":27,"breadcrumbs":4,"title":1},"222":{"body":11,"breadcrumbs":4,"title":1},"223":{"body":128,"breadcrumbs":4,"title":1},"224":{"body":0,"breadcrumbs":4,"title":1},"225":{"body":15,"breadcrumbs":7,"title":4},"226":{"body":17,"breadcrumbs":7,"title":4},"227":{"body":43,"breadcrumbs":4,"title":1},"228":{"body":145,"breadcrumbs":4,"title":1},"229":{"body":33,"breadcrumbs":7,"title":4},"23":{"body":64,"breadcrumbs":5,"title":3},"230":{"body":5,"breadcrumbs":2,"title":1},"231":{"body":45,"breadcrumbs":3,"title":1},"232":{"body":34,"breadcrumbs":5,"title":3},"233":{"body":76,"breadcrumbs":5,"title":3},"234":{"body":19,"breadcrumbs":3,"title":1},"235":{"body":6,"breadcrumbs":5,"title":3},"236":{"body":7,"breadcrumbs":5,"title":3},"237":{"body":11,"breadcrumbs":4,"title":2},"238":{"body":15,"breadcrumbs":7,"title":5},"239":{"body":55,"breadcrumbs":3,"title":1},"24":{"body":35,"breadcrumbs":3,"title":1},"240":{"body":49,"breadcrumbs":3,"title":1},"241":{"body":8,"breadcrumbs":4,"title":2},"242":{"body":101,"breadcrumbs":6,"title":4},"243":{"body":20,"breadcrumbs":6,"title":4},"244":{"body":7,"breadcrumbs":3,"title":1},"245":{"body":12,"breadcrumbs":2,"title":1},"246":{"body":0,"breadcrumbs":3,"title":1},"247":{"body":3,"breadcrumbs":4,"title":2},"248":{"body":10,"breadcrumbs":4,"title":2},"249":{"body":8,"breadcrumbs":3,"title":1},"25":{"body":58,"breadcrumbs":4,"title":2},"250":{"body":14,"breadcrumbs":4,"title":2},"251":{"body":496,"breadcrumbs":6,"title":4},"252":{"body":77,"breadcrumbs":4,"title":2},"253":{"body":8,"breadcrumbs":4,"title":2},"254":{"body":93,"breadcrumbs":6,"title":4},"255":{"body":141,"breadcrumbs":6,"title":4},"256":{"body":69,"breadcrumbs":7,"title":5},"257":{"body":248,"breadcrumbs":5,"title":3},"258":{"body":208,"breadcrumbs":7,"title":5},"259":{"body":314,"breadcrumbs":6,"title":4},"26":{"body":123,"breadcrumbs":3,"title":1},"260":{"body":231,"breadcrumbs":7,"title":5},"261":{"body":127,"breadcrumbs":5,"title":3},"262":{"body":0,"breadcrumbs":3,"title":1},"263":{"body":62,"breadcrumbs":5,"title":3},"264":{"body":34,"breadcrumbs":5,"title":3},"265":{"body":0,"breadcrumbs":3,"title":1},"266":{"body":0,"breadcrumbs":3,"title":1},"267":{"body":41,"breadcrumbs":3,"title":1},"268":{"body":18,"breadcrumbs":4,"title":2},"269":{"body":25,"breadcrumbs":4,"title":2},"27":{"body":66,"breadcrumbs":3,"title":1},"270":{"body":0,"breadcrumbs":3,"title":1},"271":{"body":104,"breadcrumbs":4,"title":2},"272":{"body":9,"breadcrumbs":4,"title":2},"273":{"body":0,"breadcrumbs":3,"title":1},"274":{"body":89,"breadcrumbs":5,"title":3},"275":{"body":0,"breadcrumbs":3,"title":1},"276":{"body":27,"breadcrumbs":5,"title":3},"277":{"body":0,"breadcrumbs":6,"title":4},"278":{"body":36,"breadcrumbs":4,"title":2},"279":{"body":81,"breadcrumbs":4,"title":2},"28":{"body":0,"breadcrumbs":3,"title":1},"280":{"body":20,"breadcrumbs":3,"title":1},"281":{"body":0,"breadcrumbs":4,"title":2},"282":{"body":14,"breadcrumbs":4,"title":2},"283":{"body":12,"breadcrumbs":4,"title":2},"284":{"body":16,"breadcrumbs":3,"title":1},"285":{"body":17,"breadcrumbs":4,"title":2},"286":{"body":23,"breadcrumbs":3,"title":1},"287":{"body":0,"breadcrumbs":3,"title":1},"288":{"body":38,"breadcrumbs":4,"title":2},"289":{"body":30,"breadcrumbs":4,"title":2},"29":{"body":19,"breadcrumbs":4,"title":2},"290":{"body":128,"breadcrumbs":7,"title":5},"291":{"body":246,"breadcrumbs":5,"title":3},"292":{"body":422,"breadcrumbs":6,"title":3},"293":{"body":278,"breadcrumbs":6,"title":3},"294":{"body":17,"breadcrumbs":4,"title":1},"295":{"body":0,"breadcrumbs":3,"title":1},"296":{"body":59,"breadcrumbs":4,"title":2},"297":{"body":45,"breadcrumbs":5,"title":3},"298":{"body":43,"breadcrumbs":4,"title":2},"299":{"body":28,"breadcrumbs":4,"title":2},"3":{"body":96,"breadcrumbs":3,"title":1},"30":{"body":19,"breadcrumbs":3,"title":1},"300":{"body":8,"breadcrumbs":3,"title":1},"301":{"body":98,"breadcrumbs":3,"title":1},"302":{"body":140,"breadcrumbs":3,"title":1},"303":{"body":49,"breadcrumbs":6,"title":4},"304":{"body":273,"breadcrumbs":3,"title":1},"305":{"body":225,"breadcrumbs":3,"title":1},"306":{"body":8,"breadcrumbs":2,"title":1},"307":{"body":0,"breadcrumbs":3,"title":1},"308":{"body":80,"breadcrumbs":3,"title":1},"309":{"body":13,"breadcrumbs":6,"title":4},"31":{"body":25,"breadcrumbs":4,"title":2},"310":{"body":31,"breadcrumbs":6,"title":4},"311":{"body":46,"breadcrumbs":3,"title":1},"312":{"body":4,"breadcrumbs":3,"title":1},"313":{"body":27,"breadcrumbs":3,"title":1},"314":{"body":77,"breadcrumbs":5,"title":3},"315":{"body":87,"breadcrumbs":5,"title":3},"316":{"body":0,"breadcrumbs":4,"title":2},"317":{"body":48,"breadcrumbs":4,"title":2},"318":{"body":18,"breadcrumbs":4,"title":2},"319":{"body":43,"breadcrumbs":3,"title":1},"32":{"body":16,"breadcrumbs":5,"title":3},"320":{"body":64,"breadcrumbs":3,"title":1},"321":{"body":154,"breadcrumbs":7,"title":5},"322":{"body":36,"breadcrumbs":7,"title":5},"323":{"body":0,"breadcrumbs":3,"title":1},"324":{"body":7,"breadcrumbs":6,"title":4},"325":{"body":59,"breadcrumbs":5,"title":3},"326":{"body":42,"breadcrumbs":6,"title":4},"327":{"body":6,"breadcrumbs":4,"title":2},"328":{"body":62,"breadcrumbs":4,"title":2},"329":{"body":59,"breadcrumbs":3,"title":1},"33":{"body":95,"breadcrumbs":3,"title":1},"330":{"body":30,"breadcrumbs":5,"title":3},"331":{"body":166,"breadcrumbs":5,"title":3},"332":{"body":78,"breadcrumbs":6,"title":4},"333":{"body":6,"breadcrumbs":5,"title":3},"334":{"body":41,"breadcrumbs":5,"title":3},"335":{"body":34,"breadcrumbs":5,"title":3},"336":{"body":3,"breadcrumbs":3,"title":1},"337":{"body":75,"breadcrumbs":3,"title":1},"338":{"body":4,"breadcrumbs":5,"title":3},"339":{"body":50,"breadcrumbs":7,"title":5},"34":{"body":8,"breadcrumbs":4,"title":2},"340":{"body":29,"breadcrumbs":5,"title":3},"341":{"body":96,"breadcrumbs":4,"title":2},"342":{"body":94,"breadcrumbs":5,"title":3},"343":{"body":66,"breadcrumbs":6,"title":4},"344":{"body":4,"breadcrumbs":5,"title":3},"345":{"body":13,"breadcrumbs":6,"title":4},"346":{"body":5,"breadcrumbs":5,"title":3},"347":{"body":16,"breadcrumbs":5,"title":3},"348":{"body":51,"breadcrumbs":4,"title":2},"349":{"body":31,"breadcrumbs":6,"title":4},"35":{"body":8,"breadcrumbs":4,"title":2},"350":{"body":22,"breadcrumbs":5,"title":3},"351":{"body":51,"breadcrumbs":3,"title":1},"352":{"body":29,"breadcrumbs":5,"title":3},"353":{"body":26,"breadcrumbs":9,"title":7},"354":{"body":5,"breadcrumbs":2,"title":1},"355":{"body":0,"breadcrumbs":3,"title":1},"356":{"body":64,"breadcrumbs":3,"title":1},"357":{"body":0,"breadcrumbs":3,"title":1},"358":{"body":17,"breadcrumbs":6,"title":4},"359":{"body":92,"breadcrumbs":4,"title":2},"36":{"body":0,"breadcrumbs":4,"title":2},"360":{"body":0,"breadcrumbs":3,"title":1},"361":{"body":38,"breadcrumbs":6,"title":4},"362":{"body":5,"breadcrumbs":5,"title":2},"363":{"body":31,"breadcrumbs":7,"title":4},"364":{"body":41,"breadcrumbs":5,"title":2},"365":{"body":29,"breadcrumbs":5,"title":2},"366":{"body":5,"breadcrumbs":4,"title":1},"367":{"body":60,"breadcrumbs":3,"title":1},"368":{"body":13,"breadcrumbs":3,"title":1},"369":{"body":10,"breadcrumbs":8,"title":6},"37":{"body":10,"breadcrumbs":2,"title":0},"370":{"body":54,"breadcrumbs":8,"title":6},"371":{"body":31,"breadcrumbs":6,"title":4},"372":{"body":140,"breadcrumbs":7,"title":5},"373":{"body":1,"breadcrumbs":7,"title":5},"374":{"body":3,"breadcrumbs":2,"title":1},"375":{"body":0,"breadcrumbs":3,"title":1},"376":{"body":19,"breadcrumbs":4,"title":2},"377":{"body":55,"breadcrumbs":6,"title":4},"378":{"body":128,"breadcrumbs":5,"title":3},"379":{"body":50,"breadcrumbs":4,"title":2},"38":{"body":14,"breadcrumbs":3,"title":1},"380":{"body":0,"breadcrumbs":3,"title":1},"381":{"body":87,"breadcrumbs":3,"title":1},"382":{"body":0,"breadcrumbs":3,"title":1},"383":{"body":236,"breadcrumbs":6,"title":4},"384":{"body":4,"breadcrumbs":2,"title":1},"385":{"body":21,"breadcrumbs":3,"title":1},"386":{"body":0,"breadcrumbs":3,"title":1},"387":{"body":62,"breadcrumbs":5,"title":3},"388":{"body":15,"breadcrumbs":4,"title":2},"389":{"body":102,"breadcrumbs":4,"title":2},"39":{"body":4,"breadcrumbs":3,"title":1},"390":{"body":14,"breadcrumbs":6,"title":4},"391":{"body":40,"breadcrumbs":4,"title":2},"392":{"body":52,"breadcrumbs":3,"title":1},"393":{"body":116,"breadcrumbs":4,"title":2},"394":{"body":17,"breadcrumbs":5,"title":3},"395":{"body":0,"breadcrumbs":5,"title":3},"396":{"body":40,"breadcrumbs":5,"title":3},"397":{"body":23,"breadcrumbs":5,"title":3},"398":{"body":14,"breadcrumbs":5,"title":3},"399":{"body":15,"breadcrumbs":5,"title":3},"4":{"body":88,"breadcrumbs":3,"title":1},"40":{"body":5,"breadcrumbs":3,"title":1},"400":{"body":29,"breadcrumbs":3,"title":1},"401":{"body":31,"breadcrumbs":5,"title":3},"402":{"body":0,"breadcrumbs":5,"title":3},"403":{"body":44,"breadcrumbs":6,"title":4},"404":{"body":17,"breadcrumbs":5,"title":3},"405":{"body":13,"breadcrumbs":5,"title":3},"406":{"body":20,"breadcrumbs":5,"title":3},"407":{"body":94,"breadcrumbs":4,"title":2},"408":{"body":53,"breadcrumbs":3,"title":1},"409":{"body":14,"breadcrumbs":3,"title":1},"41":{"body":11,"breadcrumbs":3,"title":1},"410":{"body":0,"breadcrumbs":3,"title":1},"411":{"body":40,"breadcrumbs":5,"title":3},"412":{"body":52,"breadcrumbs":6,"title":4},"413":{"body":0,"breadcrumbs":4,"title":2},"414":{"body":18,"breadcrumbs":5,"title":3},"415":{"body":38,"breadcrumbs":4,"title":2},"416":{"body":0,"breadcrumbs":3,"title":1},"417":{"body":47,"breadcrumbs":3,"title":1},"418":{"body":18,"breadcrumbs":3,"title":1},"419":{"body":18,"breadcrumbs":4,"title":2},"42":{"body":24,"breadcrumbs":3,"title":1},"420":{"body":0,"breadcrumbs":7,"title":5},"421":{"body":35,"breadcrumbs":5,"title":3},"422":{"body":8,"breadcrumbs":5,"title":3},"423":{"body":3,"breadcrumbs":5,"title":3},"424":{"body":27,"breadcrumbs":3,"title":1},"425":{"body":52,"breadcrumbs":4,"title":2},"426":{"body":36,"breadcrumbs":5,"title":3},"427":{"body":141,"breadcrumbs":4,"title":2},"428":{"body":30,"breadcrumbs":3,"title":1},"429":{"body":10,"breadcrumbs":3,"title":1},"43":{"body":24,"breadcrumbs":3,"title":1},"430":{"body":0,"breadcrumbs":3,"title":1},"431":{"body":23,"breadcrumbs":5,"title":3},"432":{"body":8,"breadcrumbs":4,"title":2},"433":{"body":55,"breadcrumbs":4,"title":2},"434":{"body":0,"breadcrumbs":4,"title":2},"435":{"body":18,"breadcrumbs":5,"title":3},"436":{"body":50,"breadcrumbs":4,"title":2},"437":{"body":96,"breadcrumbs":3,"title":1},"438":{"body":0,"breadcrumbs":7,"title":5},"439":{"body":44,"breadcrumbs":5,"title":3},"44":{"body":185,"breadcrumbs":5,"title":3},"440":{"body":11,"breadcrumbs":5,"title":3},"441":{"body":3,"breadcrumbs":5,"title":3},"442":{"body":26,"breadcrumbs":3,"title":1},"443":{"body":65,"breadcrumbs":4,"title":2},"444":{"body":19,"breadcrumbs":5,"title":3},"445":{"body":165,"breadcrumbs":4,"title":2},"446":{"body":21,"breadcrumbs":3,"title":1},"447":{"body":9,"breadcrumbs":3,"title":1},"448":{"body":4,"breadcrumbs":3,"title":1},"449":{"body":55,"breadcrumbs":5,"title":3},"45":{"body":24,"breadcrumbs":3,"title":1},"450":{"body":143,"breadcrumbs":4,"title":2},"451":{"body":9,"breadcrumbs":3,"title":1},"46":{"body":74,"breadcrumbs":4,"title":2},"47":{"body":37,"breadcrumbs":3,"title":1},"48":{"body":19,"breadcrumbs":3,"title":1},"49":{"body":19,"breadcrumbs":3,"title":1},"5":{"body":79,"breadcrumbs":3,"title":1},"50":{"body":86,"breadcrumbs":4,"title":2},"51":{"body":119,"breadcrumbs":3,"title":1},"52":{"body":128,"breadcrumbs":3,"title":1},"53":{"body":24,"breadcrumbs":4,"title":2},"54":{"body":0,"breadcrumbs":3,"title":1},"55":{"body":23,"breadcrumbs":4,"title":2},"56":{"body":7,"breadcrumbs":3,"title":1},"57":{"body":21,"breadcrumbs":3,"title":1},"58":{"body":85,"breadcrumbs":3,"title":1},"59":{"body":45,"breadcrumbs":3,"title":1},"6":{"body":79,"breadcrumbs":4,"title":2},"60":{"body":54,"breadcrumbs":3,"title":1},"61":{"body":58,"breadcrumbs":3,"title":1},"62":{"body":46,"breadcrumbs":5,"title":3},"63":{"body":57,"breadcrumbs":5,"title":3},"64":{"body":118,"breadcrumbs":3,"title":1},"65":{"body":50,"breadcrumbs":3,"title":1},"66":{"body":64,"breadcrumbs":3,"title":1},"67":{"body":27,"breadcrumbs":3,"title":1},"68":{"body":28,"breadcrumbs":4,"title":2},"69":{"body":18,"breadcrumbs":3,"title":1},"7":{"body":48,"breadcrumbs":5,"title":3},"70":{"body":45,"breadcrumbs":4,"title":2},"71":{"body":63,"breadcrumbs":3,"title":1},"72":{"body":29,"breadcrumbs":4,"title":2},"73":{"body":29,"breadcrumbs":4,"title":2},"74":{"body":108,"breadcrumbs":5,"title":3},"75":{"body":0,"breadcrumbs":3,"title":1},"76":{"body":18,"breadcrumbs":4,"title":2},"77":{"body":7,"breadcrumbs":4,"title":2},"78":{"body":40,"breadcrumbs":4,"title":2},"79":{"body":19,"breadcrumbs":6,"title":4},"8":{"body":40,"breadcrumbs":3,"title":1},"80":{"body":39,"breadcrumbs":4,"title":2},"81":{"body":34,"breadcrumbs":4,"title":2},"82":{"body":25,"breadcrumbs":7,"title":5},"83":{"body":0,"breadcrumbs":3,"title":1},"84":{"body":74,"breadcrumbs":3,"title":1},"85":{"body":21,"breadcrumbs":4,"title":2},"86":{"body":40,"breadcrumbs":3,"title":1},"87":{"body":50,"breadcrumbs":3,"title":1},"88":{"body":77,"breadcrumbs":3,"title":1},"89":{"body":57,"breadcrumbs":3,"title":1},"9":{"body":46,"breadcrumbs":4,"title":2},"90":{"body":51,"breadcrumbs":3,"title":1},"91":{"body":24,"breadcrumbs":3,"title":1},"92":{"body":43,"breadcrumbs":3,"title":1},"93":{"body":24,"breadcrumbs":3,"title":1},"94":{"body":19,"breadcrumbs":3,"title":1},"95":{"body":32,"breadcrumbs":4,"title":2},"96":{"body":22,"breadcrumbs":3,"title":1},"97":{"body":39,"breadcrumbs":3,"title":1},"98":{"body":23,"breadcrumbs":4,"title":2},"99":{"body":26,"breadcrumbs":3,"title":1}},"docs":{"0":{"body":"A personal collection of notes and cheatsheets. Source code is located at johannst/notes .","breadcrumbs":"Introduction » Notes","id":"0","title":"Notes"},"1":{"body":"zsh bash fish tmux git awk emacs gpg gdb gdbserver radare2 qemu pacman dot ffmpeg column sort sed","breadcrumbs":"Tools » Tools","id":"1","title":"Tools"},"10":{"body":"","breadcrumbs":"Tools » zsh » Completion","id":"10","title":"Completion"},"100":{"body":"To generate etags using ctags ctags -R -e . generate emacs tag file (important `-e`) Navigate using tags key fn description\n----------------------------------------------- xref-find-definitions find definition of tag xref-find-apropos find symbols matching regexp xref-find-references find references of tag","breadcrumbs":"Tools » emacs » tags","id":"100","title":"tags"},"101":{"body":"key fn description\n------------------------------ ielm open interactive elips shell In lisp-interaction-mode (*scratch* buffer by defult) key fn description\n-------------------------------------------------------- C-j eval-print-last-sexp evaluate & print preceeding lisp expr C-x C-e eval-last-sexp evaluate lisp expr C-u C-x C-e eval-last-sexp evaluate & print","breadcrumbs":"Tools » emacs » lisp","id":"101","title":"lisp"},"102":{"body":"Builtin fuzzy completion mode (eg buffer select, dired, ...). key fn description\n------------------------------------------ ido-mode toggle ido mode / cycle through available competions select completion","breadcrumbs":"Tools » emacs » ido","id":"102","title":"ido"},"103":{"body":"key fn description\n-------------------------- C-z toggle emacs/evil mode C-^ toggle between previous and current buffer C-p after paste cycle kill-ring back C-n after paste cycle kill-ring forward","breadcrumbs":"Tools » emacs » evil","id":"103","title":"evil"},"104":{"body":"key fn description\n-------------------------- i open sub-dir in same buffer + create new directory C copy file/dir q quit","breadcrumbs":"Tools » emacs » dired","id":"104","title":"dired"},"105":{"body":"gpg -o|--output Specify output file -a|--armor Create ascii output -u|--local-user Specify key for signing -r|--recipient Encrypt for user","breadcrumbs":"Tools » gpg » gpg(1)","id":"105","title":"gpg(1)"},"106":{"body":"gpg --full-generate-key","breadcrumbs":"Tools » gpg » Generate new keypair","id":"106","title":"Generate new keypair"},"107":{"body":"gpg -k / --list-key # public keys\ngpg -K / --list-secret-keys # secret keys","breadcrumbs":"Tools » gpg » List keys","id":"107","title":"List keys"},"108":{"body":"gpg --edit-key Gives prompt to modify KEY ID, common commands: help show help\nsave save & quit list list keys and user IDs\nkey select subkey \nuid select user ID expire change expiration of selected key adduid add user ID\ndeluid delete selected user ID addkey add subkey\ndelkey delete selected subkey","breadcrumbs":"Tools » gpg » Edit keys","id":"108","title":"Edit keys"},"109":{"body":"gpg --export --armor --output \ngpg --export-secret-key --armor --output \ngpg --import ","breadcrumbs":"Tools » gpg » Export & Import Keys","id":"109","title":"Export & Import Keys"},"11":{"body":"Completion functions are provided via files and need to be placed in a location covered by $fpath. By convention the completion files are names as _. A completion skeleton for the command foo, stored in _foo #compdef _foo foo function _foo() { ...\n} Alternatively one can install a completion function explicitly by calling compdef .","breadcrumbs":"Tools » zsh » Installation","id":"11","title":"Installation"},"110":{"body":"gpg --keyserver --send-keys \ngpg --keyserver --search-keys ","breadcrumbs":"Tools » gpg » Search & Send keys","id":"110","title":"Search & Send keys"},"111":{"body":"Encrypt file using passphrase and write encrypted data to .gpg. gpg --symmetric # Decrypt using passphrase\ngpg -o --decrypt .gpg","breadcrumbs":"Tools » gpg » Encrypt (passphrase)","id":"111","title":"Encrypt (passphrase)"},"112":{"body":"Encrypt file with public key of specified recipient and write encrypted data to .gpg. gpg --encrypt -r foo@bar.de # Decrypt at foos side (private key required)\ngpg -o --decrypt .gpg","breadcrumbs":"Tools » gpg » Encrypt (public key)","id":"112","title":"Encrypt (public key)"},"113":{"body":"Generate a signed file and write to .gpg. # Sign with private key of foo@bar.de\ngpg --sign -u foor@bar.de # Verify with public key of foo@bar.de\ngpg --verify # Extract content from signed file\ngpg -o --decrypt .gpg Without -u use first private key in list gpg -K for signing. Files can also be signed and encrypted at once, gpg will first sign the file and then encrypt it. gpg --sign --encrypt -r ","breadcrumbs":"Tools » gpg » Signing","id":"113","title":"Signing"},"114":{"body":"Generate a detached signature and write to .asc. Send .asc along with when distributing. gpg --detach-sign --armor -u foor@bar.de # Verify\ngpg --verify .asc Without -u use first private key in list gpg -K for signing.","breadcrumbs":"Tools » gpg » Signing (detached)","id":"114","title":"Signing (detached)"},"115":{"body":"sec secret key ssb secret subkey pub public key sub public subkey","breadcrumbs":"Tools » gpg » Abbreviations","id":"115","title":"Abbreviations"},"116":{"body":"http://pgp.mit.edu http://keyserver.ubuntu.com hkps://pgp.mailbox.org","breadcrumbs":"Tools » gpg » Keyservers","id":"116","title":"Keyservers"},"117":{"body":"","breadcrumbs":"Tools » gpg » Examples","id":"117","title":"Examples"},"118":{"body":"gpg --keyid-format 0xlong ","breadcrumbs":"Tools » gpg » List basic key information from file with long keyids","id":"118","title":"List basic key information from file with long keyids"},"119":{"body":"gpg --edit-key # By default we are on the primary key, can switch to sub key.\ngpg> key 1 # Update the expire date.\ngpg> expire gpg> save # Update keyserver(s) and/or export new pub keyfile.","breadcrumbs":"Tools » gpg » Extend expiring key","id":"119","title":"Extend expiring key"},"12":{"body":"Following variables are available in Completion functions: $words # array with command line in words\n$#words # number words\n$CURRENT # index into $words for cursor position\n$words[CURRENT-1] # previous word (relative to cursor position)","breadcrumbs":"Tools » zsh » Completion Variables","id":"12","title":"Completion Variables"},"120":{"body":"","breadcrumbs":"Tools » gdb » gdb(1)","id":"120","title":"gdb(1)"},"121":{"body":"gdb [opts] [prg [-c coredump | -p pid]] gdb [opts] --args prg opts: -p attach to pid -c use -x execute script before prompt -ex execute command before prompt --tty set I/O tty for debugee --batch run in batch mode, exit after processing options (eg used for scripting)","breadcrumbs":"Tools » gdb » CLI","id":"121","title":"CLI"},"122":{"body":"","breadcrumbs":"Tools » gdb » Interactive usage","id":"122","title":"Interactive usage"},"123":{"body":"tty Set as tty for debugee. Make sure nobody reads from target tty, easiest is to spawn a shell and run following in target tty: > while true; do sleep 1024; done sharedlibrary [] Load symbols of shared libs loaded by debugee. Optionally use to filter libs for symbol loading. display [/FMT] Print every time debugee stops. Eg print next instr, see examples below. undisplay [] Delete display expressions either all or one referenced by . info display List display expressions.","breadcrumbs":"Tools » gdb » Misc","id":"123","title":"Misc"},"124":{"body":"break [-qualified] thread Set a breakpoint only for a specific thread. -qualified: Treat as fully qualified symbol (quiet handy to set breakpoints on C symbols in C++ contexts) break if Set conditional breakpoint (see examples below). delete [] Delete breakpoint either all or one referenced by . info break List breakpoints. cond Make existing breakpoint conditional with . cond Remove condition from breakpoint . tbreak Set temporary breakpoint, will be deleted when hit. Same syntax as `break`. rbreak Set breakpoints matching , where matching internally is done on: .*.* command [] Define commands to run after breakpoint hit. If is not specified attach command to last created breakpoint. Command block terminated with 'end' token. : Space separates list, eg 'command 2 5-8' to run command for breakpoints: 2,5,6,7,8. save break Save breakpoints to . Can be loaded with the `source` command.","breadcrumbs":"Tools » gdb » Breakpoints","id":"124","title":"Breakpoints"},"125":{"body":"watch [-location|-l] [thread ] Create a watchpoint for , will break if is written to. Watchpoints respect scope of variables, -l can be used to watch the memory location instead. rwatch ... Sets a read watchpoint, will break if is read from. awatch ... Sets an access watchpoint, will break if is written to or read from.","breadcrumbs":"Tools » gdb » Watchpoints","id":"125","title":"Watchpoints"},"126":{"body":"catch load [] Stop when shared libraries are loaded, optionally specify a to stop only on matches. catch unload [] Stop when shared libraries are unloaded, optionally specify a to stop only on matches. catch throw Stop when an exception is thrown. catch rethrow Stop when an exception is rethrown. catch catch Stop when an exception is caught. catch fork Stop at calls to fork (also stops at clones, as some systems implement fork via clone). catch syscall [ ..] Stop at syscall. If no argument is given, stop at all syscalls. Optionally give a list of syscalls to stop at.","breadcrumbs":"Tools » gdb » Catchpoints","id":"126","title":"Catchpoints"},"127":{"body":"info functions [] List functions matching . List all functions if no provided. info variables [] List variables matching . List all variables if no provided. info register [ ..] Dump content of all registers or only the specified ister.","breadcrumbs":"Tools » gdb » Inspection","id":"127","title":"Inspection"},"128":{"body":"info handle [] Print how to handle . If no specified print for all signals. handle Configure how gdb handles sent to debugee. : stop/nostop Catch signal in gdb and break. print/noprint Print message when gdb catches signal. pass/nopass Pass signal down to debugee. catch signal Create a catchpoint for .","breadcrumbs":"Tools » gdb » Signal handling","id":"128","title":"Signal handling"},"129":{"body":"info thread List all threads. thread apply [] Run command on all threads listed by (space separated list). When 'all' is specified as the is run on all threads. thread name The for the current thread.","breadcrumbs":"Tools » gdb » Multi-threading","id":"129","title":"Multi-threading"},"13":{"body":"_describe simple completion, just words + description _arguments sophisticated completion, allow to specify actions Completion with _describe _describe MSG COMP MSG simple string with header message COMP array of completions where each entry is \"opt:description\" function _foo() { local -a opts opts=('bla:desc for bla' 'blu:desc for blu') _describe 'foo-msg' opts\n}\ncompdef _foo foo foo -- foo-msg --\nbla -- desc for bla\nblu -- desc for blu Completion with _arguments _arguments SPEC [SPEC...] where SPEC can have one of the following forms: OPT[DESC]:MSG:ACTION for option flags N:MSG:ACTION for positional arguments Available actions (op1 op2) list possible matches\n->VAL set $state=VAL and continue, `$state` can be checked later in switch case\nFUNC call func to generate matches\n{STR} evaluate `STR` to generate matches","breadcrumbs":"Tools » zsh » Completion Functions","id":"13","title":"Completion Functions"},"130":{"body":"set follow-fork-mode Specify which process to follow when debuggee makes a fork(2) syscall. set detach-on-frok Turn on/off detaching from new child processes (on by default). Turning this off allows to debug multiple processes (inferiors) with one gdb session. info inferiors List all processes gdb debugs. inferior Switch to inferior with .","breadcrumbs":"Tools » gdb » Multi-process","id":"130","title":"Multi-process"},"131":{"body":"dir Add to the beginning of the searh path for source files. show dir Show current search path. set substitute-path Add substitution rule checked during source file lookup. show substitute-path Show current substitution rules.","breadcrumbs":"Tools » gdb » Source file locations","id":"131","title":"Source file locations"},"132":{"body":"set disassembly-flavor Set the disassembly style \"flavor\". set pagination Turn on/off gdb's pagination. set breakpoint pending on: always set pending breakpoints. off: error when trying to set pending breakpoints. auto: interatively query user to set breakpoint. set print pretty Turn on/off pertty printing of structures. set style enabled Turn on/off styling (eg colored output). set logging Enable output logging to file (default gdb.txt). set logging file Change output log file to set logging redirect on: only log to file. off: log to file and tty.","breadcrumbs":"Tools » gdb » Configuration","id":"132","title":"Configuration"},"133":{"body":"C-x a Toggle UI. C-l Redraw UI (curses UI can be messed up after the debugee prints to stdout/stderr). C-x o Change focus.","breadcrumbs":"Tools » gdb » Text user interface (TUI)","id":"133","title":"Text user interface (TUI)"},"134":{"body":"Gdb allows to create & document user commands as follows: define # cmds end document # docu end To get all user commands or documentations one can use: help user-defined help ","breadcrumbs":"Tools » gdb » User commands (macros)","id":"134","title":"User commands (macros)"},"135":{"body":"Gdb allows to create two types of command hooks hook- will be run before hookpost- will be run after define hook- # cmds end define hookpost- # cmds end","breadcrumbs":"Tools » gdb » Hooks","id":"135","title":"Hooks"},"136":{"body":"","breadcrumbs":"Tools » gdb » Examples","id":"136","title":"Examples"},"137":{"body":"When ever the debugee stops automatically print the memory at the current instruction pointer ($rip x86) and format as instruction /i. # rip - x86 display /i $rip # step instruction, after the step the next instruction is automatically printed si","breadcrumbs":"Tools » gdb » Automatically print next instr","id":"137","title":"Automatically print next instr"},"138":{"body":"Create conditional breakpoints for a function void foo(int i) in the debugee. # Create conditional breakpoint b foo if i == 42 b foo # would create bp 2 # Make existing breakpoint conditional cond 2 i == 7","breadcrumbs":"Tools » gdb » Conditional breakpoints","id":"138","title":"Conditional breakpoints"},"139":{"body":"Create conditional breakpoint using the $_thread convenience variable . # Create conditional breakpoint on all threads except thread 12. b foo if $_thread != 12","breadcrumbs":"Tools » gdb » Set breakpoint on all threads except one","id":"139","title":"Set breakpoint on all threads except one"},"14":{"body":"Skeleton to copy/paste for writing simple completions. Assume a program foo with the following interface: foo -c green|red|blue -s low|high -f -d -h The completion handler could be implemented as follows in a file called _foo: #compdef _foo foo function _foo_color() { local colors=() colors+=('green:green color') colors+=('red:red color') colors+=('blue:blue color') _describe \"color\" colors\n} function _foo() { _arguments \\ \"-c[define color]:color:->s_color\" \\ \"-s[select sound]:sound:(low high)\" \\ \"-f[select file]:file:_files\" \\ \"-d[select dir]:dir:_files -/\" \\ \"-h[help]\" case $state in s_color) _foo_color;; esac\n}","breadcrumbs":"Tools » zsh » Example","id":"14","title":"Example"},"140":{"body":"This creates a catchpoint for the SIGSEGV signal and attached the command to it. catch signal SIGSEGV command bt c end","breadcrumbs":"Tools » gdb » Catch SIGSEGV and execute commands","id":"140","title":"Catch SIGSEGV and execute commands"},"141":{"body":"gdb --batch -ex 'thread 1' -ex 'bt' -p ","breadcrumbs":"Tools » gdb » Run backtrace on thread 1 (batch mode)","id":"141","title":"Run backtrace on thread 1 (batch mode)"},"142":{"body":"To script gdb add commands into a file and pass it to gdb via -x. For example create run.gdb: set pagination off break mmap command info reg rdi rsi rdx bt c end #initial drop c This script can be used as: gdb --batch -x ./run.gdb -p ","breadcrumbs":"Tools » gdb » Script gdb for automating debugging sessions","id":"142","title":"Script gdb for automating debugging sessions"},"143":{"body":"define break-save save breakpoint $arg0.gdb.bp\nend\ndefine break-load source $arg0.gdb.bp\nend define hook-quit break-save quit\nend","breadcrumbs":"Tools » gdb » Hook to automatically save breakpoints on quit","id":"143","title":"Hook to automatically save breakpoints on quit"},"144":{"body":"A symbolic watchpoint defined on a member variable for debugging is only valid as long as the expression is in scope. Once out of scope the watchpoint gets deleted. When debugging some memory corruption we want to keep the watchpoint even the expression goes out of scope to find the location that overrides the variable and introduces the corruption. (gdb) l\n1 struct S { int v; };\n2\n3 void set(struct S* s, int v) {\n4 s->v = v;\n5 }\n6\n7 int main() {\n8 struct S s;\n9 set(&s, 1);\n10 set(&s, 2);\n11 set(&s, 3);\n... (gdb) s\nset (s=0x7fffffffe594, v=1) at test.c:4\n4 s->v = v; # Define a new watchpoint on the member of the struct. The expression however\n# is only valid in the current functions scope. (gdb) watch s->v\nHardware watchpoint 2: s->v (gdb) c\nHardware watchpoint 2: s->v\nOld value = 0\nNew value = 1\nset (s=0x7fffffffe594, v=1) at test.c:5\n5 } # The watchpoint gets deleted as soon as we leave the function scope. (gdb) c\nWatchpoint 2 deleted because the program has left the block in\nwhich its expression is valid.\nmain () at test.c:10\n10 set(&s, 2); # Define the watchpoint on the location of the object to watch. (gdb) watch -l s->v # This is equivalent to the following. (gdb) p &s->v\n$1 = (int *) 0x7fffffffe594 # Define a watchpoint to the address of the member variable of the s instance.\n# This of course only makes sense as long as the s instance is not moved in memory. (gdb) watch *0x7fffffffe594\nHardware watchpoint 3: *0x7fffffffe594 (gdb) c\nHardware watchpoint 3: *0x7fffffffe594\nOld value = 1\nNew value = 2\nset (s=0x7fffffffe594, v=2) at test.c:5\n5 } (gdb) c\nHardware watchpoint 3: *0x7fffffffe594\nOld value = 2\nNew value = 3\nset (s=0x7fffffffe594, v=3) at test.c:5\n5 }","breadcrumbs":"Tools » gdb » Watchpoint on struct / class member","id":"144","title":"Watchpoint on struct / class member"},"145":{"body":"","breadcrumbs":"Tools » gdb » Know Bugs","id":"145","title":"Know Bugs"},"146":{"body":"When using finish inside a command block, commands after finish are not executed. To workaround that bug one can create a wrapper function which calls finish. define handler bt finish info reg rax end command handler end","breadcrumbs":"Tools » gdb » Workaround command + finish bug","id":"146","title":"Workaround command + finish bug"},"147":{"body":"","breadcrumbs":"Tools » gdbserver » gdbserver(1)","id":"147","title":"gdbserver(1)"},"148":{"body":"gdbserver [opts] comm prog [args] opts: --disable-randomization --no-disable-randomization --wrapper W -- comm: host:port tty","breadcrumbs":"Tools » gdbserver » CLI","id":"148","title":"CLI"},"149":{"body":"# Start gdbserver.\ngdbserver localhost:1234 /bin/ls # Attach gdb.\ngdb -ex 'target remote localhost:1234'","breadcrumbs":"Tools » gdbserver » Example","id":"149","title":"Example"},"15":{"body":"For this example we assume that the command foo takes at least three optional arguments such as foo arg1 arg2 arg3 [argN..] function _foo() { _arguments \\ \"1:opt 1:(a b c)\" \\ \":opt next:(d e f)\" \\ \"*:opt all:(u v w)\"\n} Explanation: 1:MSG:ACTION sets completion for the first optional argument :MSG:ACTION sets completion for the next optional argument *:MSG:ACTION sets completion for the optional argument where none of the previous rules apply, so in our example for arg3, argN... _files is a zsh builtin utility function to complete files/dirs see zsh completion functions zsh completion utility functions","breadcrumbs":"Tools » zsh » Example with optional arguments","id":"15","title":"Example with optional arguments"},"150":{"body":"Set env as execution wrapper with some variables. The wrapper will be executed before the debugee. gdbserver --wrapper env FOO=123 BAR=321 -- :12345 /bin/ls","breadcrumbs":"Tools » gdbserver » Wrapper example: Set environment variables just for the debugee","id":"150","title":"Wrapper example: Set environment variables just for the debugee"},"151":{"body":"","breadcrumbs":"Tools » radare2 » radare2(1)","id":"151","title":"radare2(1)"},"152":{"body":"pd [@ ] # print disassembly for instructions # with optional temporary seek to ","breadcrumbs":"Tools » radare2 » print","id":"152","title":"print"},"153":{"body":"fs # list flag-spaces fs # select flag-space f # print flags of selected flag-space","breadcrumbs":"Tools » radare2 » flags","id":"153","title":"flags"},"154":{"body":"?*~ # '?*' list all commands and '~' grep for ?*~... # '..' less mode /'...' interactive search","breadcrumbs":"Tools » radare2 » help","id":"154","title":"help"},"155":{"body":"> r2 -B # open mapped to addr oob # reopen current file at ","breadcrumbs":"Tools » radare2 » relocation","id":"155","title":"relocation"},"156":{"body":"","breadcrumbs":"Tools » radare2 » Examples","id":"156","title":"Examples"},"157":{"body":"> r2 [-w] oo+ # re-open for write if -w was not passed s # seek to position wv # write 4 byte (dword)","breadcrumbs":"Tools » radare2 » Patch file (alter bytes)","id":"157","title":"Patch file (alter bytes)"},"158":{"body":"rasm2 -L # list supported archs > rasm2 -a x86 'mov eax, 0xdeadbeef' b8efbeadde > rasm2 -a x86 -d \"b8efbeadde\" mov eax, 0xdeadbeef","breadcrumbs":"Tools » radare2 » Assemble / Disassmble (rasm2)","id":"158","title":"Assemble / Disassmble (rasm2)"},"159":{"body":"All the examples & notes use qemu-system-x86_64 but in most cases this can be swapped with the system emulator for other architectures.","breadcrumbs":"Tools » qemu » qemu(1)","id":"159","title":"qemu(1)"},"16":{"body":"","breadcrumbs":"Tools » bash » bash(1)","id":"16","title":"bash(1)"},"160":{"body":"Graphic mode: Ctrl+Alt+g release mouse capture from VM Ctrl+Alt+1 switch to display of VM\nCtrl+Alt+2 switch to qemu monitor No graphic mode: Ctrl+a h print help\nCtrl+a x exit emulator\nCtrl+a c switch between monitor and console","breadcrumbs":"Tools » qemu » Keybindings","id":"160","title":"Keybindings"},"161":{"body":"Following command-line gives a good starting point to assemble a VM: qemu-system-x86_64 \\ -cpu host -enable-kvm -smp 4 \\ -m 8G \\ -vga virtio -display sdl,gl=on \\ -boot menu=on \\ -cdrom \\ -hda \\ -device qemu-xhci,id=xhci \\ -device usb-host,bus=xhci.0,vendorid=0x05e1,productid=0x0408,id=capture-card","breadcrumbs":"Tools » qemu » VM config snippet","id":"161","title":"VM config snippet"},"162":{"body":"# Emulate host CPU in guest VM, enabling all supported host featured (requires KVM).\n# List available CPUs `qemu-system-x86_64 -cpu help`.\n-cpu host # Enable KVM instead software emulation.\n-enable-kvm # Configure number of guest CPUs.\n-smp # Configure size of guest RAM.\n-m 8G","breadcrumbs":"Tools » qemu » CPU & RAM","id":"162","title":"CPU & RAM"},"163":{"body":"# Use sdl window as display and enable openGL context.\n-display sdl,gl=on # Use vnc server as display (eg on display `:42` here).\n-display vnc=localhost:42 # Confifure virtio as 3D video graphic accelerator (requires virgl in guest).\n-vga virtio","breadcrumbs":"Tools » qemu » Graphic & Display","id":"163","title":"Graphic & Display"},"164":{"body":"# Enables boot menu to select boot device (enter with `ESC`).\n-boot menu=on","breadcrumbs":"Tools » qemu » Boot Menu","id":"164","title":"Boot Menu"},"165":{"body":"# Attach cdrom drive with iso to a VM.\n-cdrom # Attach disk drive to a VM.\n-hda # Generic way to configure & attach a drive to a VM.\n-drive file=,format=qcow2 Create a disk with qemu-img To create a qcow2 disk (qemu copy-on-write) of size 10G: qemu-img create -f qcow2 disk.qcow2 10G The disk does not contain any partitions or a partition table. We can format the disk from within the guest as following example: # Create `gpt` partition table.\nsudo parted /dev/sda mktable gpt # Create two equally sized primary partitions.\nsudo parted /dev/sda mkpart primary 0% 50%\nsudo parted /dev/sda mkpart primary 50% 100% # Create filesystem on each partition.\nsudo mkfs.ext3 /dev/sda1\nsudo mkfs.ext4 /dev/sda2 lsblk -f /dev/sda NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT sda ├─sda1 ext3 .... └─sda2 ext4 ....","breadcrumbs":"Tools » qemu » Block devices","id":"165","title":"Block devices"},"166":{"body":"Host Controller # Add XHCI USB controller to the VM (supports USB 3.0, 2.0, 1.1).\n# `id=xhci` creates a usb bus named `xhci`.\n-device qemu-xhci,id=xhci USB Device # Pass-through USB device from host identified by vendorid & productid and\n# attach to usb bus `xhci.0` (defined with controller `id`).\n-device usb-host,bus=xhci.0,vendorid=0x05e1,productid=0x0408","breadcrumbs":"Tools » qemu » USB","id":"166","title":"USB"},"167":{"body":"# Open gdbstub on tcp `` (`-s` shorthand for `-gdb tcp::1234`).\n-gdb tcp:: # Freeze guest CPU at startup and wait for debugger connection.\n-S","breadcrumbs":"Tools » qemu » Debugging","id":"167","title":"Debugging"},"168":{"body":"# Create raw tcp server for `serial IO` and wait until a client connects\n# before executing the guest.\n-serial tcp:localhost:12345,server,wait # Create telnet server for `serial IO` and wait until a client connects\n# before executing the guest.\n-serial telnet:localhost:12345,server,wait # Configure redirection for the QEMU `mointor`, arguments similar to `-serial`\n# above.\n-monitor ... In server mode use nowait to execute guest without waiting for a client connection.","breadcrumbs":"Tools » qemu » IO redirection","id":"168","title":"IO redirection"},"169":{"body":"# Redirect host tcp port `1234` to guest port `4321`.\n-nic user,hostfwd=tcp:localhost:1234-:4321","breadcrumbs":"Tools » qemu » Network","id":"169","title":"Network"},"17":{"body":"","breadcrumbs":"Tools » bash » Expansion","id":"17","title":"Expansion"},"170":{"body":"# Attach a `virtio-9p-pci` device to the VM.\n# The guest requires 9p support and can mount the shared drive as:\n# mount -t 9p -o trans=virtio someName /mnt\n-virtfs local,id=someName,path=,mount_tag=someName,security_model=none","breadcrumbs":"Tools » qemu » Shared drives","id":"170","title":"Shared drives"},"171":{"body":"# List debug items.\n-d help # Write debug log to file instead stderr.\n-D # Examples\n-d in_asm Log executed guest instructions.","breadcrumbs":"Tools » qemu » Debug logging","id":"171","title":"Debug logging"},"172":{"body":"# List name of all trace points.\n-trace help # Enable trace points matching pattern and optionally write trace to file.\n-trace [,file=] # Enable trace points for all events listed in the file.\n# File must contain one event/pattern per line.\n-trace events=","breadcrumbs":"Tools » qemu » Tracing","id":"172","title":"Tracing"},"173":{"body":"VM snapshots require that there is at least on qcow2 disk attached to the VM ( VM Snapshots ). Commands for qemu Monitor or QMP : # List available snapshots.\ninfo snapshots # Create/Load/Delete snapshot with name .\nsavevm \nloadvm \ndelvm The snapshot can also be directly specified when invoking qemu as: qemu-system-x86_64 \\ -loadvm \\ ...","breadcrumbs":"Tools » qemu » VM snapshots","id":"173","title":"VM snapshots"},"174":{"body":"Online migration example: # Start machine 1 on host ABC.\nqemu-system-x86_64 -monitor stdio -cdrom # Prepare machine 2 on host DEF as migration target.\n# Listen for any connection on port 12345.\nqemu-system-x86_64 -monitor stdio -incoming tcp:0.0.0.0:12345 # Start migration from the machine 1 monitor console.\n(qemu) migrate tcp:DEF:12345 Save to external file example: ```bash\n# Start machine 1.\nqemu-system-x86_64 -monitor stdio -cdrom # Save VM state to file.\n(qemu) migrate \"exec:gzip -c > vm.gz\" # Load VM from file.\nqemu-system-x86_64 -monitor stdio -incoming \"exec: gzip -d -c vm.gz\" The migration source machine and the migration target machine should be launched with the same parameters.","breadcrumbs":"Tools » qemu » VM Migration","id":"174","title":"VM Migration"},"175":{"body":"Example command line to directly boot a Kernel with an initrd ramdisk. qemu-system-x86_64 \\ -cpu host \\ -enable-kvm \\ -kernel /arch/x86/boot/bzImage \\ -append \"earlyprintk=ttyS0 console=ttyS0 nokaslr init=/init debug\" \\ -initrd /initramfs.cpio.gz \\ ... Instructions to build a minimal Kernel and initrd .","breadcrumbs":"Tools » qemu » Appendix: Direct Kernel boot","id":"175","title":"Appendix: Direct Kernel boot"},"176":{"body":"test: test.s as -o test.o test.s ld -o test test.o testc.o trace: test qemu-x86_64 -singlestep -d nochain,cpu ./test 2>&1 | awk '/RIP/ { print $$1; }' clean: $(RM) test test-bin test.o .section .text, \"ax\" .global _start\n_start: xor %rax, %rax mov $0x8, %rax\n1: cmp $0, %rax je 2f dec %rax jmp 1b\n2: # x86-64 exit(2) syscall mov $0, %rdi mov $60, %rax syscall","breadcrumbs":"Tools » qemu » Appendix: Cheap instruction tracer","id":"176","title":"Appendix: Cheap instruction tracer"},"177":{"body":"QEMU USB QEMU IMG QEMU Tools QEMU System QEMU Invocation (command line args) QEMU Monitor QEMU machine protocol (QMP) QEMU VM Snapshots","breadcrumbs":"Tools » qemu » References","id":"177","title":"References"},"178":{"body":"","breadcrumbs":"Tools » pacman » pacman(1)","id":"178","title":"pacman(1)"},"179":{"body":"pacman -Sy refresh package database\npacman -S install pkg\npacman -Ss search remote package database\npacman -Si get info for pkg\npacman -Su upgrade installed packages\npacman -Sc clean local package cache","breadcrumbs":"Tools » pacman » Remote package repositories","id":"179","title":"Remote package repositories"},"18":{"body":"# generate sequence from n to m\n{n..m}\n# generate sequence from n to m step by s\n{n..m..s} # expand cartesian product\n{a,b}{c,d}","breadcrumbs":"Tools » bash » Generator","id":"18","title":"Generator"},"180":{"body":"pacman -Rsn uninstall package and unneeded deps + config files","breadcrumbs":"Tools » pacman » Remove packages","id":"180","title":"Remove packages"},"181":{"body":"Local package database of installed packages. pacman -Q list all installed packages\npacman -Qs search local package database\npacman -Ql list files installed by pkg\npacman -Qo query package that owns file\npacman -Qe only list explicitly installed packages","breadcrumbs":"Tools » pacman » Local package database","id":"181","title":"Local package database"},"182":{"body":"Local file database which allows to search packages owning certain files. Also searches non installed packages, but database must be synced. pacman -Fy refresh file database\npacman -Fl list files in pkg (must not be installed)\npacman -Fx search","breadcrumbs":"Tools » pacman » Local file database","id":"182","title":"Local file database"},"183":{"body":"Uninstall all orphaned packages (including config files) that were installed as dependencies. pacman -Rsn $(pacman -Qtdq) List explicitly installed packages that are not required as dependency by any package and sort by size. pacman -Qetq | xargs pacman -Qi | awk '/Name/ { name=$3 } /Installed Size/ { printf \"%8.2f%s %s\\n\", $4, $5, name }' | sort -h Install package into different root directory but keep using the default database. pacman --root abc --dbpath /var/lib/pacman -S mingw-w64-gcc","breadcrumbs":"Tools » pacman » Hacks","id":"183","title":"Hacks"},"184":{"body":"Online playground","breadcrumbs":"Tools » dot » dot(1)","id":"184","title":"dot(1)"},"185":{"body":"Can be rendered to svg with the following command. dot -T svg -o g.svg g.dot Example dot file. // file: g.dot\ndigraph { // Render ranks from left to right. rankdir=LR // Make background transparent. bgcolor=transparent // Global node attributes. node [shape=box] // Global edge attributes. edge [style=dotted,color=red] // Add nodes & edge. stage1 -> stage2 // Add multiple edges at once. stage2 -> { stage3_1, stage3_2 } // Add edge with custom attributes. stage3_2 -> stage4 [label=\"some text\"] // Set custom attributes for specific node. stage4 [color=green,fillcolor=lightgray,style=\"filled,dashed\",label=\"s4\"] // Create a subgraph. This can be used to group nodes/edges or as scope for // global node/edge attributes. // If the name starts with 'cluster' a border is drawn. subgraph cluster_1 { stage5_1 stage5_2 } // Add some edges to subgraph nodes. stage3_1 -> { stage5_1, stage5_2 }\n} Rendered svg file. g.svg","breadcrumbs":"Tools » dot » Example dot file to copy & paste from.","id":"185","title":"Example dot file to copy & paste from."},"186":{"body":"DOT language Attributes Node shapes Colors User manual","breadcrumbs":"Tools » dot » References","id":"186","title":"References"},"187":{"body":"","breadcrumbs":"Tools » ffmpeg » ffmpeg (1)","id":"187","title":"ffmpeg (1)"},"188":{"body":"Following snippet allows to select a window which is then captured. #!/bin/bash echo \"Click on window to record ..\"\n# Extract window size and x,y offset.\nvideo_args=$(xwininfo \\ | awk '/Absolute upper-left X:/ { xoff = $4 } /Absolute upper-left Y:/ { yoff=$4 } /Width:/ { if ($2 % 2 == 1) { width=$2-1; } else { width=$2; } } /Height:/ { if ($2 % 2 == 1) { height=$2-1; } else { height=$2; } } END { printf \"-video_size %dx%d -i :0.0+%d,%d\", width, height, xoff, yoff }') ffmpeg -framerate 25 -f x11grab $video_args -pix_fmt yuv420p $@ output.mp4 Use yuv420p pixel format if video is played on the web ( ref ) The input -i 0,0+xoff,yoff means to capture $DISPLAY=0.0 starting at the coordinate (xoff, yoff), which is the left-upper corner, and the size of the capture is defined by the -video_size argument.","breadcrumbs":"Tools » ffmpeg » screen capture specific window (x11)","id":"188","title":"screen capture specific window (x11)"},"189":{"body":"","breadcrumbs":"Tools » column » column(1)","id":"189","title":"column(1)"},"19":{"body":"# default value\nbar=${foo:-some_val} # if $foo set, then bar=$foo else bar=some_val # alternate value\nbar=${foo:+bla $foo} # if $foo set, then bar=\"bla $foo\" else bar=\"\" # check param set\nbar=${foo:?msg} # if $foo set, then bar=$foo else exit and print msg # indirect\nFOO=foo\nBAR=FOO\nbar=${!BAR} # deref value of BAR -> bar=$FOO # prefix\n${foo#prefix} # remove prefix when expanding $foo\n# suffix\n${foo%suffix} # remove suffix when expanding $foo # substitute\n${foo/pattern/string} # replace pattern with string when expanding foo\n# pattern starts with\n# '/' replace all occurences of pattern\n# '#' pattern match at beginning\n# '%' pattern match at end Note: prefix/suffix/pattern are expanded as pathnames .","breadcrumbs":"Tools » bash » Parameter","id":"19","title":"Parameter"},"190":{"body":"# Show as table (aligned columns), with comma as delimiter from stdin.\necho -e 'a,b,c\\n111,22222,33' | column -t -s ',' # Show file as table.\ncolumn -t -s ',' test.csv","breadcrumbs":"Tools » column » Examples","id":"190","title":"Examples"},"191":{"body":"sort [opts] [file] opts: -r reverse output -b ignore leading blanks -n sort by numeric -h sort by human numeric -V sort by version -k sort by Nth key -t field separator","breadcrumbs":"Tools » sort » sort(1)","id":"191","title":"sort(1)"},"192":{"body":"# Sort by directory sizes.\ndu -sh * | sort -h # Sort numeric by second key.\n# The default key separator is non-blank to blank transition.\necho 'a 4\nd 10\nc 21' | sort -k2 -n # Sort numeric by second key, split at comma.\necho 'a,4\nd,10\nc,21' | sort -k2 -n -t, Use --debug to annotate part of the line used to sort and hence debug the key usage.","breadcrumbs":"Tools » sort » Examples","id":"192","title":"Examples"},"193":{"body":"sed [opts] [script] [file] opts: -i edit file in place -i.bk edit file in place and create backup file (with .bk suffix, can be specified differently) -e SCRIPT add SCRIPT to commands to be executed (can be specified multiple times) -f FILE add content of FILE to command to be executed --debug annotate program execution","breadcrumbs":"Tools » sed » sed(1)","id":"193","title":"sed(1)"},"194":{"body":"","breadcrumbs":"Tools » sed » Examples","id":"194","title":"Examples"},"195":{"body":"# Delete two lines.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '1d;3d'\n# bb\n# dd # Delete last ($) line.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '$d'\n# aa\n# bb\n# cc # Delete range of lines.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '1,3d'\n# dd # Delete lines matching pattern.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '/bb/d'\n# aa\n# cc\n# dd # Delete lines NOT matching pattern.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '/bb/!d'\n# bb","breadcrumbs":"Tools » sed » Delete lines","id":"195","title":"Delete lines"},"196":{"body":"# Insert before line.\necho -e 'aa\\nbb' | sed '2iABC'\n# aa\n# ABC\n# bb # Insert after line.\necho -e 'aa\\nbb' | sed '2aABC'\n# aa\n# bb\n# ABC # Replace line.\necho -e 'aa\\nbb' | sed '2cABC'\n# aa\n# ABC","breadcrumbs":"Tools » sed » Insert lines","id":"196","title":"Insert lines"},"197":{"body":"# Substitute by regex.\necho -e 'aafooaa\\ncc' | sed 's/foo/MOOSE/'\n# aaMOOSEaa\n# cc","breadcrumbs":"Tools » sed » Substitute lines","id":"197","title":"Substitute lines"},"198":{"body":"echo -e 'foo\\nbar' | sed -e 's/foo/FOO/' -e 's/FOO/BAR/'\n# BAR\n# bar","breadcrumbs":"Tools » sed » Multiple scripts","id":"198","title":"Multiple scripts"},"199":{"body":"lsof ss pidstat pgrep pmap pstack","breadcrumbs":"Resource analysis & monitor » Resource analysis & monitor","id":"199","title":"Resource analysis & monitor"},"2":{"body":"","breadcrumbs":"Tools » zsh » zsh(1)","id":"2","title":"zsh(1)"},"20":{"body":"* match any string\n? match any single char\n\\\\ match backslash\n[abc] match any char of 'a' 'b' 'c'\n[a-z] match any char between 'a' - 'z'\n[^ab] negate, match all not 'a' 'b'\n[:class:] match any char in class, available: alnum,alpha,ascii,blank,cntrl,digit,graph,lower, print,punct,space,upper,word,xdigit With extglob shell option enabled it is possible to have more powerful patterns. In the following pattern-list is one ore more patterns separated by | char. ?(pattern-list) matches zero or one occurrence of the given patterns\n*(pattern-list) matches zero or more occurrences of the given patterns\n+(pattern-list) matches one or more occurrences of the given patterns\n@(pattern-list) matches one of the given patterns\n!(pattern-list) matches anything except one of the given patterns Note: shopt -s extglob/shopt -u extglob to enable/disable extglob option.","breadcrumbs":"Tools » bash » Pathname","id":"20","title":"Pathname"},"200":{"body":"lsof -r ..... repeatedly execute command ervery seconds -a ......... AND slection filters instead ORing (OR: default) -p ... filter by +fg ........ show file flags for file descripros -n ......... don't convert network addr to hostnames -P ......... don't convert network port to service names -i <@h[:p]>. show connections to h (hostname|ip addr) with optional port p -s ... in conjunction with '-i' filter for protocol in state -U ......... show unix domain sockets ('@' indicates abstract sock name, see unix(7)) file flags: R/W/RW ..... read/write/read-write CR ......... create AP ......... append TR ......... truncate -s protocols TCP, UDP -s states (TCP) CLOSED, IDLE, BOUND, LISTEN, ESTABLISHED, SYN_SENT, SYN_RCDV, ESTABLISHED, CLOSE_WAIT, FIN_WAIT1, CLOSING, LAST_ACK, FIN_WAIT_2, TIME_WAIT -s states (UDP) Unbound, Idle","breadcrumbs":"Resource analysis & monitor » lsof » lsof(8)","id":"200","title":"lsof(8)"},"201":{"body":"","breadcrumbs":"Resource analysis & monitor » lsof » Examples","id":"201","title":"Examples"},"202":{"body":"Show open files with file flags for process: lsof +fg -p ","breadcrumbs":"Resource analysis & monitor » lsof » File flags","id":"202","title":"File flags"},"203":{"body":"Show open tcp connections for $USER: lsof -a -u $USER -i TCP Note : -a ands the results. If -a is not given all open files matching $USER and all tcp connections are listed ( ored ).","breadcrumbs":"Resource analysis & monitor » lsof » Open TCP connections","id":"203","title":"Open TCP connections"},"204":{"body":"Show open connections to localhost for $USER: lsof -a -u $USER -i @localhost","breadcrumbs":"Resource analysis & monitor » lsof » Open connection to specific host","id":"204","title":"Open connection to specific host"},"205":{"body":"Show open connections to port :1234 for $USER: lsof -a -u $USER -i :1234","breadcrumbs":"Resource analysis & monitor » lsof » Open connection to specific port","id":"205","title":"Open connection to specific port"},"206":{"body":"lsof -i 4TCP -s TCP:ESTABLISHED","breadcrumbs":"Resource analysis & monitor » lsof » IPv4 TCP connections in ESTABLISHED state","id":"206","title":"IPv4 TCP connections in ESTABLISHED state"},"207":{"body":"This may help to find which processes keep devices busy when trying to unmount and the device is currently busy. # Assuming /proc is a mount point.\nlsof /proc","breadcrumbs":"Resource analysis & monitor » lsof » List open files in a mounted directory.","id":"207","title":"List open files in a mounted directory."},"208":{"body":"ss [option] [filter] [option] -p ..... Show process using socket -l ..... Show sockets in listening state -4/-6 .. Show IPv4/6 sockets -x ..... Show unix sockets -n ..... Show numeric ports (no resolve) -O ..... Oneline output per socket [filter] dport/sport PORT .... Filter for destination/source port dst/src ADDR ........ Filter for destination/source address and/or .............. Logic operator ==/!= ............... Comparison operator (EXPR) .............. Group exprs","breadcrumbs":"Resource analysis & monitor » ss » ss(8)","id":"208","title":"ss(8)"},"209":{"body":"Show all tcp IPv4 sockets connecting to port 443: ss -4 'dport 443' Show all tcp IPv4 sockets that don't connect to port 443 or connect to address 1.2.3.4. ss -4 'dport != 443 or dst 1.2.3.4'","breadcrumbs":"Resource analysis & monitor » ss » Examples","id":"209","title":"Examples"},"21":{"body":"Note: The trick with bash I/O redirection is to interpret from left-to-right. # stdout & stderr to file\ncommand >file 2>&1\n# equivalent\ncommand &>file # stderr to stdout & stdout to file\ncommand 2>&1 >file The article Bash One-Liners Explained, Part III: All about redirections contains some nice visualization to explain bash redirections.","breadcrumbs":"Tools » bash » I/O redirection","id":"21","title":"I/O redirection"},"210":{"body":"pidstat [opt] [interval] [cont] -U [user] show username instead UID, optionally only show for user -r memory statistics -d I/O statistics -h single line per process and no lines with average","breadcrumbs":"Resource analysis & monitor » pidstat » pidstat(1)","id":"210","title":"pidstat(1)"},"211":{"body":"pidstat -r -p [interval] [count] minor_pagefault: Happens when the page needed is already in memory but not allocated to the faulting process, in that case the kernel only has to create a new page-table entry pointing to the shared physical page (not required to load a memory page from disk). major_pagefault: Happens when the page needed is NOT in memory, the kernel has to create a new page-table entry and populate the physical page (required to load a memory page from disk).","breadcrumbs":"Resource analysis & monitor » pidstat » Page fault and memory utilization","id":"211","title":"Page fault and memory utilization"},"212":{"body":"pidstat -d -p [interval] [count]","breadcrumbs":"Resource analysis & monitor » pidstat » I/O statistics","id":"212","title":"I/O statistics"},"213":{"body":"pgrep [opts] -n only list newest matching process -u only show matching for user -l additionally list command -a additionally list command + arguments -x match exactly","breadcrumbs":"Resource analysis & monitor » pgrep » pgrep(1)","id":"213","title":"pgrep(1)"},"214":{"body":"For example attach gdb to newest zsh process from $USER. gdb -p $(pgrep -n -u $USER zsh)","breadcrumbs":"Resource analysis & monitor » pgrep » Debug newest process","id":"214","title":"Debug newest process"},"215":{"body":"pmap [opts] Dump virtual memory map of process. Compared to /proc//maps it shows the size of the mappings.\nopts: -p show full path in the mapping -x show details (eg RSS usage of each segment)","breadcrumbs":"Resource analysis & monitor » pmap » pmap(1)","id":"215","title":"pmap(1)"},"216":{"body":"pstack Dump stack for all threads of process.","breadcrumbs":"Resource analysis & monitor » pstack » pstack(1)","id":"216","title":"pstack(1)"},"217":{"body":"time strace ltrace perf OProfile callgrind","breadcrumbs":"Trace and Profile » Trace and Profile","id":"217","title":"Trace and Profile"},"218":{"body":"# statistics of process run\n/usr/bin/time -v ","breadcrumbs":"Trace and Profile » time » /usr/bin/time(1)","id":"218","title":"/usr/bin/time(1)"},"219":{"body":"strace [opts] [prg] -f .......... follow child processes on fork(2) -ff ......... follow fork and separate output file per child -p .... attach to running process -s ... max string size, truncate of longer (default: 32) -e ... expression for trace filtering -o ... log output into -c .......... dump syscall statitics at the end -C .......... like -c but dump regular ouput as well -k .......... dump stack trace for each syscall -P ... only trace syscall accesing path -y .......... print paths for FDs -tt ......... print absolute timestamp (with us precision) -r .......... print relative timestamp -z .......... log only successful syscalls -Z .......... log only failed syscalls -n .......... print syscall numbers -y .......... translate fds (eg file path, socket) -yy ......... translate fds with all information (eg IP) -x .......... print non-ASCII chars as hex string : trace=syscall[,syscall] .... trace only syscall listed trace=file ................. trace all syscall that take a filename as arg trace=process .............. trace process management related syscalls trace=signal ............... trace signal related syscalls signal ..................... trace signals delivered to the process","breadcrumbs":"Trace and Profile » strace » strace(1)","id":"219","title":"strace(1)"},"22":{"body":"j>&i Duplicate fd i to fd j, making j a copy of i. See dup2(2) . Example: command 2>&1 >file duplicate fd 1 to fd 2, effectively redirecting stderr to stdout redirect stdout to file","breadcrumbs":"Tools » bash » Explanation","id":"22","title":"Explanation"},"220":{"body":"Trace open(2) & socket(2) syscalls for a running process + child processes: strace -f -e trace=open,socket -p Trace signals delivered to a running process: strace -e signal -e 'trace=!all' -p ","breadcrumbs":"Trace and Profile » strace » Examples","id":"220","title":"Examples"},"221":{"body":"ltrace [opts] [prg] -f .......... follow child processes on fork(2) -p .... attach to running process -o ... log output into -l . show who calls into lib matched by -C .......... demangle","breadcrumbs":"Trace and Profile » ltrace » ltrace(1)","id":"221","title":"ltrace(1)"},"222":{"body":"List which program/libs call into libstdc++: ltrace -l '*libstdc++*' -C -o ltrace.log ./main","breadcrumbs":"Trace and Profile » ltrace » Example","id":"222","title":"Example"},"223":{"body":"perf list show supported hw/sw events perf stat -p .. show stats for running process -I ... show stats periodically over interval -e ... filter for events perf top -p .. show stats for running process -F ... sampling frequency -K ........ hide kernel threads perf record -p ............... record stats for running process -F ................ sampling frequency --call-graph .. [fp, dwarf, lbr] method how to caputre backtrace fp : use frame-pointer, need to compile with -fno-omit-frame-pointer dwarf: use .cfi debug information lbr : use hardware last branch record facility -g ..................... short-hand for --call-graph fp -e ................ filter for events perf report -n .................... annotate symbols with nr of samples --stdio ............... report to stdio, if not presen tui mode -g graph,0.5,caller ... show caller based call chains with value >0.5 Useful : page-faults minor-faults major-faults cpu-cycles` task-clock","breadcrumbs":"Trace and Profile » perf » perf(1)","id":"223","title":"perf(1)"},"224":{"body":"","breadcrumbs":"Trace and Profile » perf » Flamegraph","id":"224","title":"Flamegraph"},"225":{"body":"perf record -g -e cpu-cycles -p \nperf script | FlameGraph/stackcollapse-perf.pl | FlameGraph/flamegraph.pl > cycles-flamegraph.svg","breadcrumbs":"Trace and Profile » perf » Flamegraph with single event trace","id":"225","title":"Flamegraph with single event trace"},"226":{"body":"perf record -g -e cpu-cycles,page-faults -p \nperf script --per-event-dump\n# fold & generate as above","breadcrumbs":"Trace and Profile » perf » Flamegraph with multiple event traces","id":"226","title":"Flamegraph with multiple event traces"},"227":{"body":"operf -g -p -g ...... caputre call-graph information opreport [opt] FILE show time spent per binary image -l ...... show time spent per symbol -c ...... show callgraph information (see below) -a ...... add column with time spent accumulated over child nodes ophelp show supported hw/sw events","breadcrumbs":"Trace and Profile » OProfile » OProfile","id":"227","title":"OProfile"},"228":{"body":"Callgrind is a tracing profiler to record the function call history of a target program. It is part of the valgrind tool suite. Profiling data is collected by instrumentation rather than sampling of the target program. Callgrind does not capture the actual time spent in a function but computes the cost of a function based on the instructions fetched (Ir = Instruction read). Therefore effects like slow IO are not reflected, which should be kept in mind when analyzing callgrind results. By default the profiler data is dumped when the target process is terminating, but callgrind_control allows for interactive control of callgrind. # Run a program under callgrind.\nvalgrind --tool=callgrind -- # Interactive control of callgrind.\ncallgrind_control [opts] opts: -b ............. show current backtrace -e ............. show current event counters -s ............. show current stats --dump[=file] .. dump current collection -i=on|off ...... turn instrumentation on|off Results can be analyzed by using one of the following tools callgrind_annotate (cli) kcachegrind (ui) The following is a collection of frequently used callgrind options. valgrind --tool=callgrind [opts] -- opts: --callgrind-out-file= .... output file, rather than callgrind.out. --dump-instr= .......... annotation on instrucion level, allows for asm annotations --instr-atstart= ....... control if instrumentation is enabled from beginning of the program --separate-threads= .... create separate output files per thread, appends -