<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Unix on Janik von Rotz</title>
    <link>https://janikvonrotz.ch/categories/unix/</link>
    <description>Recent content in Unix on Janik von Rotz</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 30 Mar 2021 22:30:50 +0200</lastBuildDate>
    <atom:link href="https://janikvonrotz.ch/categories/unix/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Move Docker data directory to new location</title>
      <link>https://janikvonrotz.ch/2021/03/30/move-docker-data-directory-to-new-location/</link>
      <pubDate>Tue, 30 Mar 2021 22:30:50 +0200</pubDate>
      <guid>https://janikvonrotz.ch/2021/03/30/move-docker-data-directory-to-new-location/</guid>
      <description>&lt;p&gt;The standard data directory used for docker is &lt;code&gt;/var/lib/docker&lt;/code&gt;, and since this directory will store all your images, volumes, etc. it can become quite large.&lt;/p&gt;&#xA;&lt;p&gt;Follow the steps below to move the Docker data directory to a new location. This makes especially sense if you want to avoid running out of disk space on your root partition.&lt;/p&gt;&#xA;&lt;p&gt;Stop the Docker deamon.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo service docker stop&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Create a config file &lt;strong&gt;/etc/docker/daemon.json&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{ &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;data-root&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/path/to/your/docker&amp;#34;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Copy the current directory to the new directory.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo cp -rp /var/lib/docker /path/to/your/docker&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Rename the old directory.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo mv /var/lib/docker /var/lib/docker.old&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Restart the Docker deamon.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo service docker start&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Test if all services work as expected.&lt;/p&gt;&#xA;&lt;p&gt;If everything is good, remove the old Docker directory.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo rm -rf /var/lib/docker.old&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Tmux Cheat Sheet</title>
      <link>https://janikvonrotz.ch/2020/11/11/tmux-cheat-sheet/</link>
      <pubDate>Wed, 11 Nov 2020 11:01:47 +0100</pubDate>
      <guid>https://janikvonrotz.ch/2020/11/11/tmux-cheat-sheet/</guid>
      <description>&lt;p&gt;Tmux is a terminal multiplexer for Unix-like operating systems. It allows multiple terminal sessions to be accessed simultaneously in a single window. It is useful for running more than one command-line program at the same time. It can also be used to detach processes from their controlling terminals, allowing SSH sessions to remain active without being visible.&lt;/p&gt;&#xA;&lt;h2 id=&#34;install&#34;&gt;Install&lt;/h2&gt;&#xA;&lt;p&gt;See &lt;a href=&#34;https://github.com/tmux/tmux/wiki/Installing&#34;&gt;https://github.com/tmux/tmux/wiki/Installing&lt;/a&gt; for details.&lt;/p&gt;&#xA;&lt;h2 id=&#34;basics&#34;&gt;Basics&lt;/h2&gt;&#xA;&lt;p&gt;Start new session.&lt;br&gt;&#xA;&lt;code&gt;tmux&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Attach to last session.&lt;br&gt;&#xA;&lt;code&gt;tmux a&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Show time.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;t&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Kill session.&lt;br&gt;&#xA;&lt;code&gt;tmux kill-session&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;window&#34;&gt;Window&lt;/h2&gt;&#xA;&lt;p&gt;Create new window.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;c&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Rename new window.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;,&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Close window.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;&amp;amp;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Select window.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;[0-9]&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;List windows.&lt;br&gt;&#xA;&lt;code&gt;ctrl + b w&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Enter window index.&lt;br&gt;&#xA;&lt;code&gt;ctrl + b &#39;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Swap windows.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ctrl + b :&#xA;swap-window -s 3 -t 1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Renumber windows.&#xA;&lt;code&gt;ctrl + b&lt;/code&gt; &lt;code&gt;move-window -r&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;pane&#34;&gt;Pane&lt;/h2&gt;&#xA;&lt;p&gt;Split vertically.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;%&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Toggle last active pane.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Split horizontally.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;&amp;quot;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Switch to pane to the direction.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;[h,j,k,l]&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Close current pane.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;x&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Move pane right.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;}&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Move pane left.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;{&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Convert pane into a window.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;!&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Resize  pane vertically.&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b + ↑&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b + ↓&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Resize  pane horizontally.&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b + ←&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b + →&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;session&#34;&gt;Session&lt;/h2&gt;&#xA;&lt;p&gt;Detach from session.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;d&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Attach to last session.&lt;br&gt;&#xA;&lt;code&gt;tmux a&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Rename session.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;$&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;List sessions.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;s&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Attach to named session.&lt;br&gt;&#xA;&lt;code&gt;tmux a -t name&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Start new session.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;:new&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;copy-mode&#34;&gt;Copy Mode&lt;/h2&gt;&#xA;&lt;p&gt;Enter copy mode.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;[&lt;!-- raw HTML omitted --&gt; or &lt;!-- raw HTML omitted --&gt;v&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Search down.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;/&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Search up.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;?&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Next keyword occurance. &lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;n&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Navigate up and down.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + u&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;ctrl + d&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Start selection.&lt;br&gt;&#xA;&lt;code&gt;space&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Copy selection.&lt;br&gt;&#xA;&lt;code&gt;enter&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Paste selection.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;]&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;List buffers.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;code&gt;:list-buffer&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Paste buffer selection.&lt;br&gt;&#xA;&lt;code&gt;choose-buffer&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Save buffer.&lt;br&gt;&#xA;&lt;code&gt;save-buffer buf.txt&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Return to normal mode.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + c&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;plugins&#34;&gt;Plugins&lt;/h2&gt;&#xA;&lt;h3 id=&#34;tmux-resurrect&#34;&gt;tmux-resurrect&lt;/h3&gt;&#xA;&lt;p&gt;Save session.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;ctrl + s&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Restore session.&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;ctrl + b&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;ctrl + r&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Another Vim Cheat Sheet</title>
      <link>https://janikvonrotz.ch/2019/06/06/another-vim-cheat-sheet/</link>
      <pubDate>Thu, 06 Jun 2019 11:31:39 +0200</pubDate>
      <guid>https://janikvonrotz.ch/2019/06/06/another-vim-cheat-sheet/</guid>
      <description>&lt;p&gt;Getting started with Vim is not easy. Fueled by an entirely different ecosystem of plugins, scripts and obscure workflows it is difficult to see the advantage of using Vim. But, to watch experienced people using Vim is always impressive and makes one eager to learn it.&lt;/p&gt;&#xA;&lt;p&gt;This cheat sheet does not intend to provide you with a list of plugins and dotfiles, but aims at giving an overview of the most common commands. I assmelbed this document while learning to vim.&lt;/p&gt;&#xA;&lt;p&gt;In order to unsertand these command I recommend to read about the following Vim topics first:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;leader key&lt;/li&gt;&#xA;&lt;li&gt;plugins with plug&lt;/li&gt;&#xA;&lt;li&gt;modes and buffers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;sections&#34;&gt;Sections&lt;/h1&gt;&#xA;&lt;h2 id=&#34;plugins&#34;&gt;Plugins&lt;/h2&gt;&#xA;&lt;p&gt;Plugins are managed by vim plug. My vim config including the list of plugins is available at &lt;a href=&#34;https://codeberg.org/janikvonrotz/dotfiles&#34;&gt;GitHub - janikvonrotz/dotfiles&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;fzf-vim&#34;&gt;fzf vim&lt;/h3&gt;&#xA;&lt;p&gt;Open file with fzf in new split or tab.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ctrl + t &lt;span style=&#34;color:#75715e&#34;&gt;# tab split&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ctrl + x &lt;span style=&#34;color:#75715e&#34;&gt;# split&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ctrl + v &lt;span style=&#34;color:#75715e&#34;&gt;# vsplit&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Search git files with key bindings.&lt;br&gt;&#xA;&lt;code&gt;leader + f&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;fugitive&#34;&gt;fugitive&lt;/h3&gt;&#xA;&lt;p&gt;Resolve merge conflicts.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# open conflicted file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# run diff command&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;:Gdiff&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# navigate between remote and local version&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# use diff put to select changes&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;dp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# write changes&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;:Gwrite&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Checkout file from index.&lt;br&gt;&#xA;&lt;code&gt;:Gread&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Show file history.&lt;br&gt;&#xA;&lt;code&gt;:Gblame&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Rebase interactive.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Rebase last 10 commits&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git rebase -i HEAD~10&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Navigate and replace word&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cw&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Enter letter for commands&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;d&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;vim-indent-guides&#34;&gt;vim indent guides&lt;/h3&gt;&#xA;&lt;p&gt;Show indents.&lt;br&gt;&#xA;&lt;code&gt;leader + ig&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;basics&#34;&gt;Basics&lt;/h2&gt;&#xA;&lt;p&gt;Save current file.&lt;br&gt;&#xA;&lt;code&gt;:w&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Override current file.&lt;br&gt;&#xA;&lt;code&gt;:w!&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Save and quit.&lt;br&gt;&#xA;&lt;code&gt;:wq&lt;/code&gt; or &lt;code&gt;ZZ&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Reload current file.&lt;br&gt;&#xA;&lt;code&gt;:e&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Quit vim.&lt;br&gt;&#xA;&lt;code&gt;:q&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Quite all splits and tabs.&lt;br&gt;&#xA;&lt;code&gt;:qa&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;profile&#34;&gt;Profile&lt;/h2&gt;&#xA;&lt;p&gt;Reload vim profile.&lt;br&gt;&#xA;&lt;code&gt;:so $MYVIMRC&lt;/code&gt; or &lt;code&gt;:source %&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;modes&#34;&gt;Modes&lt;/h2&gt;&#xA;&lt;p&gt;Enter visual character selection mode.&lt;br&gt;&#xA;&lt;code&gt;v&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Enter visual line selection mode.&lt;br&gt;&#xA;&lt;code&gt;V&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Enter insert mode.&#xA;&lt;code&gt;i&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Enter insert mode after current character.&lt;br&gt;&#xA;&lt;code&gt;a&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Exit mode.&lt;br&gt;&#xA;&lt;code&gt;ctrl + c&lt;/code&gt; or &lt;code&gt;ESC&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;navigation&#34;&gt;Navigation&lt;/h2&gt;&#xA;&lt;p&gt;Open new or existing file inside vim.&lt;br&gt;&#xA;&lt;code&gt;:e /path/to/file&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Open file browser inside vim.&lt;br&gt;&#xA;&lt;code&gt;:e /path/to/direcotry&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Navigate with keys.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;h &lt;span style=&#34;color:#75715e&#34;&gt;# left&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;j &lt;span style=&#34;color:#75715e&#34;&gt;# down&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;k &lt;span style=&#34;color:#75715e&#34;&gt;# up&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ö &lt;span style=&#34;color:#75715e&#34;&gt;# right&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;w &lt;span style=&#34;color:#75715e&#34;&gt;# word&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;e &lt;span style=&#34;color:#75715e&#34;&gt;# end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;b &lt;span style=&#34;color:#75715e&#34;&gt;# back&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ &lt;span style=&#34;color:#75715e&#34;&gt;# end of line&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;# beginning of line&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Navigate pages.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ctrl + u &lt;span style=&#34;color:#75715e&#34;&gt;# page up&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ctrl + d &lt;span style=&#34;color:#75715e&#34;&gt;# page down&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;G &lt;span style=&#34;color:#75715e&#34;&gt;# go to bottom&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;gg &lt;span style=&#34;color:#75715e&#34;&gt;# go to top&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;List previous opened files.&lt;br&gt;&#xA;&lt;code&gt;:jumps&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Open the last file.&lt;br&gt;&#xA;&lt;code&gt;:e#&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Navigate search results.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;n # next&#xA;shift + n # previous&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;session&#34;&gt;Session&lt;/h2&gt;&#xA;&lt;p&gt;Save the current session.&lt;br&gt;&#xA;&lt;code&gt;:mksession&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Open vim with session file.&lt;br&gt;&#xA;&lt;code&gt;vim -S Session.vim&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;edit&#34;&gt;Edit&lt;/h2&gt;&#xA;&lt;p&gt;Undo changes.&lt;br&gt;&#xA;&lt;code&gt;u&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Redo changes.&lt;br&gt;&#xA;&lt;code&gt;ctrl + r&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Copy and paste.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# cut current selection&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;d&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# delete word&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;dw&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# copy current selection&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;y&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# cut the current line&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;dd&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# copy current line&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;yy&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# paste&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;p&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Search and replace in file.&lt;br&gt;&#xA;&lt;code&gt;:%s/old/new/g&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Add line below current line.&lt;br&gt;&#xA;&lt;code&gt;o&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Tell vim to not autoindent or otherwise alter the format of your pasted text.&lt;br&gt;&#xA;&lt;code&gt;:set paste&lt;/code&gt; or &lt;code&gt;:set nopaste&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Move line up or down.&lt;br&gt;&#xA;&lt;code&gt;ddp&lt;/code&gt; and &lt;code&gt;dd{j,k}p&lt;/code&gt; or &lt;code&gt;:m{+,-}{i}&lt;/code&gt; and &lt;code&gt;:m{i}&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;select&#34;&gt;Select&lt;/h2&gt;&#xA;&lt;p&gt;Select text between character.&lt;br&gt;&#xA;&lt;code&gt;vi{c}&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Select current word.&lt;br&gt;&#xA;&lt;code&gt;vw&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;window&#34;&gt;Window&lt;/h2&gt;&#xA;&lt;p&gt;Split window vertically.&lt;br&gt;&#xA;&lt;code&gt;:vs&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Split window horizontally.&lt;br&gt;&#xA;&lt;code&gt;:sp&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Switch between splits.&lt;br&gt;&#xA;&lt;code&gt;ctrl + w &amp;amp; {h,j,k,l}&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;leader&#34;&gt;Leader&lt;/h2&gt;&#xA;&lt;p&gt;Set leader key.&lt;br&gt;&#xA;&lt;code&gt;:let mapleader = &amp;quot;-&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;tabs&#34;&gt;Tabs&lt;/h2&gt;&#xA;&lt;p&gt;Open file in new tab.&lt;br&gt;&#xA;&lt;code&gt;:tabnew /path/to/file&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Open multiple files in tabs.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;:args path/to/files/*&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;:tab all&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Navigate tabs.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;gt &lt;span style=&#34;color:#75715e&#34;&gt;# go to next tab&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;gT &lt;span style=&#34;color:#75715e&#34;&gt;# go to previous tab&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;{&lt;/span&gt;i&lt;span style=&#34;color:#f92672&#34;&gt;}&lt;/span&gt;gt &lt;span style=&#34;color:#75715e&#34;&gt;# go to tab in position i&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;shell&#34;&gt;Shell&lt;/h2&gt;&#xA;&lt;p&gt;Run shell command in split pane.&lt;br&gt;&#xA;&lt;code&gt;:new | 0read ! command&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;buffer&#34;&gt;Buffer&lt;/h2&gt;&#xA;&lt;p&gt;Reload all buffers.&lt;br&gt;&#xA;&lt;code&gt;:bufdo e&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;sources&#34;&gt;Sources&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://learnvimscriptthehardway.stevelosh.com/chapters/06.html#leader&#34;&gt;Learn Vimscript the Hard Way&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://jesseleite.com/posts/2/its-dangerous-to-vim-alone-take-fzf&#34;&gt;Jesse Leite - It&amp;rsquo;s dangerous to Vim alone! Take Fzf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://thoughtbot.com/blog/vim-splits-move-faster-and-more-naturally&#34;&gt;Thoughtbot - Vim Splits - Move Faster and More Naturally&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Update Windows Subsystem for Linux</title>
      <link>https://janikvonrotz.ch/2018/01/30/update-windows-subsystem-for-linux/</link>
      <pubDate>Tue, 30 Jan 2018 10:32:51 +0000</pubDate>
      <guid>https://janikvonrotz.ch/2018/01/30/update-windows-subsystem-for-linux/</guid>
      <description>&lt;p&gt;Today I learned that certain Ubuntu package versions are bound to the release version of Ubuntu. For example the only available version of the password store tool &lt;em&gt;pass&lt;/em&gt; for Ubuntu LTS 14.04 (trusty) is &lt;em&gt;&lt;a href=&#34;https://packages.ubuntu.com/trusty/admin/pass&#34;&gt;1.4.2-3&lt;/a&gt;&lt;/em&gt;. If you need a newer version you have to update Ubuntu first. Usually this no big deal, however, if you work with Windows Subsystem for Linux (WSL) it is a big deal. The WSL release is bound to the Windows version. In result to update a package you have to update your Windows first.&lt;/p&gt;&#xA;&lt;h2 id=&#34;common-solution&#34;&gt;Common Solution&lt;/h2&gt;&#xA;&lt;p&gt;In case your Windows version is newer than your WSL version uninstall WSL.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;lxrun /uninstall /full&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;And reinstall WSL.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;lxrun /install&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Once finished you can check the version with &lt;code&gt;lsb_release -a&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;ugly-hack&#34;&gt;Ugly Hack&lt;/h2&gt;&#xA;&lt;p&gt;If you work in corporate environment you might not be able to get the latest Windows release. In this case you have to update Ubuntu itself which is not supported by Microsoft.&lt;/p&gt;&#xA;&lt;p&gt;First we have to prevent certain packages from being updated.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;sudo -S apt-mark hold procps strace sudo&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;These commands have been modified especially for WSL.&lt;/p&gt;&#xA;&lt;p&gt;Next run the release upgrade command.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;sudo -S env RELEASE_UPGRADER_NO_SCREEN=1 do-release-upgrade&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;If the update successfully finished you should be on the latest release.&lt;/p&gt;</description>
    </item>
    <item>
      <title>bin/bash^M: bad interpreter</title>
      <link>https://janikvonrotz.ch/2013/08/14/binbashm-bad-interpreter/</link>
      <pubDate>Wed, 14 Aug 2013 08:00:19 +0000</pubDate>
      <guid>https://janikvonrotz.ch/2013/08/14/binbashm-bad-interpreter/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re using windows and linux/unix and your also a system administrator who likes to script. The chances are high that you&amp;rsquo;ll get this error when executing a script on a linux/unix machine that has been made on a windows machine: &lt;code&gt;bin/bash^M: bad interpreter: No such file or directoy&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;^M&lt;/code&gt; character is a windows line break, which linux/unix can&amp;rsquo;t interpret. The solution is easy, use &lt;code&gt;dos2unix [filename]&lt;/code&gt; and everything should work fine.&lt;/p&gt;&#xA;</description>
    </item>
  </channel>
</rss>
