snipt

Ctrl+h for KB shortcuts
#108933

Bash

IPv6 Add/Remove IP Addresses

1
2
3
4
5
6
7
# Addming an IPv6 Address
/sbin/ifconfig <interface> inet6 add <ipv6address>/<prefixlength>
/sbin/ifconfig eth0 inet6 add 2001:0db8:0:f101::1/64

# Removing an IPv6 Address
/sbin/ifconfig <interface> inet6 del <ipv6address>/<prefixlength>
/sbin/ifconfig eth0 inet6 del 2001:0db8:0:f101::1/64
https://snipt.net/embed/7e35489c87b69b0ce2adfe304f6fa4ff/
https://snipt.net/raw/7e35489c87b69b0ce2adfe304f6fa4ff/
7e35489c87b69b0ce2adfe304f6fa4ff
bash
Bash
7
2014-04-16T08:20:28
True
False
Jan 27, 2014 at 10:43 PM
/api/public/snipt/108933/
ipv6-addremove-ip-addresses
<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 id="L-1"><a name="L-1"></a><span class="c"># Addming an IPv6 Address</span> </span><span id="L-2"><a name="L-2"></a>/sbin/ifconfig &lt;interface&gt; inet6 add &lt;ipv6address&gt;/&lt;prefixlength&gt; </span><span id="L-3"><a name="L-3"></a>/sbin/ifconfig eth0 inet6 add 2001:0db8:0:f101::1/64 </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c"># Removing an IPv6 Address</span> </span><span id="L-6"><a name="L-6"></a>/sbin/ifconfig &lt;interface&gt; inet6 del &lt;ipv6address&gt;/&lt;prefixlength&gt; </span><span id="L-7"><a name="L-7"></a>/sbin/ifconfig eth0 inet6 del 2001:0db8:0:f101::1/64 </span></pre></div> </td></tr></table>
bash, ipv6
#106483

Bash

workaround failed 'brew update'

1
2
3
4
cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master
https://snipt.net/embed/950cad4515e75bcf1279170f5214aba4/
https://snipt.net/raw/950cad4515e75bcf1279170f5214aba4/
950cad4515e75bcf1279170f5214aba4
bash
Bash
4
2014-04-16T08:20:28
True
False
Jan 17, 2014 at 03:28 AM
/api/public/snipt/106483/
workaround-failed-brew-update
<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></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nb">cd</span> <span class="sb">`</span>brew --prefix<span class="sb">`</span> </span><span id="L-2"><a name="L-2"></a>git remote add origin https://github.com/mxcl/homebrew.git </span><span id="L-3"><a name="L-3"></a>git fetch origin </span><span id="L-4"><a name="L-4"></a>git reset --hard origin/master </span></pre></div> </td></tr></table>
bash, brew, git
#103904

Bash

Copy directory structure

cd /source/dir
( cd /destination/dir/; sudo find . -depth -type d ! -name . -print0 ) | xargs -0 mkdir -p
https://snipt.net/embed/218cdc121a23332b57466b390fd9d4b6/
https://snipt.net/raw/218cdc121a23332b57466b390fd9d4b6/
218cdc121a23332b57466b390fd9d4b6
bash
Bash
2
2014-04-16T08:20:27
True
False
/api/public/snipt/103904/
copy-directory-structure
<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 id="L-1"><a name="L-1"></a><span class="nb">cd</span> /source/dir </span><span id="L-2"><a name="L-2"></a><span class="o">(</span> <span class="nb">cd</span> /destination/dir/<span class="p">;</span> sudo find . -depth -type d ! -name . -print0 <span class="o">)</span> <span class="p">|</span> xargs -0 mkdir -p </span></pre></div> </td></tr></table>
bash, mass
#97932

Bash

Watch a real 3D movie in 2D with MPlayer

mplayer <VIDEO_FILE> -vo gl:stereo=3
https://snipt.net/embed/11c192fc1ffbad4aff016669c8578b23/
https://snipt.net/raw/11c192fc1ffbad4aff016669c8578b23/
11c192fc1ffbad4aff016669c8578b23
bash
Bash
1
2014-04-16T08:20:27
True
False
Dec 02, 2013 at 07:48 AM
/api/public/snipt/97932/
watch-a-real-3d-movie-in-2d-with-mplayer
<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 id="L-1"><a name="L-1"></a>mplayer &lt;VIDEO_FILE&gt; -vo gl:stereo<span class="o">=</span>3 </span></pre></div> </td></tr></table>
2d, 3d, bash, movie, mplayer, video
#93399

Bash

Terminal check file permissions

stat -c %A fileNameToCheck
https://snipt.net/embed/69255e3c3dbfa946d35d09d6c7a914d2/
https://snipt.net/raw/69255e3c3dbfa946d35d09d6c7a914d2/
69255e3c3dbfa946d35d09d6c7a914d2
bash
Bash
1
2014-04-16T08:20:27
True
False
Nov 11, 2013 at 05:32 AM
/api/public/snipt/93399/
terminal-check-file-permissions
<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 id="L-1"><a name="L-1"></a>stat -c %A fileNameToCheck </span></pre></div> </td></tr></table>
bash, terminal
#88441

Bash

Show user certificates stored in Mozilla Firefox

1
2
3
certutil -K -d <PROFILE_DIRECTORY>
modutil -list -dbdir <PROFILE_DIRECTORY>
modutil -rawlist -dbdir <PROFILE_DIRECTORY>
https://snipt.net/embed/c736d144c2a86b43bf9e4695669ebd74/
https://snipt.net/raw/c736d144c2a86b43bf9e4695669ebd74/
c736d144c2a86b43bf9e4695669ebd74
bash
Bash
3
2014-04-16T08:20:28
True
False
Oct 18, 2013 at 03:09 AM
/api/public/snipt/88441/
show-user-certificates-stored-in-mozilla-firefox
<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 id="L-1"><a name="L-1"></a>certutil -K -d &lt;PROFILE_DIRECTORY&gt; </span><span id="L-2"><a name="L-2"></a>modutil -list -dbdir &lt;PROFILE_DIRECTORY&gt; </span><span id="L-3"><a name="L-3"></a>modutil -rawlist -dbdir &lt;PROFILE_DIRECTORY&gt; </span></pre></div> </td></tr></table>
bash, certificates, certutil, firefox, modutil, mozilla