snipt

Ctrl+h for KB shortcuts

Bash

recursive grep

find /path/ -type f -name "*" | xargs grep
https://snipt.net/embed/e5f9673668c4ec897e1abb201256e871/
/raw/e5f9673668c4ec897e1abb201256e871/
e5f9673668c4ec897e1abb201256e871
bash
Bash
1
2019-08-21T17:38:51
True
False
False
/api/public/snipt/657/
recursive-grep
<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>find /path/ -type f -name <span class="s2">&quot;*&quot;</span> <span class="p">|</span> xargs grep </span></pre></div> </td></tr></table>
search, shell

Bash

Actualizar macports

$ sudo port -v selfupdate
$ sudo port upgrade outdated
https://snipt.net/embed/04f5e982a0de25b830677324839194e5/
/raw/04f5e982a0de25b830677324839194e5/
04f5e982a0de25b830677324839194e5
bash
Bash
2
2019-08-13T10:12:59
True
False
False
/api/public/snipt/626/
actualizar-macports
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ sudo port -v selfupdate </span><span id="L-2"><a name="L-2"></a>$ sudo port upgrade outdated </span></pre></div> </td></tr></table>
macports, osx

Perl

Set up proxy for www::mechanize

1
2
3
4
5
my $site = 'http://site';
$ENV{HTTP_PROXY}  = 'http://proxy:8080';
$ENV{HTTPS_PROXY} = 'http://proxy:8080';
my $m = WWW::Mechanize->new( autocheck => 1, stack_depth => 1 );
$m->proxy( ['https'], '' );
https://snipt.net/embed/25fd84aff9be5cd0f6e74dadd8a767ef/
/raw/25fd84aff9be5cd0f6e74dadd8a767ef/
25fd84aff9be5cd0f6e74dadd8a767ef
perl
Perl
5
2019-08-23T22:33:01
True
False
False
/api/public/snipt/616/
set-up-proxy-for-wwwmechanize
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">my</span> <span class="nv">$site</span> <span class="o">=</span> <span class="s">&#39;http://site&#39;</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$ENV</span><span class="p">{</span><span class="n">HTTP_PROXY</span><span class="p">}</span> <span class="o">=</span> <span class="s">&#39;http://proxy:8080&#39;</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="nv">$ENV</span><span class="p">{</span><span class="n">HTTPS_PROXY</span><span class="p">}</span> <span class="o">=</span> <span class="s">&#39;http://proxy:8080&#39;</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="k">my</span> <span class="nv">$m</span> <span class="o">=</span> <span class="nn">WWW::</span><span class="n">Mechanize</span><span class="o">-&gt;</span><span class="k">new</span><span class="p">(</span> <span class="n">autocheck</span> <span class="o">=&gt;</span> <span class="mi">1</span><span class="p">,</span> <span class="n">stack_depth</span> <span class="o">=&gt;</span> <span class="mi">1</span> <span class="p">);</span> </span><span id="L-5"><a name="L-5"></a><span class="nv">$m</span><span class="o">-&gt;</span><span class="n">proxy</span><span class="p">(</span> <span class="p">[</span><span class="s">&#39;https&#39;</span><span class="p">],</span> <span class="s">&#39;&#39;</span> <span class="p">);</span> </span></pre></div> </td></tr></table>
mechanize, proxy

Bash

Activate SoftRAID & LVM

1
2
3
dmraid -ay
vgscan -v
vgchange -a y 
https://snipt.net/embed/3875d2267822be040f9a6438251759be/
/raw/3875d2267822be040f9a6438251759be/
3875d2267822be040f9a6438251759be
bash
Bash
3
2019-08-25T16:20:50
True
False
False
/api/public/snipt/597/
activate-softraid-lvm
<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>dmraid -ay </span><span id="L-2"><a name="L-2"></a>vgscan -v </span><span id="L-3"><a name="L-3"></a>vgchange -a y </span></pre></div> </td></tr></table>
linux, lvm, raid

Bash

apply svn patch

patch -p0 -i ~/fix_ugly_bug.diff
https://snipt.net/embed/255eb29493f16ac032fed2cb1c01ad2f/
/raw/255eb29493f16ac032fed2cb1c01ad2f/
255eb29493f16ac032fed2cb1c01ad2f
bash
Bash
1
2019-08-25T02:44:38
True
False
False
/api/public/snipt/596/
apply-svn-patch
<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>patch -p0 -i ~/fix_ugly_bug.diff </span></pre></div> </td></tr></table>
subversion