Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

PHP

extract function use case

1
2
3
<?php
	extract($identity); //var_dump(extract($identity)) == int 3
?>
https://snipt.net/embed/49db45f71cc1bd268a8be44bbdcf151a/
https://snipt.net/raw/49db45f71cc1bd268a8be44bbdcf151a/
49db45f71cc1bd268a8be44bbdcf151a
php
PHP
3
2016-12-02T09:08:49
True
False
False
/api/public/snipt/128088/
extract-function-use-case
<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="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">extract</span><span class="p">(</span><span class="nv">$identity</span><span class="p">);</span> <span class="c1">//var_dump(extract($identity)) == int 3</span> </span><span id="L-3"><a name="L-3"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
extract, function, php

Bash

extract a specific file from a tar.gz

$ tar xfz abc.tar --wildcards --no-anchored 'redpics*'
https://snipt.net/embed/ab0da6899101a03376177ec62f65a74b/
https://snipt.net/raw/ab0da6899101a03376177ec62f65a74b/
ab0da6899101a03376177ec62f65a74b
bash
Bash
1
2016-12-03T23:54:16
True
False
False
Feb 23, 2013 at 07:10 PM
/api/public/snipt/53824/
extract-a-specific-file-from-a-targz
<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>$ tar xfz abc.tar --wildcards --no-anchored <span class="s1">&#39;redpics*&#39;</span> </span></pre></div> </td></tr></table>
extract, find, gz, tar, zip

Bash

Extracting an Entire tar.gz Archive

tar -xvf [filename].tar.gz
https://snipt.net/embed/513f65aa5c3f3e3f7782b6859d26eecc/
https://snipt.net/raw/513f65aa5c3f3e3f7782b6859d26eecc/
513f65aa5c3f3e3f7782b6859d26eecc
bash
Bash
1
2016-12-04T02:43:25
True
False
False
/api/public/snipt/36516/
extracting-an-entire-targz-archive
<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>tar -xvf <span class="o">[</span>filename<span class="o">]</span>.tar.gz </span></pre></div> </td></tr></table>
archive, extract, gz, tar

Text only

Extrack rar file in ubuntu

1
2
3
4
5
1. G? b? t?t c? quy?n truy nh?p vào:  /var/lib/dpkg/lock
$sudo rm /var/lib/dpkg/lock
2. Install
$sudo apt-get install rar
$sudo ln -fs /usr/bin/rar /usr/bin/unrar
https://snipt.net/embed/0ff772d439a1bad18afb8eec86cfd82b/
https://snipt.net/raw/0ff772d439a1bad18afb8eec86cfd82b/
0ff772d439a1bad18afb8eec86cfd82b
text
Text only
5
2016-12-02T17:15:42
True
False
False
/api/public/snipt/15765/
extrack-rar-file-in-ubuntu
<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>1. G? b? t?t c? quy?n truy nh?p vào: /var/lib/dpkg/lock </span><span id="L-2"><a name="L-2"></a>$sudo rm /var/lib/dpkg/lock </span><span id="L-3"><a name="L-3"></a>2. Install </span><span id="L-4"><a name="L-4"></a>$sudo apt-get install rar </span><span id="L-5"><a name="L-5"></a>$sudo ln -fs /usr/bin/rar /usr/bin/unrar </span></pre></div> </td></tr></table>
extract

Text only

extract initrd

gunzip < /boot/initrd.img | cpio -i --make-directories
https://snipt.net/embed/b7dc31e07b69627a0a259ce3a0c6feeb/
https://snipt.net/raw/b7dc31e07b69627a0a259ce3a0c6feeb/
b7dc31e07b69627a0a259ce3a0c6feeb
text
Text only
2
2016-12-03T05:14:01
True
False
False
/api/public/snipt/13274/
extract-initrd
<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>gunzip &lt; /boot/initrd.img | cpio -i --make-directories </span></pre></div> </td></tr></table>
extract, img, initrd, kernel

Bash

Extract bz2 On Linux

tar -xf file.tar.bz2 
https://snipt.net/embed/2f3bd7c6e0db422bd4c20bd6f79e4e0b/
https://snipt.net/raw/2f3bd7c6e0db422bd4c20bd6f79e4e0b/
2f3bd7c6e0db422bd4c20bd6f79e4e0b
bash
Bash
1
2016-12-02T17:15:47
True
False
False
/api/public/snipt/3375/
extract-bz2-on-linux
<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>tar -xf file.tar.bz2 </span></pre></div> </td></tr></table>
bash, extract, tar
Copyrighted, illegal, or inappropriate content? Email [email protected].