Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

PostgreSQL SQL dialect

update with joins for a specific project id - remove all bad characters

1
2
3
4
UPDATE step_designs AS s 
SET description =  REPLACE(s.description,'_x000D_','')
FROM qtest_designs AS t
WHERE s.qtest_design_id = t.id AND t.project_id = 2416;
https://snipt.net/embed/8b85767795a1828e0e53125b5b8c7167/
https://snipt.net/raw/8b85767795a1828e0e53125b5b8c7167/
8b85767795a1828e0e53125b5b8c7167
postgresql
PostgreSQL SQL dialect
5
2016-12-10T05:24:42
True
False
False
Jul 13, 2016 at 04:11 PM
/api/public/snipt/147392/
update-with-joins-for-a-specific-project-id-remove-all-bad-characters
<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">UPDATE</span> <span class="n">step_designs</span> <span class="k">AS</span> <span class="n">s</span> </span><span id="L-2"><a name="L-2"></a><span class="k">SET</span> <span class="n">description</span> <span class="o">=</span> <span class="k">REPLACE</span><span class="p">(</span><span class="n">s</span><span class="mf">.</span><span class="n">description</span><span class="p">,</span><span class="s1">&#39;_x000D_&#39;</span><span class="p">,</span><span class="s1">&#39;&#39;</span><span class="p">)</span> </span><span id="L-3"><a name="L-3"></a><span class="k">FROM</span> <span class="n">qtest_designs</span> <span class="k">AS</span> <span class="n">t</span> </span><span id="L-4"><a name="L-4"></a><span class="k">WHERE</span> <span class="n">s</span><span class="mf">.</span><span class="n">qtest_design_id</span> <span class="o">=</span> <span class="n">t</span><span class="mf">.</span><span class="n">id</span> <span class="k">AND</span> <span class="n">t</span><span class="mf">.</span><span class="n">project_id</span> <span class="o">=</span> <span class="mf">2416</span><span class="p">;</span> </span></pre></div> </td></tr></table>
joins, update

Text only

Drupal: Failed to get available update data for X projects

Empty your cache_update table and try again
https://snipt.net/embed/abc9ee4b9318a3fdfe18f4f09dca309c/
https://snipt.net/raw/abc9ee4b9318a3fdfe18f4f09dca309c/
abc9ee4b9318a3fdfe18f4f09dca309c
text
Text only
1
2016-11-30T02:51:16
True
False
True
Jul 20, 2013 at 02:06 PM
/api/public/snipt/68793/
drupal-failed-to-get-available-update-data-for-x-projects
<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>Empty your cache_update table and try again </span></pre></div> </td></tr></table>
"drupal 7", update

Bash

svn update with no interaction and accept certificate from cli

svn up --username <user> --password <psw> --non-interactive --trust-server-cert
https://snipt.net/embed/8ee9a30e7f44092e596ab7820a8c1502/
https://snipt.net/raw/8ee9a30e7f44092e596ab7820a8c1502/
8ee9a30e7f44092e596ab7820a8c1502
bash
Bash
1
2016-12-10T07:41:45
True
False
False
Jul 19, 2013 at 09:24 AM
/api/public/snipt/68603/
svn-update-with-no-interaction-and-accept-certificate-from-cli
<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>svn up --username &lt;user&gt; --password &lt;psw&gt; --non-interactive --trust-server-cert </span></pre></div> </td></tr></table>
accept, certificate, cli, command, line, linux, shell, svn, up, update

SQL

mysql update with or die

$update = "UPDATE table SET name = '$muster', age = '$age', updated = now() where id = '$id' ";
mysql_query($update) or die(mysql_error());
https://snipt.net/embed/80d0f861c5c884adebdd6f6743985b29/
https://snipt.net/raw/80d0f861c5c884adebdd6f6743985b29/
80d0f861c5c884adebdd6f6743985b29
sql
SQL
2
2016-12-05T07:47:25
True
False
False
/api/public/snipt/37157/
mysql-update-with-or-die
<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><span class="err">$</span><span class="k">update</span> <span class="o">=</span> <span class="ss">&quot;UPDATE table SET name = &#39;$muster&#39;, age = &#39;$age&#39;, updated = now() where id = &#39;$id&#39; &quot;</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="n">mysql_query</span><span class="p">(</span><span class="err">$</span><span class="k">update</span><span class="p">)</span> <span class="k">or</span> <span class="n">die</span><span class="p">(</span><span class="n">mysql_error</span><span class="p">());</span> </span></pre></div> </td></tr></table>
mysql, php, update

Bash

System upgrade from Live (Minimal chroot) in Ubuntu/Debian

1
2
3
4
5
6
sudo -i
mkdir /tmp/chroot
mount -t ext3 /dev/sda1 /tmp/chroot/
mount -t proc proc-chroot /tmp/chroot/proc/
mount -t devpts devpts-chroot /tmp/chroot/dev/pts
chroot /tmp/chroot/
https://snipt.net/embed/90794cc1893154c979c539a1d4ec1f25/
https://snipt.net/raw/90794cc1893154c979c539a1d4ec1f25/
90794cc1893154c979c539a1d4ec1f25
bash
Bash
6
2016-12-05T07:48:13
True
False
False
May 22, 2013 at 02:07 PM
/api/public/snipt/37120/
montar-un-chrtoot-minimo-para-poder-actualizar-la-distro
<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></span><span id="L-1"><a name="L-1"></a>sudo -i </span><span id="L-2"><a name="L-2"></a>mkdir /tmp/chroot </span><span id="L-3"><a name="L-3"></a>mount -t ext3 /dev/sda1 /tmp/chroot/ </span><span id="L-4"><a name="L-4"></a>mount -t proc proc-chroot /tmp/chroot/proc/ </span><span id="L-5"><a name="L-5"></a>mount -t devpts devpts-chroot /tmp/chroot/dev/pts </span><span id="L-6"><a name="L-6"></a>chroot /tmp/chroot/ </span></pre></div> </td></tr></table>
Debian, Linux, Ubuntu, chroot, karmic, update
Copyrighted, illegal, or inappropriate content? Email [email protected].