snipt

Ctrl+h for KB shortcuts

Python

unicode to HTML entity conversion for python

import cgi
cgi.escape(posts).encode('ascii', 'xmlcharrefreplace')
https://snipt.net/embed/4aa349443a3723736bcc3a55fd900774/
/raw/4aa349443a3723736bcc3a55fd900774/
4aa349443a3723736bcc3a55fd900774
python
Python
2
2019-05-09T21:40:18
True
False
False
/api/public/snipt/17268/
unicode-to-html-entity-conversion-for-python
<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="kn">import</span> <span class="nn">cgi</span> </span><span id="L-2"><a name="L-2"></a><span class="n">cgi</span><span class="o">.</span><span class="n">escape</span><span class="p">(</span><span class="n">posts</span><span class="p">)</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s1">&#39;ascii&#39;</span><span class="p">,</span> <span class="s1">&#39;xmlcharrefreplace&#39;</span><span class="p">)</span> </span></pre></div> </td></tr></table>
python, zomg

JavaScript

Google-hosted jQuery

1
2
3
4
5
<script src="http://www.google.com/jsapi"></script>
<script>
  // Load jQuery
  google.load("jquery", "1");
</script>
https://snipt.net/embed/79c932b7d2bf15ea4532f00f2dacdb64/
/raw/79c932b7d2bf15ea4532f00f2dacdb64/
79c932b7d2bf15ea4532f00f2dacdb64
js
JavaScript
5
2019-05-12T07:10:07
True
False
False
/api/public/snipt/13512/
google-hosted-jquery
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="o">&lt;</span><span class="nx">script</span> <span class="nx">src</span><span class="o">=</span><span class="s2">&quot;http://www.google.com/jsapi&quot;</span><span class="o">&gt;&lt;</span><span class="err">/script&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="o">&lt;</span><span class="nx">script</span><span class="o">&gt;</span> </span><span id="L-3"><a name="L-3"></a> <span class="c1">// Load jQuery</span> </span><span id="L-4"><a name="L-4"></a> <span class="nx">google</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="s2">&quot;jquery&quot;</span><span class="p">,</span> <span class="s2">&quot;1&quot;</span><span class="p">);</span> </span><span id="L-5"><a name="L-5"></a><span class="o">&lt;</span><span class="err">/script&gt;</span> </span></pre></div> </td></tr></table>
google, javascript, jquery

Bash

See which modules are loaded in Apache (on OSX)

/usr/sbin/apachectl -l
https://snipt.net/embed/a17534013b8b9c8126a807f9e06917a4/
/raw/a17534013b8b9c8126a807f9e06917a4/
a17534013b8b9c8126a807f9e06917a4
bash
Bash
1
2019-05-10T16:08:46
True
False
False
/api/public/snipt/10839/
see-which-modules-are-loaded-in-apache-on-osx
<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/sbin/apachectl -l </span></pre></div> </td></tr></table>
apache, modules, osx

Bash

Perform a packet dump for your Mac airport express card

$ sudo tcpdump -i en1 -vvv -n -s 0 -w ~/Desktop/DumpFile.dmp
https://snipt.net/embed/83da9c1b8d9579c25e12b9a399cbe8b2/
/raw/83da9c1b8d9579c25e12b9a399cbe8b2/
83da9c1b8d9579c25e12b9a399cbe8b2
bash
Bash
1
2019-05-11T19:57:46
True
False
False
/api/public/snipt/8669/
perform-a-packet-dump-for-your-mac-airport-express-card
<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>$ sudo tcpdump -i en1 -vvv -n -s <span class="m">0</span> -w ~/Desktop/DumpFile.dmp </span></pre></div> </td></tr></table>
dump, osx, packet