snipt

Ctrl+h for KB shortcuts

Bash

List commit objects

$ git rev-list <branch_1>..<branch_2>
https://snipt.net/embed/7ee7858b5e2ba989588e168276dd6f18/
/raw/7ee7858b5e2ba989588e168276dd6f18/
7ee7858b5e2ba989588e168276dd6f18
bash
Bash
1
2019-07-17T12:33:33
True
False
False
/api/public/snipt/33488/
list-commit-objects
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ git rev-list &lt;branch_1&gt;..&lt;branch_2&gt; </span></pre></div> </td></tr></table>
git

Bash

List out files of a package

$ dpkg -L <package_name>
https://snipt.net/embed/79d483aca302990a6bd2a84148a82f22/
/raw/79d483aca302990a6bd2a84148a82f22/
79d483aca302990a6bd2a84148a82f22
bash
Bash
1
2019-07-19T22:52:18
True
False
False
/api/public/snipt/32439/
list-out-files-of-a-package
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ dpkg -L &lt;package_name&gt; </span></pre></div> </td></tr></table>
dpkg, linux, ubuntu

Bash

Create a dummy file

1
2
3
# Create a 1GB dummy file named 'test.bin'
# Reference: http://www.linuxforums.org/forum/suse-linux/58658-command-generate-large-dummy-files.html
$ time dd if=/dev/zero of=test.bin bs=1000000000 count=1
https://snipt.net/embed/a40f1cb9eca68b12e3a4c3327b1101f1/
/raw/a40f1cb9eca68b12e3a4c3327b1101f1/
a40f1cb9eca68b12e3a4c3327b1101f1
bash
Bash
3
2019-07-11T19:01:13
True
False
False
/api/public/snipt/29736/
create-a-dummy-file
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Create a 1GB dummy file named &#39;test.bin&#39;</span> </span><span id="L-2"><a name="L-2"></a><span class="c1"># Reference: http://www.linuxforums.org/forum/suse-linux/58658-command-generate-large-dummy-files.html</span> </span><span id="L-3"><a name="L-3"></a>$ <span class="nb">time</span> dd <span class="k">if</span><span class="o">=</span>/dev/zero <span class="nv">of</span><span class="o">=</span>test.bin <span class="nv">bs</span><span class="o">=</span><span class="m">1000000000</span> <span class="nv">count</span><span class="o">=</span>1 </span></pre></div> </td></tr></table>
bash

Bash

Revert to a previous revision

$ svn merge -rHEAD:<revision> .
https://snipt.net/embed/0dc6e4e25b4eddc12d4de9e0e8f245ab/
/raw/0dc6e4e25b4eddc12d4de9e0e8f245ab/
0dc6e4e25b4eddc12d4de9e0e8f245ab
bash
Bash
1
2019-07-12T06:12:43
True
False
False
/api/public/snipt/29359/
revert-to-a-previous-revision
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ svn merge -rHEAD:&lt;revision&gt; . </span></pre></div> </td></tr></table>
subversion

Bash

Turn off auto indent when pasting text into vim

1
2
3
4
5
6
7
# Switch to the 'paste' mode
:set paste

# Paste the text

# Turn off the 'paste' mode
:set nopaste
https://snipt.net/embed/744fdaead0084803e913257eab7d47b2/
/raw/744fdaead0084803e913257eab7d47b2/
744fdaead0084803e913257eab7d47b2
bash
Bash
7
2019-07-21T23:55:48
True
False
False
/api/public/snipt/29358/
turn-off-auto-indent-when-pasting-text-into-vim
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Switch to the &#39;paste&#39; mode</span> </span><span id="L-2"><a name="L-2"></a>:set paste </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># Paste the text</span> </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a><span class="c1"># Turn off the &#39;paste&#39; mode</span> </span><span id="L-7"><a name="L-7"></a>:set nopaste </span></pre></div> </td></tr></table>
vim

Bash

Select columns

Ctrl + v
https://snipt.net/embed/8b465d7484f3a7c5c91766f202a014e3/
/raw/8b465d7484f3a7c5c91766f202a014e3/
8b465d7484f3a7c5c91766f202a014e3
bash
Bash
1
2019-07-19T23:11:45
True
False
False
/api/public/snipt/29184/
select-columns
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>Ctrl + v </span></pre></div> </td></tr></table>
vim

Bash

Turn off search highlighting

:noh
https://snipt.net/embed/50f0fc40801a2cb7bb132c12ee7a4415/
/raw/50f0fc40801a2cb7bb132c12ee7a4415/
50f0fc40801a2cb7bb132c12ee7a4415
bash
Bash
1
2019-07-03T13:06:13
True
False
False
/api/public/snipt/28663/
turn-off-search-highlighting
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>:noh </span></pre></div> </td></tr></table>
vim

Bash

Upgrade Ruby from RVM

$ rvm upgrade <from> <to>
https://snipt.net/embed/d2368ea777915ba9f1b7f6447935fa81/
/raw/d2368ea777915ba9f1b7f6447935fa81/
d2368ea777915ba9f1b7f6447935fa81
bash
Bash
1
2019-07-18T22:42:33
True
False
False
/api/public/snipt/28600/
upgrade-ruby-from-rvm
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ rvm upgrade &lt;from&gt; &lt;to&gt; </span></pre></div> </td></tr></table>
ruby, rvm

Bash

Add all unversioned files

$ svn add --force .
https://snipt.net/embed/2c0f346fe1df99c170c3d327812a8152/
/raw/2c0f346fe1df99c170c3d327812a8152/
2c0f346fe1df99c170c3d327812a8152
bash
Bash
1
2019-07-14T20:05:40
True
False
False
/api/public/snipt/28511/
add-all-unversioned-files
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ svn add --force . </span></pre></div> </td></tr></table>
subversion

Bash

Upgrade/downgrade RubyGems

$ gem update --system <version>
https://snipt.net/embed/518a64f93af2eb3101582417105795bc/
/raw/518a64f93af2eb3101582417105795bc/
518a64f93af2eb3101582417105795bc
bash
Bash
1
2019-07-21T18:20:16
True
False
False
/api/public/snipt/26894/
upgradedowngrade-rubygems
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ gem update --system &lt;version&gt; </span></pre></div> </td></tr></table>
ruby, rubygems