snipt

Ctrl+h for KB shortcuts

Bash

Twoscoop's django project template

django-admin.py startproject --template=https://github.com/twoscoops/django-twoscoops-project/zipball/master --extension=py,rst,html
https://snipt.net/embed/02e6f9ff38ca784cd5dee065f3a4c0b0/
/raw/02e6f9ff38ca784cd5dee065f3a4c0b0/
02e6f9ff38ca784cd5dee065f3a4c0b0
bash
Bash
1
2019-06-17T19:46:07
True
False
False
Apr 14, 2013 at 10:29 AM
/api/public/snipt/59295/
twoscoops-django-project-template
<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>django-admin.py startproject --template<span class="o">=</span>https://github.com/twoscoops/django-twoscoops-project/zipball/master --extension<span class="o">=</span>py,rst,html </span></pre></div> </td></tr></table>
django

Nginx configuration file

Redirect 50% of users in nginx

1
2
3
if ($remote_addr ~ "[02468]$") {
    rewrite ^(.*) http://somewhereelse.com/$1;
}
https://snipt.net/embed/974ec8288ef16a88b3bbff8434b8b71e/
/raw/974ec8288ef16a88b3bbff8434b8b71e/
974ec8288ef16a88b3bbff8434b8b71e
nginx
Nginx configuration file
3
2019-06-17T00:58:06
True
False
False
/api/public/snipt/42258/
redirect-50-of-users-in-nginx
<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><span class="k">if</span> <span class="s">(</span><span class="nv">$remote_addr</span> <span class="p">~</span> <span class="sr">&quot;[02468]$&quot;)</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="kn">rewrite</span> <span class="s">^(.*)</span> <span class="s">http://somewhereelse.com/</span><span class="nv">$1</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
nginx, sysadmin

Bash

OSX .bash_profile

export PS1='\[\033[0;32m\]\w\[\033[00m\]: '
export PATH=~/bin:/usr/local/mysql/bin:$PATH
https://snipt.net/embed/50daed72731bc28f28cc73753a36b33e/
/raw/50daed72731bc28f28cc73753a36b33e/
50daed72731bc28f28cc73753a36b33e
bash
Bash
2
2019-06-01T02:53:21
True
False
False
/api/public/snipt/32040/
osx-bash_profile
<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="nb">export</span> <span class="nv">PS1</span><span class="o">=</span><span class="s1">&#39;\[\033[0;32m\]\w\[\033[00m\]: &#39;</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span>~/bin:/usr/local/mysql/bin:<span class="nv">$PATH</span> </span></pre></div> </td></tr></table>
bash

Bash

WSGI processes sorted by memory footprint

ps -FU www-data |grep wsgi |sort -gk 6
https://snipt.net/embed/2c70869064f53a6e6df186e73ee3846f/
/raw/2c70869064f53a6e6df186e73ee3846f/
2c70869064f53a6e6df186e73ee3846f
bash
Bash
1
2019-06-09T23:36:20
True
False
False
/api/public/snipt/26674/
wsgi-processes-sorted-by-memory-footprint
<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>ps -FU www-data <span class="p">|</span>grep wsgi <span class="p">|</span>sort -gk 6 </span></pre></div> </td></tr></table>
apache, bash