snipt

Ctrl+h for KB shortcuts

PHP

ISO to UTF conversion

iconv('ISO-8859-1', 'UTF-8',$str);
https://snipt.net/embed/81ece0f218e8520d4a9ba8cce68a6907/
https://snipt.net/raw/81ece0f218e8520d4a9ba8cce68a6907/
81ece0f218e8520d4a9ba8cce68a6907
php
PHP
1
2016-09-26T04:05:48
True
False
False
/api/public/snipt/120490/
iso-to-utf-conversion
<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="x">iconv(&#39;ISO-8859-1&#39;, &#39;UTF-8&#39;,$str);</span> </span></pre></div> </td></tr></table>
"character conversion", iso, php, utf-8

Bash

Make iso images from CD

1
2
3
4
cat /dev/scd0 > /home/shamanstears/test.iso

#where scd0 is the identifier of the cd/dvd reader
#can find it through System Monitor in Ubuntu
https://snipt.net/embed/e32a49666c1a23a8849b552f7c841365/
https://snipt.net/raw/e32a49666c1a23a8849b552f7c841365/
e32a49666c1a23a8849b552f7c841365
bash
Bash
4
2016-09-28T02:06:28
True
False
False
Mar 25, 2013 at 04:58 AM
/api/public/snipt/58241/
make-iso-images-from-cd
<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>cat /dev/scd0 &gt; /home/shamanstears/test.iso </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c">#where scd0 is the identifier of the cd/dvd reader</span> </span><span id="L-4"><a name="L-4"></a><span class="c">#can find it through System Monitor in Ubuntu</span> </span></pre></div> </td></tr></table>
bash, cd, image, iso

Text only

Save partition into a iso with dd

sudo dd if=/dev/sdc1 of=/tmp/tmp.iso
https://snipt.net/embed/f7cd38bf69f17b3d9d98c155e3b03370/
https://snipt.net/raw/f7cd38bf69f17b3d9d98c155e3b03370/
f7cd38bf69f17b3d9d98c155e3b03370
text
Text only
2
2016-09-29T02:14:57
True
False
False
May 22, 2013 at 02:01 PM
/api/public/snipt/43760/
copiar-particion-con-dd
<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>sudo dd if=/dev/sdc1 of=/tmp/tmp.iso </span></pre></div> </td></tr></table>
Debian, Linux, Ubuntu, dd, iso

Bash

mount iso linux

mount -o loop disk1.iso /mnt/disk
https://snipt.net/embed/b187ecdaf51c3cf22d97ffd184f4afd7/
https://snipt.net/raw/b187ecdaf51c3cf22d97ffd184f4afd7/
b187ecdaf51c3cf22d97ffd184f4afd7
bash
Bash
1
2016-09-22T09:38:45
True
False
False
/api/public/snipt/22775/
mount-iso-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 id="L-1"><a name="L-1"></a>mount -o loop disk1.iso /mnt/disk </span></pre></div> </td></tr></table>
bash, iso, linux

Bash

Bootable CD

mkisofs -o try2.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v .
https://snipt.net/embed/16c2e3ff40b649bde0e8ab1b8768f9d2/
https://snipt.net/raw/16c2e3ff40b649bde0e8ab1b8768f9d2/
16c2e3ff40b649bde0e8ab1b8768f9d2
bash
Bash
2
2016-09-26T07:05:58
True
False
False
/api/public/snipt/22771/
bootable-cd
<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>mkisofs -o try2.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size <span class="m">4</span> -boot-info-table -R -J -v . </span></pre></div> </td></tr></table>
bash, iso, mkisofs

PHP

Convert MM/DD/YYYY date to YYYY-MM-DD with PHP

1
2
3
4
5
6
7
8
<?
function convertDate($date) {
	$date = preg_replace('/\D/','/',$date);
	return date('Y-m-d',strtotime($date));
}

print convertDate('11/05/1996'); //prints 1996-11-05
?>
https://snipt.net/embed/2325e463da0114ccc684fbc7ba9e2a00/
https://snipt.net/raw/2325e463da0114ccc684fbc7ba9e2a00/
2325e463da0114ccc684fbc7ba9e2a00
php
PHP
8
2016-09-29T12:54:31
True
False
False
/api/public/snipt/14231/
convert-date-to-yyyy-mm-dd-with-php
<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> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?</span> </span><span id="L-2"><a name="L-2"></a><span class="k">function</span> <span class="nf">convertDate</span><span class="p">(</span><span class="nv">$date</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="nv">$date</span> <span class="o">=</span> <span class="nb">preg_replace</span><span class="p">(</span><span class="s1">&#39;/\D/&#39;</span><span class="p">,</span><span class="s1">&#39;/&#39;</span><span class="p">,</span><span class="nv">$date</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">return</span> <span class="nb">date</span><span class="p">(</span><span class="s1">&#39;Y-m-d&#39;</span><span class="p">,</span><span class="nb">strtotime</span><span class="p">(</span><span class="nv">$date</span><span class="p">));</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="k">print</span> <span class="nx">convertDate</span><span class="p">(</span><span class="s1">&#39;11/05/1996&#39;</span><span class="p">);</span> <span class="c1">//prints 1996-11-05</span> </span><span id="L-8"><a name="L-8"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
convert, date, iso

Bash

ISO-DMG Conversion

1
2
3
4
# Convert a DMG file to ISO
hdiutil convert /path/imagefile.dmg -format UDTO -o /path/convertedimage.iso
# Convert an ISO file to DMG format
hdiutil convert /path/imagefile.iso -format UDRW -o /path/convertedimage.dmg
https://snipt.net/embed/628cc036280b808634f826d49801a30e/
https://snipt.net/raw/628cc036280b808634f826d49801a30e/
628cc036280b808634f826d49801a30e
bash
Bash
4
2016-09-28T20:56:59
True
False
False
/api/public/snipt/8168/
iso-dmg-conversion
<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><span class="c"># Convert a DMG file to ISO</span> </span><span id="L-2"><a name="L-2"></a>hdiutil convert /path/imagefile.dmg -format UDTO -o /path/convertedimage.iso </span><span id="L-3"><a name="L-3"></a><span class="c"># Convert an ISO file to DMG format</span> </span><span id="L-4"><a name="L-4"></a>hdiutil convert /path/imagefile.iso -format UDRW -o /path/convertedimage.dmg </span></pre></div> </td></tr></table>
dmg, iso, mac

Text only

convert bin to iso

# convert the bin file to iso
ccd2iso file.bin file.iso 
https://snipt.net/embed/75b269f6c8d0d07f0b7ddf2724b1e6d4/
https://snipt.net/raw/75b269f6c8d0d07f0b7ddf2724b1e6d4/
75b269f6c8d0d07f0b7ddf2724b1e6d4
text
Text only
3
2016-09-26T14:32:12
True
False
False
/api/public/snipt/6885/
convert-bin-to-iso
<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># convert the bin file to iso </span><span id="L-2"><a name="L-2"></a>ccd2iso file.bin file.iso </span></pre></div> </td></tr></table>
bin, cue, iso, linux
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.