snipt

Ctrl+h for KB shortcuts

Bash

SCP (secure copy) file from local machine to remote server over SSH

scp /local-file/folder/name.zip [email protected]:path-to-post-too/subfolder/
https://snipt.net/embed/caf9a9fd1a7a1e3fa7ff1616bd01af69/
/raw/caf9a9fd1a7a1e3fa7ff1616bd01af69/
caf9a9fd1a7a1e3fa7ff1616bd01af69
bash
Bash
1
2019-07-22T03:23:25
True
False
False
/api/public/snipt/42328/
scp-secure-copy-file-from-local-machine-to-remote-server-over-ssh
<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>scp /local-file/folder/name.zip [email protected]:path-to-post-too/subfolder/ </span></pre></div> </td></tr></table>
bash, scp, ssh

Bash

zip up a directory on linux

zip -r archive_name.zip directory_to_compress
https://snipt.net/embed/492a3ef716b400919af5177a3b08880b/
/raw/492a3ef716b400919af5177a3b08880b/
492a3ef716b400919af5177a3b08880b
bash
Bash
2
2019-07-22T09:41:39
True
False
False
/api/public/snipt/37663/
zip-up-a-directory-on-linux
<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>zip -r archive_name.zip directory_to_compress </span></pre></div> </td></tr></table>
bash, linux, terminal, zip

MySQL

mysql add new user

GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'localhost'
IDENTIFIED BY 'password' WITH GRANT OPTION;
https://snipt.net/embed/53f476428018303e2f9e0a20734d7542/
/raw/53f476428018303e2f9e0a20734d7542/
53f476428018303e2f9e0a20734d7542
mysql
MySQL
2
2019-07-23T12:59:10
True
False
False
/api/public/snipt/37443/
mysql-add-new-user
<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="k">GRANT</span> <span class="k">ALL</span> <span class="n">PRIVILEGES</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="s1">&#39;user_name&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span> </span><span id="L-2"><a name="L-2"></a><span class="n">IDENTIFIED</span> <span class="k">BY</span> <span class="s1">&#39;password&#39;</span> <span class="k">WITH</span> <span class="k">GRANT</span> <span class="k">OPTION</span><span class="p">;</span> </span></pre></div> </td></tr></table>
"new user", bash, mysql