Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

Itunes connect: App "Developer Removed from Sale"

You need to associate a Store to distribute your app in (Pricing tab)
https://snipt.net/embed/a34e1b08addea88a995e3b3363c42088/
https://snipt.net/raw/a34e1b08addea88a995e3b3363c42088/
a34e1b08addea88a995e3b3363c42088
text
Text only
1
2016-12-10T07:41:54
True
False
False
Nov 10, 2014 at 05:24 AM
/api/public/snipt/137014/
itunes-connect-app-developer-removed-from-sale-5442144a
<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>You need to associate a Store to distribute your app in (Pricing tab) </span></pre></div> </td></tr></table>
connect, itunes, status

Bash

Fix broken packages in Ubuntu and Debian

1
2
3
4
5
6
7
8
dpkg --configure -a
apt-get install -f

# If the problem of a broken package still exist, the solution is to edit the dpkg status file manually.

nano /var/lib/dpkg/status

# Locate the corrupt package, and remove the whole block of information about it and save the file.
https://snipt.net/embed/c909f1463882443c12d770afa20dd0d1/
https://snipt.net/raw/c909f1463882443c12d770afa20dd0d1/
c909f1463882443c12d770afa20dd0d1
bash
Bash
8
2016-12-10T02:02:58
True
False
False
Dec 04, 2013 at 02:34 AM
/api/public/snipt/98414/
fix-broken-packages-in-ubuntu-and-debian
<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>dpkg --configure -a </span><span id="L-2"><a name="L-2"></a>apt-get install -f </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># If the problem of a broken package still exist, the solution is to edit the dpkg status file manually.</span> </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a>nano /var/lib/dpkg/status </span><span id="L-7"><a name="L-7"></a> </span><span id="L-8"><a name="L-8"></a><span class="c1"># Locate the corrupt package, and remove the whole block of information about it and save the file.</span> </span></pre></div> </td></tr></table>
apt, broken, debian, dpkg, fix, packages, status, ubuntu

Bash

passenger status

passenger-status
passenger-memory-stats
https://snipt.net/embed/32f689bc9b35c5498a4828deb73cc57d/
https://snipt.net/raw/32f689bc9b35c5498a4828deb73cc57d/
32f689bc9b35c5498a4828deb73cc57d
bash
Bash
2
2016-12-10T06:15:21
True
False
False
/api/public/snipt/18563/
passenger-status
<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>passenger-status </span><span id="L-2"><a name="L-2"></a>passenger-memory-stats </span></pre></div> </td></tr></table>
passenger, status

MySQL

Calculate the difference between dates in on column within the same table

1
2
3
4
SELECT DATEDIFF(
 (SELECT DATE(date_field) FROM table WHERE id = '1' AND status_id = '2' ORDER BY date_field DESC LIMIT 1),
 (SELECT DATE(date_field) FROM table WHERE id = '1' AND status_id = '1' ORDER BY date_field DESC LIMIT 1)
	) AS difference
https://snipt.net/embed/92c1f8bbeb80a7a6033d40cae85dcd24/
https://snipt.net/raw/92c1f8bbeb80a7a6033d40cae85dcd24/
92c1f8bbeb80a7a6033d40cae85dcd24
mysql
MySQL
4
2016-12-07T15:10:35
True
False
False
/api/public/snipt/14227/
calculate-the-difference-between-dates-in-one-columns-within-the-same-table
<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></span><span id="L-1"><a name="L-1"></a><span class="k">SELECT</span> <span class="nf">DATEDIFF</span><span class="p">(</span> </span><span id="L-2"><a name="L-2"></a> <span class="p">(</span><span class="k">SELECT</span> <span class="kt">DATE</span><span class="p">(</span><span class="n">date_field</span><span class="p">)</span> <span class="k">FROM</span> <span class="k">table</span> <span class="k">WHERE</span> <span class="n">id</span> <span class="o">=</span> <span class="s1">&#39;1&#39;</span> <span class="k">AND</span> <span class="n">status_id</span> <span class="o">=</span> <span class="s1">&#39;2&#39;</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="n">date_field</span> <span class="k">DESC</span> <span class="k">LIMIT</span> <span class="mi">1</span><span class="p">),</span> </span><span id="L-3"><a name="L-3"></a> <span class="p">(</span><span class="k">SELECT</span> <span class="kt">DATE</span><span class="p">(</span><span class="n">date_field</span><span class="p">)</span> <span class="k">FROM</span> <span class="k">table</span> <span class="k">WHERE</span> <span class="n">id</span> <span class="o">=</span> <span class="s1">&#39;1&#39;</span> <span class="k">AND</span> <span class="n">status_id</span> <span class="o">=</span> <span class="s1">&#39;1&#39;</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="n">date_field</span> <span class="k">DESC</span> <span class="k">LIMIT</span> <span class="mi">1</span><span class="p">)</span> </span><span id="L-4"><a name="L-4"></a> <span class="p">)</span> <span class="k">AS</span> <span class="n">difference</span> </span></pre></div> </td></tr></table>
change, date, datediff, difference, mysql, status, subquery

Bash

Show Solaris CPU Status

psrinfo | awk {'print $1" "$2'}
https://snipt.net/embed/34a3c902b25f8bae038aae760009f3e5/
https://snipt.net/raw/34a3c902b25f8bae038aae760009f3e5/
34a3c902b25f8bae038aae760009f3e5
bash
Bash
1
2016-12-10T00:19:39
True
False
False
/api/public/snipt/1148/
show-solaris-cpu-status
<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>psrinfo <span class="p">|</span> awk <span class="o">{</span><span class="s1">&#39;print $1&quot; &quot;$2&#39;</span><span class="o">}</span> </span></pre></div> </td></tr></table>
awk, cpu, opensolaris, solaris, status
Copyrighted, illegal, or inappropriate content? Email [email protected].