<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Inspirated &#187; BASH</title>
	<atom:link href="http://inspirated.com/tag/bash/feed" rel="self" type="application/rss+xml" />
	<link>http://inspirated.com</link>
	<description>krkhan&#039;s blog</description>
	<lastBuildDate>Mon, 02 Jan 2012 20:58:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HOWTO: Play PS3 backups with files larger than 4 GB</title>
		<link>http://inspirated.com/2010/10/16/howto-play-ps3-backups-with-files-larger-than-4-gb</link>
		<comments>http://inspirated.com/2010/10/16/howto-play-ps3-backups-with-files-larger-than-4-gb#comments</comments>
		<pubDate>Sat, 16 Oct 2010 15:28:08 +0000</pubDate>
		<dc:creator>krkhan</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Piracy]]></category>
		<category><![CDATA[Playstation 3]]></category>
		<category><![CDATA[PS3]]></category>
		<category><![CDATA[PSGroove]]></category>
		<category><![CDATA[Sony]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Workaround]]></category>

		<guid isPermaLink="false">http://inspirated.com/?p=325</guid>
		<description><![CDATA[One of the common issues gamers are facing in transferring their backups between their PS3 and PC is the filesize limits for FAT32 filesystems (which happens to be the only one recognized by Backup Manager on external USB drives). Fortunately, a workaround exists for transferring >4GB files to PS3 from USB storage. First of all, [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>One of the common issues gamers are facing in transferring their backups between their PS3 and PC is the filesize limits for FAT32 filesystems (which happens to be the only one recognized by Backup Manager on external USB drives). Fortunately, a workaround exists for transferring >4GB files to PS3 from USB storage. First of all, you&#8217;ll need <a href="http://comgenie.com/filemanager/">Comgenie&#8217;s Awesome Filemanager</a>. Once you&#8217;ve got it up and running you can split any large file in the following manner:</p>
<blockquote><p>Big.file<br />
Big.file.1.part<br />
Big.file.2.part<br />
Big.file.3.part</p></blockquote>
<p>Comgenie&#8217;s package comes with a file-splitter which splits following the pattern mentioned above. However, the utility runs only on Windows or Wine integrated with Mono. Fellow *nixers can use the handy <code>split</code> to the same effect. Here&#8217;s a shell script which I wrote for automating this task:</p>
<p style="text-align: center"><a href="http://inspirated.com/uploads/ps3split.tar.gz">ps3split.tar.gz</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$#&quot;</span> <span style="color: #660033;">-lt</span> <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: ps3split inputfile&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(readlink -f .)</span>&quot;</span> == <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(dirname &quot;$(readlink -f &quot;$1&quot;)</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">&quot; ]
then
    echo &quot;</span>Cannot <span style="color: #c20cb9; font-weight: bold;">split</span> files <span style="color: #000000; font-weight: bold;">in</span> the same directory <span style="color: #c20cb9; font-weight: bold;">as</span> original<span style="color: #ff0000;">&quot;
    exit 1
fi
&nbsp;
split --verbose <span style="color: #000099; font-weight: bold;">\
</span>      --bytes=4294967295 <span style="color: #000099; font-weight: bold;">\
</span>      --suffix-length=1 <span style="color: #000099; font-weight: bold;">\
</span>      --numeric-suffixes <span style="color: #000099; font-weight: bold;">\
</span>      &quot;</span><span style="color: #007800;">$1</span><span style="color: #ff0000;">&quot; &quot;</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #ff0000;">&quot;$1&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.part.<span style="color: #ff0000;">&quot;
&nbsp;
old=&quot;</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #ff0000;">&quot;$1&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.part.0<span style="color: #ff0000;">&quot;
new=&quot;</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #ff0000;">&quot;$1&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">&quot;
echo &quot;</span>renaming <span style="color: #c20cb9; font-weight: bold;">file</span> \<span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$old</span>\<span style="color: #000000; font-weight: bold;">`</span> -<span style="color: #000000; font-weight: bold;">&gt;</span> \<span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$new</span>\<span style="color: #000000; font-weight: bold;">`</span><span style="color: #ff0000;">&quot;
mv &quot;</span><span style="color: #007800;">$old</span><span style="color: #ff0000;">&quot; &quot;</span><span style="color: #007800;">$new</span><span style="color: #ff0000;">&quot;
&nbsp;
for old in <span style="color: #007800;">$(basename &quot;$1&quot;)</span>.part.*
do
    new=<span style="color: #780078;">`echo $old | sed 's/^\(.*\).part.\(.\)$/\1.\2.part/'`</span>
    echo &quot;</span>renaming <span style="color: #c20cb9; font-weight: bold;">file</span> \<span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$old</span>\<span style="color: #000000; font-weight: bold;">`</span> -<span style="color: #000000; font-weight: bold;">&gt;</span> \<span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$new</span>\<span style="color: #000000; font-weight: bold;">`</span><span style="color: #ff0000;">&quot;
    mv &quot;</span><span style="color: #007800;">$old</span><span style="color: #ff0000;">&quot; &quot;</span><span style="color: #007800;">$new</span><span style="color: #ff0000;">&quot;
done</span></pre></td></tr></table></div>

<p>Use the script by providing it the path of a file you want to split:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>krkhan<span style="color: #000000; font-weight: bold;">@</span>orthanc ps3split<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ .<span style="color: #000000; font-weight: bold;">/</span>ps3split <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>bluray<span style="color: #000000; font-weight: bold;">/</span>PS3_GAME<span style="color: #000000; font-weight: bold;">/</span>USRDIR<span style="color: #000000; font-weight: bold;">/</span>TEKKEN.psarc</pre></div></div>

<blockquote><p>creating file `TEKKEN.psarc.part.0&#8242;<br />
creating file `TEKKEN.psarc.part.1&#8242;<br />
renaming file `TEKKEN.psarc.part.0` -> `TEKKEN.psarc`<br />
renaming file `TEKKEN.psarc.part.1` -> `TEKKEN.psarc.1.part`
</p></blockquote>
<p>Transfer <em>all</em> the splitted files to your external harddisk and then copy the first part (`<em>TEKKEN.psarc</em>` in this case) using Comgenie&#8217;s Filemanager. It will automatically recognize the subsequent parts and join them together on the internal harddisk of PS3. I&#8217;ve tested the script on Tekken 6 and Red Dead Redemption and it worked flawlessly for both.</p>
<div class="shr-publisher-325"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><hr />
<p><small><a href="http://inspirated.com/2010/10/16/howto-play-ps3-backups-with-files-larger-than-4-gb">Permalink</a> |
<a href="http://inspirated.com/2010/10/16/howto-play-ps3-backups-with-files-larger-than-4-gb#comments">8 comments</a>
<br/>
Post tags: <a href="http://inspirated.com/tag/backups" rel="tag">Backups</a>, <a href="http://inspirated.com/tag/bash" rel="tag">BASH</a>, <a href="http://inspirated.com/tag/piracy" rel="tag">Piracy</a>, <a href="http://inspirated.com/tag/playstation-3" rel="tag">Playstation 3</a>, <a href="http://inspirated.com/tag/ps3" rel="tag">PS3</a>, <a href="http://inspirated.com/tag/psgroove" rel="tag">PSGroove</a>, <a href="http://inspirated.com/tag/sony" rel="tag">Sony</a>, <a href="http://inspirated.com/tag/technology" rel="tag">Technology</a>, <a href="http://inspirated.com/tag/workaround" rel="tag">Workaround</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://inspirated.com/2010/10/16/howto-play-ps3-backups-with-files-larger-than-4-gb/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How NOT to copy MBR with the dd command</title>
		<link>http://inspirated.com/2010/06/04/how-not-to-copy-mbr-with-the-dd-command</link>
		<comments>http://inspirated.com/2010/06/04/how-not-to-copy-mbr-with-the-dd-command#comments</comments>
		<pubDate>Fri, 04 Jun 2010 15:39:50 +0000</pubDate>
		<dc:creator>krkhan</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MBR]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://inspirated.com/?p=288</guid>
		<description><![CDATA[Yesterday I needed to copy the MBR of a drive over another. Googling a little I found the following command in various tutorials: -bash-$ dd if=/dev/sda of=/dev/sdb bs=512 count=1 Where /dev/sda and /dev/sda were the original and target hard disks respectively. The command did complete its work in a snap but it also made me [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Yesterday I needed to copy the MBR of a drive over another. Googling a little I found the following command in various tutorials:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-bash-$ <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb <span style="color: #007800;">bs</span>=<span style="color: #000000;">512</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span></pre></div></div>

<p>Where <code>/dev/sda</code> and <code>/dev/sda</code> were the original and target hard disks respectively. The command did complete its work in a snap but it also made me learn a thing about MBR structures the hard way: <em>Only 446 bytes of the MBR contain boot code, the next 64 contain the partition table!</em></p>
<p>The implications of the lesson being, if partition tables of both hard disks differ &#8212; which unfortunately was the case with me &#8212; the partition table of the target hard-disk will be <em>overwritten</em>. The correct way would therefore be:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-bash-$ <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb <span style="color: #007800;">bs</span>=<span style="color: #000000;">446</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span></pre></div></div>

<p>In case you did mess up the table, I recommend <a href="http://www.cgsecurity.org/wiki/TestDisk">TestDisk</a> for recovering your partitions.</p>
<div class="shr-publisher-288"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><hr />
<p><small><a href="http://inspirated.com/2010/06/04/how-not-to-copy-mbr-with-the-dd-command">Permalink</a> |
<a href="http://inspirated.com/2010/06/04/how-not-to-copy-mbr-with-the-dd-command#comments">No comment</a>
<br/>
Post tags: <a href="http://inspirated.com/tag/backup" rel="tag">Backup</a>, <a href="http://inspirated.com/tag/bash" rel="tag">BASH</a>, <a href="http://inspirated.com/tag/linux" rel="tag">Linux</a>, <a href="http://inspirated.com/tag/mbr" rel="tag">MBR</a>, <a href="http://inspirated.com/tag/open-source" rel="tag">Open Source</a>, <a href="http://inspirated.com/tag/rants" rel="tag">Rants</a>, <a href="http://inspirated.com/tag/technology" rel="tag">Technology</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://inspirated.com/2010/06/04/how-not-to-copy-mbr-with-the-dd-command/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GoDaddy/WordPress ninoplas Base64 virus and the fix</title>
		<link>http://inspirated.com/2010/03/02/wordpress-ninoplas-virus-and-the-fix</link>
		<comments>http://inspirated.com/2010/03/02/wordpress-ninoplas-virus-and-the-fix#comments</comments>
		<pubDate>Tue, 02 Mar 2010 14:40:53 +0000</pubDate>
		<dc:creator>krkhan</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[GoDaddy]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Virus]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://inspirated.com/?p=268</guid>
		<description><![CDATA[Update: The virus seems to have affected only GoDaddy websites, hence the change in title. Few hours ago I opened my website and noticed some rather strange Javascript hanging around the bottom. After some inspection, it became evident that every page on my blog was trying to load an IFrame to some place called ninoplas.com. [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><ins datetime="2010-03-03T16:24:34+00:00">Update: The virus seems to have affected only GoDaddy websites, hence the change in title.</ins></p>
<p>Few hours ago I opened my website and noticed some rather strange Javascript hanging around the bottom. After some inspection, it became evident that <em>every</em> page on my blog was trying to load an IFrame to some place called <code>ninoplas.com</code>. Turns out, I wasn&#8217;t alone and there are <a href="http://wordpress.org/support/topic/370546">other users</a> as well who are affected by this. Judging by the fact that different blogs were attacked at the same time, this was in all probability the result of a security hole in some plugin or the core itself.</p>
<p>The virus acted by adding a piece of encrypted code on the first line of <em>all</em> PHP files on the server. It&#8217;s rather unsettling to consider the extend of damage that could have been caused with the write access to those files. Still, the damage could be rectified by simply deleting those lines. I wrote a tiny script for doing this job which cleans the ninoplas virus from all the PHP files in the current directory:</p>
<p style="text-align: center"><a href="http://inspirated.com/uploads/clean-ninoplas.sh">clean-ninoplas.sh</a></p>
<p style="text-align: center; font-size: x-small">Warning: While this script has worked for me, I am in <strong>no</strong> way providing any guarantee for how it behaves on other blogs. Backup your blog as well as database before executing this script.<br />
<strong>You have been warned.</strong></p>
<p>Using the fix is a simple matter of:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-bash-$ <span style="color: #7a0874; font-weight: bold;">cd</span> wordpress
-bash-$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>inspirated.com<span style="color: #000000; font-weight: bold;">/</span>uploads<span style="color: #000000; font-weight: bold;">/</span>clean-ninoplas.sh
-bash-$ <span style="color: #c20cb9; font-weight: bold;">sh</span> clean-ninoplas.sh</pre></div></div>

<p>And don&#8217;t forget to backup everything again after cleaning up. The security hole &#8212; if there is one &#8212; has still not been tracked and if it&#8217;s in the core or some plugin which you&#8217;re still using, the virus might not be so benevolent next time.</p>
<div class="shr-publisher-268"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><hr />
<p><small><a href="http://inspirated.com/2010/03/02/wordpress-ninoplas-virus-and-the-fix">Permalink</a> |
<a href="http://inspirated.com/2010/03/02/wordpress-ninoplas-virus-and-the-fix#comments">69 comments</a>
<br/>
Post tags: <a href="http://inspirated.com/tag/bash" rel="tag">BASH</a>, <a href="http://inspirated.com/tag/fix" rel="tag">Fix</a>, <a href="http://inspirated.com/tag/godaddy" rel="tag">GoDaddy</a>, <a href="http://inspirated.com/tag/rants" rel="tag">Rants</a>, <a href="http://inspirated.com/tag/script" rel="tag">Script</a>, <a href="http://inspirated.com/tag/security" rel="tag">Security</a>, <a href="http://inspirated.com/tag/virus" rel="tag">Virus</a>, <a href="http://inspirated.com/tag/wordpress" rel="tag">WordPress</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://inspirated.com/2010/03/02/wordpress-ninoplas-virus-and-the-fix/feed</wfw:commentRss>
		<slash:comments>69</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.636 seconds -->

