snipt

Ctrl+h for KB shortcuts

Bash

scp file off remote server

scp [email protected]:path/to/file localfile
https://snipt.net/embed/14e391f04b3aeee262e6007638e1aacd/
/raw/14e391f04b3aeee262e6007638e1aacd/
14e391f04b3aeee262e6007638e1aacd
bash
Bash
1
2019-07-09T21:23:56
True
False
False
/api/public/snipt/26779/
scp-file-off-remote-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>scp [email protected]:path/to/file localfile </span></pre></div> </td></tr></table>
scp

C

compile in C (simple)

gcc -o hello helloworld.c
https://snipt.net/embed/e6cf0fab19d14079dec0f92a2f1048a2/
/raw/e6cf0fab19d14079dec0f92a2f1048a2/
e6cf0fab19d14079dec0f92a2f1048a2
c
C
1
2019-07-08T21:54:04
True
False
False
/api/public/snipt/24529/
compile-in-c-simple
<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="n">gcc</span> <span class="o">-</span><span class="n">o</span> <span class="n">hello</span> <span class="n">helloworld</span><span class="p">.</span><span class="n">c</span> </span></pre></div> </td></tr></table>
"hello world", c, compile, gcc

Text only

untar tar.gz

//I always forget! 
tar -zxvf filename.tar.gz 
https://snipt.net/embed/5c01ab6d43bd4d4529fd1031f28adafc/
/raw/5c01ab6d43bd4d4529fd1031f28adafc/
5c01ab6d43bd4d4529fd1031f28adafc
text
Text only
2
2019-07-10T06:23:08
True
False
False
/api/public/snipt/15228/
untar-targz
<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>//I always forget! </span><span id="L-2"><a name="L-2"></a>tar -zxvf filename.tar.gz </span></pre></div> </td></tr></table>
gz, gzip, tar, tarball

Text only

copy + drag mac

hold option and drag a file within finder to COPY the file, not move it. 
https://snipt.net/embed/ee17e38f8f2a3d775cbbee740d1286f0/
/raw/ee17e38f8f2a3d775cbbee740d1286f0/
ee17e38f8f2a3d775cbbee740d1286f0
text
Text only
1
2019-07-12T14:59:28
True
False
False
/api/public/snipt/12539/
copy-drag-mac
<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>hold option and drag a file within finder to COPY the file, not move it. </span></pre></div> </td></tr></table>
"os x", copy, drag, finder

Common Lisp

start lisp in emacs

M-x run-lisp
https://snipt.net/embed/fae3030b2e574f484a685df280c389e1/
/raw/fae3030b2e574f484a685df280c389e1/
fae3030b2e574f484a685df280c389e1
common-lisp
Common Lisp
2
2019-07-15T10:15:47
True
False
False
/api/public/snipt/11933/
start-lisp-in-emacs
<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="nv">M-x</span> <span class="nv">run-lisp</span> </span></pre></div> </td></tr></table>
clisp, emacs, lisp, repl

Bash

rsync a file to remote server

rsync -av -e ssh <filename here> [email protected]:/home/theuser/
https://snipt.net/embed/027234350af6c92b21fc5fb9bc961fba/
/raw/027234350af6c92b21fc5fb9bc961fba/
027234350af6c92b21fc5fb9bc961fba
bash
Bash
1
2019-07-01T20:10:54
True
False
False
/api/public/snipt/2003/
rsync-a-file-to-remote-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>rsync -av -e ssh &lt;filename here&gt; [email protected]:/home/theuser/ </span></pre></div> </td></tr></table>
bash, rsync, server

Bash

use imagemagick to make a batch of web friendly photos

1
2
3
mkdir thumbs
cp *.JPG thumbs/ && cd thumbs
mogrify -resize 20% *.JPG
https://snipt.net/embed/0ea1c66e92f5117e96dfdb9ef231c99f/
/raw/0ea1c66e92f5117e96dfdb9ef231c99f/
0ea1c66e92f5117e96dfdb9ef231c99f
bash
Bash
3
2019-07-07T22:54:36
True
False
False
/api/public/snipt/1988/
use-imagemagick-to-make-a-batch-of-web-friendly-photos
<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>mkdir thumbs </span><span id="L-2"><a name="L-2"></a>cp *.JPG thumbs/ <span class="o">&amp;&amp;</span> <span class="nb">cd</span> thumbs </span><span id="L-3"><a name="L-3"></a>mogrify -resize 20% *.JPG </span></pre></div> </td></tr></table>
bash, imagemagick, photo

PHP

include a php file in a html file

<?php include("filetoinclude.php"); ?>
https://snipt.net/embed/96ca08cb643cec66d90c7bd1158301b9/
/raw/96ca08cb643cec66d90c7bd1158301b9/
96ca08cb643cec66d90c7bd1158301b9
php
PHP
1
2019-07-08T00:52:18
True
False
False
/api/public/snipt/1987/
include-a-php-file-in-a-html-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><span class="cp">&lt;?php</span> <span class="k">include</span><span class="p">(</span><span class="s2">&quot;filetoinclude.php&quot;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
html, php, server, web

CSS

pad images nicely on website css

1
2
3
4
img {
        padding: 10px;
        margin: 5px;
}
https://snipt.net/embed/5626de5cb19e493660a42d628b20a434/
/raw/5626de5cb19e493660a42d628b20a434/
5626de5cb19e493660a42d628b20a434
css
CSS
4
2019-07-03T08:56:44
True
False
False
/api/public/snipt/858/
pad-images-nicely-on-website-css
<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="nt">img</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">padding</span><span class="o">:</span> <span class="m">10px</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">margin</span><span class="o">:</span> <span class="m">5px</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
css, image, img, padding, web

Text only

start mysql on mac

1
2
3
4
5
6
7
sudo /usr/local/mysql/bin/safe_mysqld

sudo mkdir /var/mysql/

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

export PATH="$PATH:/usr/local/mysql/bin"
https://snipt.net/embed/893ac8ab83c59ce42557d554e6aa3fda/
/raw/893ac8ab83c59ce42557d554e6aa3fda/
893ac8ab83c59ce42557d554e6aa3fda
text
Text only
7
2019-07-15T09:41:34
True
False
False
/api/public/snipt/855/
start-mysql-on-mac
<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> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>sudo /usr/local/mysql/bin/safe_mysqld </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>sudo mkdir /var/mysql/ </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a>export PATH=&quot;$PATH:/usr/local/mysql/bin&quot; </span></pre></div> </td></tr></table>
bash, mac, mysql, osx, server