aboutsummaryrefslogtreecommitdiffhomepage
path: root/print.html
diff options
context:
space:
mode:
authorjohannst <johannst@users.noreply.github.com>2020-03-18 23:26:10 +0000
committerjohannst <johannst@users.noreply.github.com>2020-03-18 23:26:10 +0000
commit678362c55acefe62bdacee22926db4edf65efc7e (patch)
treec50a5379343dd2cd227a8657a006cb4ddf30e4b4 /print.html
parentc0fbbcb873d30f059eb0a3c8c4fae0de5ebb3e26 (diff)
downloadnotes-678362c55acefe62bdacee22926db4edf65efc7e.tar.gz
notes-678362c55acefe62bdacee22926db4edf65efc7e.zip
deploy: ed2be86b970350be0b6aa8f18b63a313f3c76983
Diffstat (limited to 'print.html')
-rw-r--r--print.html99
1 files changed, 98 insertions, 1 deletions
diff --git a/print.html b/print.html
index 3f54a12..e4da796 100644
--- a/print.html
+++ b/print.html
@@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div id="sidebar-scrollbox" class="sidebar-scrollbox">
- <ol class="chapter"><li class="expanded "><a href="ld.so.html"><strong aria-hidden="true">1.</strong> ld.so</a></li><li class="expanded "><a href="git.html"><strong aria-hidden="true">2.</strong> git</a></li><li class="expanded "><a href="awk.html"><strong aria-hidden="true">3.</strong> awk</a></li><li class="expanded "><a href="gdb.html"><strong aria-hidden="true">4.</strong> gdb</a></li><li class="expanded "><a href="radare2.html"><strong aria-hidden="true">5.</strong> radare2</a></li><li class="expanded "><a href="emacs.html"><strong aria-hidden="true">6.</strong> emacs</a></li><li class="expanded "><a href="fish.html"><strong aria-hidden="true">7.</strong> fish</a></li><li class="expanded "><a href="strace.html"><strong aria-hidden="true">8.</strong> strace</a></li><li class="expanded "><a href="lsof.html"><strong aria-hidden="true">9.</strong> lsof</a></li><li class="expanded "><a href="pidstat.html"><strong aria-hidden="true">10.</strong> pidstat</a></li><li class="expanded "><a href="time.html"><strong aria-hidden="true">11.</strong> time</a></li><li class="expanded "><a href="pgrep.html"><strong aria-hidden="true">12.</strong> pgrep</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">13.</strong> pstack</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">14.</strong> pstack</a></li><li class="expanded "><a href="perf.html"><strong aria-hidden="true">15.</strong> perf</a></li><li class="expanded "><a href="oprofile.html"><strong aria-hidden="true">16.</strong> OProfile</a></li><li class="expanded "><a href="od.html"><strong aria-hidden="true">17.</strong> od</a></li><li class="expanded "><a href="xxd.html"><strong aria-hidden="true">18.</strong> xxd</a></li><li class="expanded "><a href="readelf.html"><strong aria-hidden="true">19.</strong> readelf</a></li><li class="expanded "><a href="objdump.html"><strong aria-hidden="true">20.</strong> objdump</a></li><li class="expanded "><a href="nm.html"><strong aria-hidden="true">21.</strong> nm</a></li><li class="expanded "><a href="c++filt.html"><strong aria-hidden="true">22.</strong> c++filt</a></li></ol>
+ <ol class="chapter"><li class="expanded "><a href="ld.so.html"><strong aria-hidden="true">1.</strong> ld.so</a></li><li class="expanded "><a href="git.html"><strong aria-hidden="true">2.</strong> git</a></li><li class="expanded "><a href="tmux.html"><strong aria-hidden="true">3.</strong> tmux</a></li><li class="expanded "><a href="awk.html"><strong aria-hidden="true">4.</strong> awk</a></li><li class="expanded "><a href="gdb.html"><strong aria-hidden="true">5.</strong> gdb</a></li><li class="expanded "><a href="radare2.html"><strong aria-hidden="true">6.</strong> radare2</a></li><li class="expanded "><a href="emacs.html"><strong aria-hidden="true">7.</strong> emacs</a></li><li class="expanded "><a href="fish.html"><strong aria-hidden="true">8.</strong> fish</a></li><li class="expanded "><a href="strace.html"><strong aria-hidden="true">9.</strong> strace</a></li><li class="expanded "><a href="lsof.html"><strong aria-hidden="true">10.</strong> lsof</a></li><li class="expanded "><a href="pidstat.html"><strong aria-hidden="true">11.</strong> pidstat</a></li><li class="expanded "><a href="time.html"><strong aria-hidden="true">12.</strong> time</a></li><li class="expanded "><a href="pgrep.html"><strong aria-hidden="true">13.</strong> pgrep</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">14.</strong> pstack</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">15.</strong> pstack</a></li><li class="expanded "><a href="perf.html"><strong aria-hidden="true">16.</strong> perf</a></li><li class="expanded "><a href="oprofile.html"><strong aria-hidden="true">17.</strong> OProfile</a></li><li class="expanded "><a href="od.html"><strong aria-hidden="true">18.</strong> od</a></li><li class="expanded "><a href="xxd.html"><strong aria-hidden="true">19.</strong> xxd</a></li><li class="expanded "><a href="readelf.html"><strong aria-hidden="true">20.</strong> readelf</a></li><li class="expanded "><a href="objdump.html"><strong aria-hidden="true">21.</strong> objdump</a></li><li class="expanded "><a href="nm.html"><strong aria-hidden="true">22.</strong> nm</a></li><li class="expanded "><a href="c++filt.html"><strong aria-hidden="true">23.</strong> c++filt</a></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav>
@@ -361,6 +361,103 @@ As we can see the offset from relocation at index <code>0</code> points to <code
difference between HEAD^ and HEAD~)
git rev-list --max-parents=0 HEAD ........... first commit
</code></pre>
+<h1><a class="header" href="#tmux1" id="tmux1">tmux(1)</a></h1>
+<p>Terminology:</p>
+<ul>
+<li><code>session</code> is a collection of pseudo terminals which can have multiple
+<code>windows</code></li>
+<li><code>window</code> uses the entire screen and can be split into rectangular <code>panes</code></li>
+<li><code>pane</code> is a single pseudo terminal instance</li>
+</ul>
+<h1><a class="header" href="#tmux-cli" id="tmux-cli">Tmux cli</a></h1>
+<pre><code class="language-markdown"># Session
+tmux creates new session
+tmux ls list running sessions
+tmux kill-session -t &lt;s&gt; kill running session &lt;s&gt;
+tmux attach -t &lt;s&gt; [-d] attach to session &lt;s&gt;, detach other clients [-d]
+tmux detach -s &lt;s&gt; detach all clients from session &lt;s&gt;
+
+# Environment
+tmux showenv -g show global tmux environment variables
+tmux setenv -g &lt;var&gt; &lt;val&gt; set variable in global tmux env
+
+# Misc
+tmux source-file &lt;file&gt; source config &lt;file&gt;
+tmux lscm list available tmux commnds
+tmux show -g show global tmux options
+tmux display &lt;msg&gt; display message in tmux status line
+</code></pre>
+<h2><a class="header" href="#scripting" id="scripting">Scripting</a></h2>
+<pre><code class="language-markdown"># Session
+tmux list-sessions -F '#S' list running sessions, only IDs
+
+# Window
+tmux list-windows -F '#I' -t &lt;s&gt; list window IDs for session &lt;s&gt;
+tmux selectw -t &lt;s&gt;:&lt;w&gt; select window &lt;w&gt; in session &lt;s&gt;
+
+# Pane
+tmux list-panes -F '#P' -t &lt;s&gt;:&lt;w&gt; list pane IDs for window &lt;w&gt; in session &lt;s&gt;
+tmux selectp -t &lt;s&gt;:&lt;w&gt;.&lt;p&gt; select pane &lt;p&gt; in window &lt;w&gt; in session &lt;s&gt;
+
+# Run commands
+tmux send -t &lt;s&gt;:&lt;w&gt;.&lt;p&gt; &quot;ls&quot; C-m send cmds/keys to pane
+tmux run -t &lt;p&gt; &lt;sh-cmd&gt; run shell command &lt;sh-cmd&gt; in background and report output on pane -t &lt;p&gt;
+</code></pre>
+<p>For example cycle through all panes in all windows in all sessions:</p>
+<pre><code class="language-bash"># bash
+for s in $(tmux list-sessions -F '#S'); do
+ for w in $(tmux list-windows -F '#I' -t $s); do
+ for p in $(tmux list-panes -F '#P' -t $s:$w); do
+ echo $s:$w.$p
+ done
+ done
+done
+</code></pre>
+<h1><a class="header" href="#bindings" id="bindings">Bindings</a></h1>
+<pre><code class="language-markdown">prefix d detach from current session
+prefix c create new window
+prefix w open window list
+prefix $ rename session
+prefix , rename window
+prefix . move current window
+</code></pre>
+<p>Following bindings are specific to my <a href="https://github.com/johannst/dotfiles/blob/master/tmux.conf"><code>tmux.conf</code></a>:</p>
+<pre><code class="language-markdown">C-s prefix
+
+# Panes
+prefix s horizontal split
+prefix v vertical split
+prefix f toggle maximize/minimize current pane
+
+# Movement
+prefix Tab toggle between window
+
+prefix h move to pane left
+prefix j move to pane down
+prefix k move to pane up
+prefix l move to pane right
+
+# Resize
+prefix C-h resize pane left
+prefix C-j resize pane down
+prefix C-k resize pane up
+prefix C-l resize pane right
+
+# Copy/Paste
+prefix C-v enter copy mode
+prefix C-p paste yanked text
+prefix C-b open copy-buffer list
+
+# In Copy Mode
+v enable visual mode
+y yank selected text
+</code></pre>
+<h1><a class="header" href="#command-mode" id="command-mode">Command mode</a></h1>
+<p>To enter command mode <code>prefix :</code>.</p>
+<p>Some useful commands are:</p>
+<pre><code class="language-markdown">setw synchronize-panes on/off enables/disables synchronized input to all panes
+list-keys -t vi-copy list keymaps for vi-copy mode
+</code></pre>
<h1><a class="header" href="#awk1" id="awk1">awk(1)</a></h1>
<pre><code class="language-markdown">awk [opt] program [input]
-F &lt;sepstr&gt; field separator string (can be regex)