snipt

Ctrl+h for KB shortcuts

Batchfile

Bootable USB drive

1
2
3
4
5
6
syslinux -m -a Z:
mkdir Z:\boot\syslinux
cp mboot.c32 Z:\boot\syslinux\mboot.c32
cd libcom32.c32 Z:\boot\syslinux\libcom32.c32
echo "DEFAULT mboot.c32 /kernel" > Z:\boot\syslinux\syslinux.cfg
cp kernel Z:\kernel
https://snipt.net/embed/2a71f7027ec1759ba089631ff8757859/
/raw/2a71f7027ec1759ba089631ff8757859/
2a71f7027ec1759ba089631ff8757859
bat
Batchfile
6
2019-06-10T18:26:07
True
False
False
/api/public/snipt/97527/
bootable-usb-drive
<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>syslinux -m -a Z: </span><span id="L-2"><a name="L-2"></a><span class="k">mkdir</span> Z:\boot\syslinux </span><span id="L-3"><a name="L-3"></a>cp mboot.c32 Z:\boot\syslinux\mboot.c32 </span><span id="L-4"><a name="L-4"></a><span class="k">cd</span> libcom32.c32 Z:\boot\syslinux\libcom32.c32 </span><span id="L-5"><a name="L-5"></a><span class="k">echo</span> <span class="s2">&quot;DEFAULT mboot.c32 /kernel&quot;</span> <span class="p">&gt;</span> Z:\boot\syslinux\syslinux.cfg </span><span id="L-6"><a name="L-6"></a>cp kernel Z:\kernel </span></pre></div> </td></tr></table>
bootable, syslinux, usb

Bash

Add temp swap

1
2
3
4
SWAP=/tmp/swap
dd if=/dev/zero of=$SWAP bs=1M count=500
mkswap $SWAP
swapon $SWAP
https://snipt.net/embed/4429675f13af24fe0392a6cd87b1c6c0/
/raw/4429675f13af24fe0392a6cd87b1c6c0/
4429675f13af24fe0392a6cd87b1c6c0
bash
Bash
4
2019-06-09T06:29:32
True
False
False
/api/public/snipt/94767/
add-temp-swap
<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="nv">SWAP</span><span class="o">=</span>/tmp/swap </span><span id="L-2"><a name="L-2"></a>dd <span class="k">if</span><span class="o">=</span>/dev/zero <span class="nv">of</span><span class="o">=</span><span class="nv">$SWAP</span> <span class="nv">bs</span><span class="o">=</span>1M <span class="nv">count</span><span class="o">=</span>500 </span><span id="L-3"><a name="L-3"></a>mkswap <span class="nv">$SWAP</span> </span><span id="L-4"><a name="L-4"></a>swapon <span class="nv">$SWAP</span> </span></pre></div> </td></tr></table>
swap

MySQL

Reset MySQL ID column

1
2
3
SET @num := 0;
UPDATE your_table SET id = @num := (@num+1);
ALTER TABLE your_table AUTO_INCREMENT =1;
https://snipt.net/embed/862a58916d302effd33b22f6e5ed4da4/
/raw/862a58916d302effd33b22f6e5ed4da4/
862a58916d302effd33b22f6e5ed4da4
mysql
MySQL
3
2019-06-10T16:43:38
True
False
False
/api/public/snipt/34418/
reset-mysql-id-column
<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="kt">SET</span> <span class="o">@</span><span class="n">num</span> <span class="p">:</span><span class="o">=</span> <span class="mi">0</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="k">UPDATE</span> <span class="n">your_table</span> <span class="kt">SET</span> <span class="n">id</span> <span class="o">=</span> <span class="o">@</span><span class="n">num</span> <span class="p">:</span><span class="o">=</span> <span class="p">(</span><span class="o">@</span><span class="n">num</span><span class="o">+</span><span class="mi">1</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">your_table</span> <span class="kp">AUTO_INCREMENT</span> <span class="o">=</span><span class="mi">1</span><span class="p">;</span> </span></pre></div> </td></tr></table>
mysql

Bash

./configure for 64bit

--libdir=/usr/lib64 --with-libdir=lib64
https://snipt.net/embed/778a8c9ce239d5990fd65afab3d1c954/
/raw/778a8c9ce239d5990fd65afab3d1c954/
778a8c9ce239d5990fd65afab3d1c954
bash
Bash
1
2019-06-17T12:30:29
True
False
False
/api/public/snipt/8382/
configure-for-64bit
<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>--libdir<span class="o">=</span>/usr/lib64 --with-libdir<span class="o">=</span>lib64 </span></pre></div> </td></tr></table>
64bit, compile

Bash

Rebuild Plesk Statistics

/usr/local/psa/admin/sbin/statistics –calculate-all
https://snipt.net/embed/38dcde4ed257e4970d8d528f8695d0cd/
/raw/38dcde4ed257e4970d8d528f8695d0cd/
38dcde4ed257e4970d8d528f8695d0cd
bash
Bash
1
2019-06-13T11:35:23
True
False
False
/api/public/snipt/4489/
rebuild-plesk-statistics
<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>/usr/local/psa/admin/sbin/statistics –calculate-all </span></pre></div> </td></tr></table>
bash, plesk

Bash

Read Plesk user password

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e "use psa; select accounts.password from accounts INNER JOIN sys_users ON   accounts.id=sys_users.account_id WHERE sys_users.login='xxxx';"
https://snipt.net/embed/4c97733c3669f4a76f9f6646397deec0/
/raw/4c97733c3669f4a76f9f6646397deec0/
4c97733c3669f4a76f9f6646397deec0
bash
Bash
1
2019-06-19T05:08:16
True
False
False
/api/public/snipt/4484/
read-plesk-user-password
<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>mysql -uadmin -p<span class="sb">`</span>cat /etc/psa/.psa.shadow<span class="sb">`</span> -e <span class="s2">&quot;use psa; select accounts.password from accounts INNER JOIN sys_users ON accounts.id=sys_users.account_id WHERE sys_users.login=&#39;xxxx&#39;;&quot;</span> </span></pre></div> </td></tr></table>
bash, password, plesk

Bash

Fix "configure --with-apxs"

mount -o remount,exec /var/tmp
https://snipt.net/embed/61f9aeef36d0787b732b03eca755242e/
/raw/61f9aeef36d0787b732b03eca755242e/
61f9aeef36d0787b732b03eca755242e
bash
Bash
1
2019-06-19T13:31:53
True
False
False
/api/public/snipt/4481/
fix-configure-with-apxs
<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>mount -o remount,exec /var/tmp </span></pre></div> </td></tr></table>
apc, bash, php

Bash

Pass The Date To A GCC #define

-D COMPILE_DATE=\""`date "+%Y-%m-%d %H:%M"`\""
https://snipt.net/embed/3aa05372f92de961c1c9baafb712c55a/
/raw/3aa05372f92de961c1c9baafb712c55a/
3aa05372f92de961c1c9baafb712c55a
bash
Bash
1
2019-06-04T10:18:57
True
False
False
/api/public/snipt/3470/
pass-the-date-to-a-gcc-define
<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>-D <span class="nv">COMPILE_DATE</span><span class="o">=</span><span class="se">\&quot;</span><span class="s2">&quot;`date &quot;</span>+%Y-%m-%d %H:%M<span class="s2">&quot;`\&quot;&quot;</span> </span></pre></div> </td></tr></table>
gcc