snipt

Ctrl+h for KB shortcuts

Bash

Export PostgreSQL schema only (no data) and discard ownership

pg_dump --schema-only --no-owner -h {host} -U {user} -f {filename.sql} {database-name}
https://snippets.siftie.com/embed/e552972d1b42c3d6f5e1a796a7d3355c/
/raw/e552972d1b42c3d6f5e1a796a7d3355c/
e552972d1b42c3d6f5e1a796a7d3355c
bash
Bash
2
2019-04-15T14:57:04
True
False
False
Sep 01, 2016 at 04:22 PM
/api/public/snipt/147682/
export-postgresql-schema-only-no-data-and-discard-ownership
<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>pg_dump --schema-only --no-owner -h <span class="o">{</span>host<span class="o">}</span> -U <span class="o">{</span>user<span class="o">}</span> -f <span class="o">{</span>filename.sql<span class="o">}</span> <span class="o">{</span>database-name<span class="o">}</span> </span></pre></div> </td></tr></table>
backup, postgresql

Bash

iOS entitlements checking

codesign -d --entitlements :- "Payload/YourApp.app"
https://snippets.siftie.com/embed/600ba52a12a81a5e565de16cba3371a8/
/raw/600ba52a12a81a5e565de16cba3371a8/
600ba52a12a81a5e565de16cba3371a8
bash
Bash
1
2019-04-12T12:00:13
True
False
False
May 19, 2015 at 05:39 PM
/api/public/snipt/139522/
ios-entitlements-checking-273cafa5
<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>codesign -d --entitlements :- <span class="s2">&quot;Payload/YourApp.app&quot;</span> </span></pre></div> </td></tr></table>
ios

Bash

Use Imagemagick to convert EPS to PNG

1
2
3
for f in `ls *.eps`; do
    convert -density 100 $f -flatten ${f%.*}.png;
done
https://snippets.siftie.com/embed/fc9757923e8ee51be0343f4cff04a292/
/raw/fc9757923e8ee51be0343f4cff04a292/
fc9757923e8ee51be0343f4cff04a292
bash
Bash
3
2019-04-19T12:46:08
True
False
False
Jul 07, 2014 at 11:47 AM
/api/public/snipt/135711/
use-imagemagick-to-convert-eps-to-png-87cbddba
<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="k">for</span> f in <span class="sb">`</span>ls *.eps<span class="sb">`</span><span class="p">;</span> <span class="k">do</span> </span><span id="L-2"><a name="L-2"></a> convert -density <span class="m">100</span> <span class="nv">$f</span> -flatten <span class="si">${</span><span class="nv">f</span><span class="p">%.*</span><span class="si">}</span>.png<span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="k">done</span> </span></pre></div> </td></tr></table>
eps, imagemagick, png

Bash

show short hash of current git head commit

git log --pretty=format:'%h' -n 1
https://snippets.siftie.com/embed/acbe195ff011d55cb5d38849171fca2d/
/raw/acbe195ff011d55cb5d38849171fca2d/
acbe195ff011d55cb5d38849171fca2d
bash
Bash
1
2019-04-17T08:45:32
True
False
False
May 29, 2014 at 02:55 PM
/api/public/snipt/135195/
show-short-hash-of-current-git-head-commit-c244cd54
<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>git log --pretty<span class="o">=</span>format:<span class="s1">&#39;%h&#39;</span> -n 1 </span></pre></div> </td></tr></table>
git, hash, sha