Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Bash

get entire folder via sftp

get -r *
https://snipt.net/embed/4181bf84de720b413ee400959a1322d2/
https://snipt.net/raw/4181bf84de720b413ee400959a1322d2/
4181bf84de720b413ee400959a1322d2
bash
Bash
1
2016-12-04T05:54:29
True
False
False
/api/public/snipt/136854/
get-entire-folder-via-sftp-ecec2af5
<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>get -r * </span></pre></div> </td></tr></table>
copy, ftp, linux, sftp

Bash

SCP file from local to remote server over ssh using pem key

scp -i /path/to/key.pem /path/to/file.jpg <username>@<server ip address>:/path/to/place/file
https://snipt.net/embed/e1839c5e3d32b62b6ee527d714e4b2f8/
https://snipt.net/raw/e1839c5e3d32b62b6ee527d714e4b2f8/
e1839c5e3d32b62b6ee527d714e4b2f8
bash
Bash
1
2016-12-05T09:30:26
True
False
False
/api/public/snipt/87287/
scp-file-from-local-to-remote-server-over-ssh-using-pem-key
<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 -i /path/to/key.pem /path/to/file.jpg &lt;username&gt;@&lt;server ip address&gt;:/path/to/place/file </span></pre></div> </td></tr></table>
copy, file, local, remote, scp, server, ssh, to

Bash

copy contents of file into clipboard

1
2
3
4
5
6
UBUNTU:
$ xclip -selection clip < filename.txt
$ xclip -sel c < filename.txt

OSX:
$ cat file.txt | pbcopy
https://snipt.net/embed/4f8fcc1c8631e804a08853aedbe6514e/
https://snipt.net/raw/4f8fcc1c8631e804a08853aedbe6514e/
4f8fcc1c8631e804a08853aedbe6514e
bash
Bash
7
2016-12-04T05:55:17
True
False
False
Apr 11, 2013 at 12:50 AM
/api/public/snipt/56409/
copy-contents-of-file-into-clipboard
<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>UBUNTU: </span><span id="L-2"><a name="L-2"></a>$ xclip -selection clip &lt; filename.txt </span><span id="L-3"><a name="L-3"></a>$ xclip -sel c &lt; filename.txt </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>OSX: </span><span id="L-6"><a name="L-6"></a>$ cat file.txt <span class="p">|</span> pbcopy </span></pre></div> </td></tr></table>
bash, copy, linux, paste, ubuntu

MySQL

Copy table from 1 database to another.

DROP TABLE IF EXISTS `db1`.`tbl`;
CREATE TABLE `db2`.`tbl` SELECT * FROM `db1`.`tbl`;
https://snipt.net/embed/fc281313adf8a9c1ab00acccf85c93e5/
https://snipt.net/raw/fc281313adf8a9c1ab00acccf85c93e5/
fc281313adf8a9c1ab00acccf85c93e5
mysql
MySQL
2
2016-12-03T10:00:05
True
False
False
/api/public/snipt/36543/
copy-table-from-1-database-to-another
<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">DROP</span> <span class="k">TABLE</span> <span class="k">IF</span> <span class="k">EXISTS</span> <span class="ss">`db1`</span><span class="p">.</span><span class="ss">`tbl`</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="ss">`db2`</span><span class="p">.</span><span class="ss">`tbl`</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="ss">`db1`</span><span class="p">.</span><span class="ss">`tbl`</span><span class="p">;</span> </span></pre></div> </td></tr></table>
copy, mysql, sync, table

Bash

Add SSH Public Key to a server.

ssh-copy-id [email protected]
https://snipt.net/embed/6e9566c195f35e05e9c309a8a292d46c/
https://snipt.net/raw/6e9566c195f35e05e9c309a8a292d46c/
6e9566c195f35e05e9c309a8a292d46c
bash
Bash
1
2016-12-04T09:43:06
True
False
False
/api/public/snipt/28643/
add-ssh-public-key-to-a-server
<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>ssh-copy-id [email protected] </span></pre></div> </td></tr></table>
"public key", bash, copy, security, ssh
Copyrighted, illegal, or inappropriate content? Email [email protected].