snipt

Ctrl+h for KB shortcuts

Text only

remove directory from GIT

1
2
3
git rm -r one-of-the-directories
git commit -m "Remove duplicated directory"
git push origin master
https://snipt.net/embed/5c7dedff4d939d924ea1ff04daaafccd/
https://snipt.net/raw/5c7dedff4d939d924ea1ff04daaafccd/
5c7dedff4d939d924ea1ff04daaafccd
text
Text only
3
2016-09-22T18:07:17
True
False
False
May 07, 2013 at 08:55 AM
/api/public/snipt/60850/
remove-directory-from-git
<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 id="L-1"><a name="L-1"></a>git rm -r one-of-the-directories </span><span id="L-2"><a name="L-2"></a>git commit -m &quot;Remove duplicated directory&quot; </span><span id="L-3"><a name="L-3"></a>git push origin master </span></pre></div> </td></tr></table>
directory, folder, git, remove
https://snipt.net/embed/69799c4496789bbb8b968d076eb0d563/
https://snipt.net/raw/69799c4496789bbb8b968d076eb0d563/
69799c4496789bbb8b968d076eb0d563
bash
Bash
1
2016-09-27T01:48:41
True
False
False
/api/public/snipt/54332/
calcular-tamano-total-de-un-directorio-y-sus-sub-directorios
<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 id="L-1"><a name="L-1"></a>du -chs </span></pre></div> </td></tr></table>
folder, size

Bash

make directory and multiple subdirectories at once

$ mkdir -p somlor.com/{public,private,log,backup}
https://snipt.net/embed/7ad7fadab1f1a41534a1b25198eff333/
https://snipt.net/raw/7ad7fadab1f1a41534a1b25198eff333/
7ad7fadab1f1a41534a1b25198eff333
bash
Bash
1
2016-09-26T21:16:41
True
False
False
Feb 23, 2013 at 07:10 PM
/api/public/snipt/53807/
make-directory-and-multiple-subdirectories-at-once
<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 id="L-1"><a name="L-1"></a><span class="nv">$ </span>mkdir -p somlor.com/<span class="o">{</span>public,private,log,backup<span class="o">}</span> </span></pre></div> </td></tr></table>
directory, folder, mkdir, ubuntu, web, webdev

Text only

Deny access to folder for not specified ip address

1
2
3
4
ORDER DENY,ALLOW
  DENY FROM ALL
  ALLOW FROM 127.0.0.1
  ALLOW FROM 0.0.0.0
https://snipt.net/embed/cd530c72835dec31298f2182f27f92ea/
https://snipt.net/raw/cd530c72835dec31298f2182f27f92ea/
cd530c72835dec31298f2182f27f92ea
text
Text only
4
2016-09-26T23:47:16
True
False
False
/api/public/snipt/39473/
deny-access-to-folder-for-not-specified-ip-address
<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 id="L-1"><a name="L-1"></a>ORDER DENY,ALLOW </span><span id="L-2"><a name="L-2"></a> DENY FROM ALL </span><span id="L-3"><a name="L-3"></a> ALLOW FROM 127.0.0.1 </span><span id="L-4"><a name="L-4"></a> ALLOW FROM 0.0.0.0 </span></pre></div> </td></tr></table>
deny, folder, htaccess, ip

Bash

Compress an entire folder

tar -cvf [filename].tar.gz [folder path]
https://snipt.net/embed/fcdf41273abb586a4ab641097ebf3798/
https://snipt.net/raw/fcdf41273abb586a4ab641097ebf3798/
fcdf41273abb586a4ab641097ebf3798
bash
Bash
1
2016-09-26T05:24:51
True
False
False
/api/public/snipt/35963/
compress-an-entire-folder
<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 id="L-1"><a name="L-1"></a>tar -cvf <span class="o">[</span>filename<span class="o">]</span>.tar.gz <span class="o">[</span>folder path<span class="o">]</span> </span></pre></div> </td></tr></table>
compress, folder, gz, linux, tar, zip

Python

Show python lib folder

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
https://snipt.net/embed/20466cfca66a21e37b54fbc72d3a99d4/
https://snipt.net/raw/20466cfca66a21e37b54fbc72d3a99d4/
20466cfca66a21e37b54fbc72d3a99d4
python
Python
2
2016-09-24T17:00:59
True
False
False
/api/public/snipt/25389/
show-python-lib-folder
<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 id="L-1"><a name="L-1"></a><span class="n">python</span> <span class="o">-</span><span class="n">c</span> <span class="s">&quot;from distutils.sysconfig import get_python_lib; print get_python_lib()&quot;</span> </span></pre></div> </td></tr></table>
commandline, config, environment, folder, path, python

Bash

print folder size

# prints the folder size in KB
du -sk [dir]
https://snipt.net/embed/3586835d35fa18d3f73078b389f9cf25/
https://snipt.net/raw/3586835d35fa18d3f73078b389f9cf25/
3586835d35fa18d3f73078b389f9cf25
bash
Bash
2
2016-09-25T18:27:52
True
False
False
/api/public/snipt/18430/
print-folder-size
<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 id="L-1"><a name="L-1"></a><span class="c"># prints the folder size in KB</span> </span><span id="L-2"><a name="L-2"></a>du -sk <span class="o">[</span>dir<span class="o">]</span> </span></pre></div> </td></tr></table>
folder, size
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.