Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

S

Collapse into one string

paste(..., collapse=ss )
https://snipt.net/embed/394e69f251050f0f4bfbe570bc645a77/
https://snipt.net/raw/394e69f251050f0f4bfbe570bc645a77/
394e69f251050f0f4bfbe570bc645a77
splus
S
1
2016-12-04T10:51:57
True
False
False
/api/public/snipt/22824/
collapse-into-one-string
<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><span class="kp">paste</span><span class="p">(</span><span class="kc">...</span><span class="p">,</span> collapse<span class="o">=</span>ss <span class="p">)</span> </span></pre></div> </td></tr></table>
cat, collapse, concatenate, paste, r

Bash

maillog

1
2
3
# Anaylyze mail logs within a given hour: 

cat maillog* | awk '/Mar 15 03*/'  <- replace month/day/hour
https://snipt.net/embed/e04bc5d7812a1fdbb4d2499a72dec334/
https://snipt.net/raw/e04bc5d7812a1fdbb4d2499a72dec334/
e04bc5d7812a1fdbb4d2499a72dec334
bash
Bash
3
2016-11-18T23:55:30
True
False
False
/api/public/snipt/12922/
maillog
<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"># Anaylyze mail logs within a given hour: </span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>cat maillog* <span class="p">|</span> awk <span class="s1">&#39;/Mar 15 03*/&#39;</span> &lt;- replace month/day/hour </span></pre></div> </td></tr></table>
cat, maillog

Bash

Speak volume info for Thinkpad laptop.

1
2
3
4
5
[email protected]:~$ cat /proc/acpi/ibm/volume 
level:		6
mute:		off
commands:	up, down, mute
commands:	level <level> (<level> is 0-15)
https://snipt.net/embed/038b3b02e8761f18dfefe30fd505d8a2/
https://snipt.net/raw/038b3b02e8761f18dfefe30fd505d8a2/
038b3b02e8761f18dfefe30fd505d8a2
bash
Bash
5
2016-12-04T12:51:51
True
False
False
/api/public/snipt/10373/
speak-volume-info-for-thinkpad-laptop
<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>[email protected]:~$ cat /proc/acpi/ibm/volume </span><span id="L-2"><a name="L-2"></a>level: 6 </span><span id="L-3"><a name="L-3"></a>mute: off </span><span id="L-4"><a name="L-4"></a>commands: up, down, mute </span><span id="L-5"><a name="L-5"></a>commands: level &lt;level&gt; <span class="o">(</span>&lt;level&gt; is 0-15<span class="o">)</span> </span></pre></div> </td></tr></table>
acpi, bash, cat, ibm, t60, thinkpad, volume

Bash

git cat

#!/bin/bash
git cat-file -p $(git ls-tree $1 "$2" | cut -d " " -f 3 | cut -f 1)
https://snipt.net/embed/179f8669052c040710020b2b70d0398e/
https://snipt.net/raw/179f8669052c040710020b2b70d0398e/
179f8669052c040710020b2b70d0398e
bash
Bash
2
2016-12-05T16:07:58
True
False
False
/api/public/snipt/9158/
git-cat
<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><span class="ch">#!/bin/bash</span> </span><span id="L-2"><a name="L-2"></a>git cat-file -p <span class="k">$(</span>git ls-tree <span class="nv">$1</span> <span class="s2">&quot;</span><span class="nv">$2</span><span class="s2">&quot;</span> <span class="p">|</span> cut -d <span class="s2">&quot; &quot;</span> -f <span class="m">3</span> <span class="p">|</span> cut -f 1<span class="k">)</span> </span></pre></div> </td></tr></table>
cat, git

Bash

cat, password

cat /etc/passwd
https://snipt.net/embed/e4bfd42de3ba1d94091905ca1ec5056f/
https://snipt.net/raw/e4bfd42de3ba1d94091905ca1ec5056f/
e4bfd42de3ba1d94091905ca1ec5056f
bash
Bash
1
2016-11-17T21:26:08
True
False
False
/api/public/snipt/5756/
cat-passwords
<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>cat /etc/passwd </span></pre></div> </td></tr></table>
cat, password

Bash

beancounters

cat /proc/user_beancounters
https://snipt.net/embed/b4ba2ac60eb24dca7595216391d72b18/
https://snipt.net/raw/b4ba2ac60eb24dca7595216391d72b18/
b4ba2ac60eb24dca7595216391d72b18
bash
Bash
1
2016-12-05T16:47:24
True
False
False
/api/public/snipt/5447/
beancounters
<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>cat /proc/user_beancounters </span></pre></div> </td></tr></table>
beancounters, cat

Bash

dv, invalid user, grep, cat

1
2
3
4
5
cat /var/log/secure | grep "invalid user"

# or

grep "invalid user" /var/log/secure
https://snipt.net/embed/b294d078d1aba52faa88dbe499fa2d17/
https://snipt.net/raw/b294d078d1aba52faa88dbe499fa2d17/
b294d078d1aba52faa88dbe499fa2d17
bash
Bash
5
2016-12-04T19:25:56
True
False
False
/api/public/snipt/4347/
dv-invalid-user-grep
<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>cat /var/log/secure <span class="p">|</span> grep <span class="s2">&quot;invalid user&quot;</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c1"># or</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>grep <span class="s2">&quot;invalid user&quot;</span> /var/log/secure </span></pre></div> </td></tr></table>
"invalid user", cat, dv, grep
Copyrighted, illegal, or inappropriate content? Email [email protected].