Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Bash

install elasticsearch-head plugin on osx

1
2
3
cd /usr/local/Cellar/elasticsearch/2.1.0_1/
bin/plugin install mobz/elasticsearch-head
open http://localhost:9200/_plugin/head
https://snipt.net/embed/8c31a72041f2f8ce8f50b4b2b72dd48a/
https://snipt.net/raw/8c31a72041f2f8ce8f50b4b2b72dd48a/
8c31a72041f2f8ce8f50b4b2b72dd48a
bash
Bash
4
2016-12-10T06:55:21
True
False
False
Dec 17, 2015 at 12:44 PM
/api/public/snipt/143145/
install-elasticsearch-head-plugin-on-osx
<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="nb">cd</span> /usr/local/Cellar/elasticsearch/2.1.0_1/ </span><span id="L-2"><a name="L-2"></a>bin/plugin install mobz/elasticsearch-head </span><span id="L-3"><a name="L-3"></a>open http://localhost:9200/_plugin/head </span></pre></div> </td></tr></table>
elasticsearch, osx, plugins

Bash

Mac OSX Environment Variable For GUI apps

1
2
3
# To set ENV variables for GUI apps, use `launchctl setenv`
export YOUR_VAR="Hello World!"
launchctl setenv YOUR_VAR $YOUR_VAR
https://snipt.net/embed/473e39fae887f52ae1ac675720b86b8f/
https://snipt.net/raw/473e39fae887f52ae1ac675720b86b8f/
473e39fae887f52ae1ac675720b86b8f
bash
Bash
4
2016-12-10T07:41:07
True
False
False
May 24, 2015 at 07:25 AM
/api/public/snipt/139576/
mac-osx-environment-variable-for-gui-apps-7347322b
<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"># To set ENV variables for GUI apps, use `launchctl setenv`</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">export</span> <span class="nv">YOUR_VAR</span><span class="o">=</span><span class="s2">&quot;Hello World!&quot;</span> </span><span id="L-3"><a name="L-3"></a>launchctl setenv YOUR_VAR <span class="nv">$YOUR_VAR</span> </span></pre></div> </td></tr></table>
env, osx, shell

Bash

osx remove extended attributes on a file

xattr -c yourfile.txt
https://snipt.net/embed/bf602e8457537a6f64c7feeb807a34bd/
https://snipt.net/raw/bf602e8457537a6f64c7feeb807a34bd/
bf602e8457537a6f64c7feeb807a34bd
bash
Bash
1
2016-12-04T05:26:47
True
False
False
/api/public/snipt/136975/
osx-remove-extended-attributes-on-a-file-d38d4901
<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>xattr -c yourfile.txt </span></pre></div> </td></tr></table>
attr, attributes, osx, xattr

Bash

sublime settings synced with dropbox

1
2
3
$ mv ~/Library/Application\ Support/Sublime\ Text\ 3 /path/to/cloud
$ ln -s /path/to/cloud/Sublime\ Text\ 3 ~/Library/Application\ Support/Sublime\ Text\ 3
reply
https://snipt.net/embed/1b33f3e9b0ec4e7649d3c34f5444fb7f/
https://snipt.net/raw/1b33f3e9b0ec4e7649d3c34f5444fb7f/
1b33f3e9b0ec4e7649d3c34f5444fb7f
bash
Bash
5
2016-12-10T01:35:12
True
False
False
Feb 14, 2014 at 11:02 PM
/api/public/snipt/113887/
sublime-settings-synced-with-dropbox
<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>$ mv ~/Library/Application<span class="se">\ </span>Support/Sublime<span class="se">\ </span>Text<span class="se">\ </span><span class="m">3</span> /path/to/cloud </span><span id="L-2"><a name="L-2"></a>$ ln -s /path/to/cloud/Sublime<span class="se">\ </span>Text<span class="se">\ </span><span class="m">3</span> ~/Library/Application<span class="se">\ </span>Support/Sublime<span class="se">\ </span>Text<span class="se">\ </span>3 </span><span id="L-3"><a name="L-3"></a>reply </span></pre></div> </td></tr></table>
bash, dropbox, editor, osx, sublime

Text only

ADB screenshot to file with date (osx)

adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > "screen_$(date +%Y_%m_%d_%H_%M_%S).png"
https://snipt.net/embed/46a7fb26235d631272c4a4f9932be56a/
https://snipt.net/raw/46a7fb26235d631272c4a4f9932be56a/
46a7fb26235d631272c4a4f9932be56a
text
Text only
1
2016-12-04T07:43:59
True
False
False
Dec 13, 2013 at 03:43 AM
/api/public/snipt/100267/
adb-screenshot-to-file-with-date-osx
<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>adb shell screencap -p | perl -pe &#39;s/\x0D\x0A/\x0A/g&#39; &gt; &quot;screen_$(date +%Y_%m_%d_%H_%M_%S).png&quot; </span></pre></div> </td></tr></table>
adb, android, osx, screenshot

Markdown

Command check version mack os

check version and detail os

system_profiler SPSoftwareDataType

check version only

sw_vers -productVersion

https://snipt.net/embed/5e3210d06d55408f3ef81bfc50e64f38/
https://snipt.net/raw/5e3210d06d55408f3ef81bfc50e64f38/
5e3210d06d55408f3ef81bfc50e64f38
markdown
Markdown
8
2016-12-07T15:56:24
True
False
True
Dec 04, 2013 at 04:20 AM
/api/public/snipt/98426/
command-check-version-mack-os
<p>check version and detail os</p> <p><code>system_profiler SPSoftwareDataType</code></p> <p>check version only </p> <p><code>sw_vers -productVersion</code></p>
check, command, osx, version

Bash

osx > enable key repeat

$ defaults write -g ApplePressAndHoldEnabled -bool false
https://snipt.net/embed/b274d20d2183f2ac3e5a6da72975a17a/
https://snipt.net/raw/b274d20d2183f2ac3e5a6da72975a17a/
b274d20d2183f2ac3e5a6da72975a17a
bash
Bash
1
2016-12-10T07:46:56
True
False
False
Oct 04, 2013 at 03:56 PM
/api/public/snipt/85661/
osx-enable-key-repeat
<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>$ defaults write -g ApplePressAndHoldEnabled -bool <span class="nb">false</span> </span></pre></div> </td></tr></table>
keyboard, osx

Bash

osx > redis

1
2
3
4
5
6
7
8
# To have launchd start redis at login:
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

# Then to load redis now:
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

# Or, if you don't want/need launchctl, you can just run:
$ redis-server /usr/local/etc/redis.conf
https://snipt.net/embed/a8a2f3df3c69d2d054ba66082a5f1b8c/
https://snipt.net/raw/a8a2f3df3c69d2d054ba66082a5f1b8c/
a8a2f3df3c69d2d054ba66082a5f1b8c
bash
Bash
8
2016-12-04T06:25:40
True
False
False
Sep 03, 2013 at 07:31 PM
/api/public/snipt/78772/
osx-redis
<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> <a href="#L-8">8</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"># To have launchd start redis at login:</span> </span><span id="L-2"><a name="L-2"></a>$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># Then to load redis now:</span> </span><span id="L-5"><a name="L-5"></a>$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="c1"># Or, if you don&#39;t want/need launchctl, you can just run:</span> </span><span id="L-8"><a name="L-8"></a>$ redis-server /usr/local/etc/redis.conf </span></pre></div> </td></tr></table>
homebrew, osx, redis

Bash

osx > flush dns cache

$ dscacheutil -flushcache
https://snipt.net/embed/8139c2018d1c4f8176780099894617cf/
https://snipt.net/raw/8139c2018d1c4f8176780099894617cf/
8139c2018d1c4f8176780099894617cf
bash
Bash
1
2016-12-10T06:13:02
True
False
False
Aug 04, 2013 at 02:13 PM
/api/public/snipt/71809/
osx-flush-dns-cache
<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>$ dscacheutil -flushcache </span></pre></div> </td></tr></table>
cache, dns, osx
Copyrighted, illegal, or inappropriate content? Email [email protected].