snipt

Ctrl+h for KB shortcuts

Bash

print the 100th line from the file

sed -n 100p somefile.txt
https://snippets.siftie.com/embed/b605c0b9565e0a3571da14682b218fd7/
/raw/b605c0b9565e0a3571da14682b218fd7/
b605c0b9565e0a3571da14682b218fd7
bash
Bash
1
2019-03-09T15:04:24
True
False
False
/api/public/snipt/1592/
print-the-100th-line-from-the-file
<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>sed -n 100p somefile.txt </span></pre></div> </td></tr></table>
bash, sed, text

MySQL

create rw mysql user

GRANT SELECT,INDEX,ALTER,LOCK TABLES,INSERT,UPDATE,DELETE,CREATE,DROP on database.* to 'user_rw'@'localhost' identified by 'xxxxx';
https://snippets.siftie.com/embed/73135d7138ef0f34aa83bd2c1f864df6/
/raw/73135d7138ef0f34aa83bd2c1f864df6/
73135d7138ef0f34aa83bd2c1f864df6
mysql
MySQL
1
2019-03-08T11:02:52
True
False
False
/api/public/snipt/1398/
create-rw-mysql-user
<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><span class="k">GRANT</span> <span class="k">SELECT</span><span class="p">,</span><span class="k">INDEX</span><span class="p">,</span><span class="k">ALTER</span><span class="p">,</span><span class="k">LOCK</span> <span class="kp">TABLES</span><span class="p">,</span><span class="k">INSERT</span><span class="p">,</span><span class="k">UPDATE</span><span class="p">,</span><span class="k">DELETE</span><span class="p">,</span><span class="k">CREATE</span><span class="p">,</span><span class="k">DROP</span> <span class="k">on</span> <span class="k">database</span><span class="p">.</span><span class="o">*</span> <span class="k">to</span> <span class="s1">&#39;user_rw&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span> <span class="n">identified</span> <span class="k">by</span> <span class="s1">&#39;xxxxx&#39;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
mysql

MySQL

create mysql replication user for both master and slave

GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO repl@'localhost' IDENTIFIED BY 'p4ss';
https://snippets.siftie.com/embed/d181cb63f424bb366a902b86674735e1/
/raw/d181cb63f424bb366a902b86674735e1/
d181cb63f424bb366a902b86674735e1
mysql
MySQL
1
2016-12-31T11:31:16
True
False
False
/api/public/snipt/1364/
create-mysql-replication-user-for-both-master-and-slave
<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><span class="k">GRANT</span> <span class="n">REPLICATION</span> <span class="n">SLAVE</span><span class="p">,</span> <span class="n">REPLICATION</span> <span class="n">CLIENT</span> <span class="k">ON</span> <span class="o">*</span><span class="p">.</span><span class="o">*</span> <span class="k">TO</span> <span class="n">repl</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span> <span class="n">IDENTIFIED</span> <span class="k">BY</span> <span class="s1">&#39;p4ss&#39;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
mysql, replication

Bash

schedule weekly backup

mysql-zrm-scheduler --add --interval weekly --backup-set weeklyrun --start 3:00 --backup-level 0
https://snippets.siftie.com/embed/30b1de243dccb1ef943b5450013118e6/
/raw/30b1de243dccb1ef943b5450013118e6/
30b1de243dccb1ef943b5450013118e6
bash
Bash
1
2019-03-08T15:35:27
True
False
False
/api/public/snipt/1346/
schedule-weekly-backup
<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-zrm-scheduler --add --interval weekly --backup-set weeklyrun --start 3:00 --backup-level 0 </span></pre></div> </td></tr></table>
mysql, mysql-zrm

Bash

schedule daily backup

mysql-zrm-scheduler --add --interval daily --backup-set dailyrun --start 1:00 --backup-level 0
https://snippets.siftie.com/embed/ab489175b79961ca422227c55d8a51f7/
/raw/ab489175b79961ca422227c55d8a51f7/
ab489175b79961ca422227c55d8a51f7
bash
Bash
1
2019-03-17T23:32:02
True
False
False
/api/public/snipt/1345/
schedule-daily-backup
<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-zrm-scheduler --add --interval daily --backup-set dailyrun --start 1:00 --backup-level 0 </span></pre></div> </td></tr></table>
mysql, mysql-zrm

Bash

run daily mysql-zrm backup now

mysql-zrm-scheduler --now --backup-set dailyrun --backup-level 0
https://snippets.siftie.com/embed/0135cd882c98cb78632d7c8117ca740d/
/raw/0135cd882c98cb78632d7c8117ca740d/
0135cd882c98cb78632d7c8117ca740d
bash
Bash
1
2019-03-17T23:38:20
True
False
False
/api/public/snipt/1344/
run-daily-mysql-zrm-backup-now
<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-zrm-scheduler --now --backup-set dailyrun --backup-level 0 </span></pre></div> </td></tr></table>
mysql, mysql-zrm

Bash

query msyql backups

mysql-zrm-reporter --where backup-set=dailyrun --show backup-status-info
https://snippets.siftie.com/embed/4cd2e2f0a31cab3dfc994928fdfdefb3/
/raw/4cd2e2f0a31cab3dfc994928fdfdefb3/
4cd2e2f0a31cab3dfc994928fdfdefb3
bash
Bash
1
2019-03-09T06:48:55
True
False
False
/api/public/snipt/1343/
query-msyql-backups
<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-zrm-reporter --where backup-set<span class="o">=</span>dailyrun --show backup-status-info </span></pre></div> </td></tr></table>
mysql, mysql-zrm

Bash

query mysql scheduled backups

mysql-zrm-scheduler --query
https://snippets.siftie.com/embed/1bba78ec0735ea7d51468584c0e9528c/
/raw/1bba78ec0735ea7d51468584c0e9528c/
1bba78ec0735ea7d51468584c0e9528c
bash
Bash
1
2019-03-16T05:18:41
True
False
False
/api/public/snipt/1342/
query-mysql-backups
<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-zrm-scheduler --query </span></pre></div> </td></tr></table>
mysql, mysql-zrm

Bash

ignore all of the pyc files

svn propset svn:ignore '*.pyc' library/python
https://snippets.siftie.com/embed/37d6e79c2558f375dc5d65d4e1a11c8f/
/raw/37d6e79c2558f375dc5d65d4e1a11c8f/
37d6e79c2558f375dc5d65d4e1a11c8f
bash
Bash
1
2019-03-08T22:57:16
True
False
False
/api/public/snipt/1016/
ignore-all-of-the-pyc-files
<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 propset svn:ignore <span class="s1">&#39;*.pyc&#39;</span> library/python </span></pre></div> </td></tr></table>
python, svn

Bash

ignore everything in the ext directory

svn propset svn:ignore '*' ext
https://snippets.siftie.com/embed/2cbb707d72517bdb8f6aef16934fddb8/
/raw/2cbb707d72517bdb8f6aef16934fddb8/
2cbb707d72517bdb8f6aef16934fddb8
bash
Bash
1
2019-03-03T23:22:41
True
False
False
/api/public/snipt/1015/
ignore-everything-in-the-ext-directory
<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 propset svn:ignore <span class="s1">&#39;*&#39;</span> ext </span></pre></div> </td></tr></table>
svn