snipt

Ctrl+h for KB shortcuts

Bash

Install homebrew cli

# install homebrew using ruby.
ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"
https://snipt.net/embed/0affb0543ae7c8e70c2510749afe289c/
https://snipt.net/raw/0affb0543ae7c8e70c2510749afe289c/
0affb0543ae7c8e70c2510749afe289c
bash
Bash
2
2016-09-30T03:55:08
True
False
False
/api/public/snipt/23522/
install-homebrew-cli
<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="c"># install homebrew using ruby.</span> </span><span id="L-2"><a name="L-2"></a>ruby -e <span class="s2">&quot;</span><span class="k">$(</span>curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb<span class="k">)</span><span class="s2">&quot;</span> </span></pre></div> </td></tr></table>
"mac os x", bash, ruby

Bash

Mac OS X Recursive file unlock

chflags -R nouchg *
https://snipt.net/embed/0366743c11deeffc3a8822eedfd5f8e0/
https://snipt.net/raw/0366743c11deeffc3a8822eedfd5f8e0/
0366743c11deeffc3a8822eedfd5f8e0
bash
Bash
1
2016-09-30T03:55:24
True
False
False
/api/public/snipt/20832/
mac-os-x-recursive-file-unlock
<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>chflags -R nouchg * </span></pre></div> </td></tr></table>
"mac os x", bash

Bash

Concatenate multiple PDFs

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf \
source1.pdf source2.pdf source3.pdf etc.pdf
https://snipt.net/embed/2967ab4fc3e6d3b8ebf9e4aecfa79228/
https://snipt.net/raw/2967ab4fc3e6d3b8ebf9e4aecfa79228/
2967ab4fc3e6d3b8ebf9e4aecfa79228
bash
Bash
2
2016-09-29T09:15:39
True
False
False
/api/public/snipt/19139/
concatenate-multiple-pdfs
<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>gs -q -dNOPAUSE -dBATCH -sDEVICE<span class="o">=</span>pdfwrite -sOutputFile<span class="o">=</span>merged.pdf <span class="se">\</span> </span><span id="L-2"><a name="L-2"></a>source1.pdf source2.pdf source3.pdf etc.pdf </span></pre></div> </td></tr></table>
"mac os x", concat, gs, pdf

Bash

prevent dot underscore mac os x tar

1
2
3
4
5
# prevent tar from creating those blasted 
# dot-underscore (aka ._) alias 'Apple Double'  files.
# put this in your .bashrc file.

export COPYFILE_DISABLE=true
https://snipt.net/embed/6aa8b2eb18ddb00972025bb482a72d72/
https://snipt.net/raw/6aa8b2eb18ddb00972025bb482a72d72/
6aa8b2eb18ddb00972025bb482a72d72
bash
Bash
5
2016-09-24T20:42:47
True
False
False
/api/public/snipt/13663/
prevent-dot-underscore-mac-os-x-tar
<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 id="L-1"><a name="L-1"></a><span class="c"># prevent tar from creating those blasted </span> </span><span id="L-2"><a name="L-2"></a><span class="c"># dot-underscore (aka ._) alias &#39;Apple Double&#39; files.</span> </span><span id="L-3"><a name="L-3"></a><span class="c"># put this in your .bashrc file.</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="nb">export </span><span class="nv">COPYFILE_DISABLE</span><span class="o">=</span><span class="nb">true</span> </span></pre></div> </td></tr></table>
"mac os x", development, tar

XML

Hide Dock Icon in a plist

<key>NSUIElement</key>
<string>1</string>
https://snipt.net/embed/a7bb947b2cf2d7d32a5006d3140e05d7/
https://snipt.net/raw/a7bb947b2cf2d7d32a5006d3140e05d7/
a7bb947b2cf2d7d32a5006d3140e05d7
xml
XML
2
2016-09-25T08:45:37
True
False
False
/api/public/snipt/13306/
hide-dock-icon-in-a-plist
<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="nt">&lt;key&gt;</span>NSUIElement<span class="nt">&lt;/key&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">&lt;string&gt;</span>1<span class="nt">&lt;/string&gt;</span> </span></pre></div> </td></tr></table>
"dock icon", "mac os x", mac, plist

Bash

403 Forbidden error apache mac os x

1
2
3
4
5
6
#  To avoid the 403 Forbidden error when browsing sites in your ~/Sites folder
#  add the apache user "_www" to the staff group... 
#  Note: sometimes staff may be admin if you're upgrading from earlier OS X
#
#  Solution for OS X Leopard's dscl tool (Directory Service Command Line)
sudo dscl . -append /Groups/staff GroupMembership "_www"
https://snipt.net/embed/ac7aa37befea77f5f4db863a3c18ec3c/
https://snipt.net/raw/ac7aa37befea77f5f4db863a3c18ec3c/
ac7aa37befea77f5f4db863a3c18ec3c
bash
Bash
6
2016-09-30T07:00:15
True
False
False
/api/public/snipt/3554/
403-forbidden-error-apache-mac-os-x
<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></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c"># To avoid the 403 Forbidden error when browsing sites in your ~/Sites folder</span> </span><span id="L-2"><a name="L-2"></a><span class="c"># add the apache user &quot;_www&quot; to the staff group... </span> </span><span id="L-3"><a name="L-3"></a><span class="c"># Note: sometimes staff may be admin if you&#39;re upgrading from earlier OS X</span> </span><span id="L-4"><a name="L-4"></a><span class="c">#</span> </span><span id="L-5"><a name="L-5"></a><span class="c"># Solution for OS X Leopard&#39;s dscl tool (Directory Service Command Line)</span> </span><span id="L-6"><a name="L-6"></a>sudo dscl . -append /Groups/staff GroupMembership <span class="s2">&quot;_www&quot;</span> </span></pre></div> </td></tr></table>
"directory service", "mac os x", "user administration", bash, www
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.