<?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>Schadenfreude &#187; ssh</title>
	<atom:link href="http://www.ralree.com/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ralree.com</link>
	<description>Malicious enjoyment derived from observing someone else's misfortune</description>
	<lastBuildDate>Sun, 28 Feb 2010 04:18:37 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Putting Non-YouTube Videos in MxTube</title>
		<link>http://www.ralree.com/2008/08/07/putting-non-youtube-videos-in-mxtube/</link>
		<comments>http://www.ralree.com/2008/08/07/putting-non-youtube-videos-in-mxtube/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 06:49:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[videos]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2008/08/07/putting-non-youtube-videos-in-mxtube</guid>
		<description><![CDATA[So, you have your Jailbroken iPod Touch or iPhone with 2.0 firmware running OpenSSH, and you have MxTube 1.5 or better, of course. What if you want one of those pesky videos that YouTube deletes all the time, like Paris Hilton For President? Or maybe you want a full movie on your iPod without having to sync to iTunes since you’re stuck in Linux Land. Well, here’s how.]]></description>
			<content:encoded><![CDATA[<p>So, you have your <strong>Jailbroken</strong> iPod Touch or iPhone with 2.0 firmware running OpenSSH, and you have <a href="http://www.appleiphoneapps.com/2008/08/update-mxtube-v15-with-walkthrough/">MxTube 1.5 or better</a>, of course.  What if you want one of those pesky videos that YouTube deletes all the time, like Paris Hilton For President?  Or maybe you want a full movie on your iPod without having to sync to iTunes since you’re stuck in Linux Land.  Well, here’s how:</p>
<h2>Download the video</h2>
<p>This can be done lots of ways, but somehow obtain a version of the video that ffmpeg can read.  It can be just about any format.  Let’s assume that we get a file called <strong>paris.flv</strong>.</p>
<h2>Convert the video</h2>
<pre><code>
ffmpeg -i paris.flv -b 500000 -s 176x144 -ac 1 -ab 64000 paris-high.mp4
</code></pre>
<p>This will make a nice movie for us to play.  Let’s put it on the iPod:</p>
<pre><code>
scp paris-high.mp4 root@ipod:/var/mobile/Media/MxTube/
</code></pre>
<h2>Make the Thumbnail</h2>
<p>We need to grab a frame from the middle of the movie.  Let’s use <code>mplayer</code> for that!</p>
<pre><code>
mplayer -vo jpeg -frames 1 -ss 30 paris.flv
</code></pre>
<p>This will make a file called <strong>00000001.jpg</strong>.  Let’s put that in the right spot:</p>
<pre><code>
scp 00000001.jpg root@ipod:/var/mobile/Media/MxTube/paris.thm
</code></pre>
<h2>Add the video to the Library</h2>
<p>Edit <strong>/var/mobile/Library/MxTube/VideoLibrary.plist</strong> <em>on the iPod</em>.  Make a new <strong>dict</strong> entry in the list like so:</p>
<pre><code>
        &lt;dict&gt;
                &lt;key&gt;author&lt;/key&gt;
                &lt;string&gt;hank&lt;/string&gt;
                &lt;key&gt;duration&lt;/key&gt;
                &lt;string&gt;01:50&lt;/string&gt;
                &lt;key&gt;high&lt;/key&gt;
                &lt;string&gt;/var/mobile/Media/MxTube/paris-high.mp4&lt;/string&gt;
                &lt;key&gt;id&lt;/key&gt;
                &lt;string&gt;64ad536a6dQ&lt;/string&gt;
                &lt;key&gt;thumbnail&lt;/key&gt;
                &lt;string&gt;/var/mobile/Media/MxTube/paris.thm&lt;/string&gt;
                &lt;key&gt;title&lt;/key&gt;
                &lt;string&gt;Paris for President&lt;/string&gt;
        &lt;/dict&gt;
</code></pre>
<p>Just fill in the right filenames for the thumbnail and movie like you used above.  Also, change the author to yourself or the original director, and the duration accordingly.  Keep the id something random.  Also, you can change the display title as the last option there.</p>
<h2>Other Pro Tips</h2>
<p>Keep in mind that if you want to be able to delete the movie from the interface, you need to change the ownership on all the files to <strong>mobile:mobile</strong> using <code>chown</code>.</p>
<h2>Results!</h2>
<p>Well, it totally works, with sound even.</p>
<p><img src="http://ralree.com/assets/2008/8/7/IMG_0001.PNG" alt="Paris is at the Bottom" /></p>
<p><img src="http://ralree.com/assets/2008/8/7/IMG_0006.PNG" alt="Here's Paris in Full Glory" /></p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2008/08/07/putting-non-youtube-videos-in-mxtube/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Putting Images on the iPod Touch from Linux</title>
		<link>http://www.ralree.com/2008/08/06/putting-images-on-the-ipod-touch-from-linux/</link>
		<comments>http://www.ralree.com/2008/08/06/putting-images-on-the-ipod-touch-from-linux/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 05:37:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2008/08/07/putting-images-on-the-ipod-touch-from-linux</guid>
		<description><![CDATA[Idea
I wanted to put images on my iPod Touch without using iTunes since, as most of us know, there is no good way to use it from Linux.  It turns out there is a magic directory on the iPod Touch where it saves images from Safari.  I simply looked at how it saved [...]]]></description>
			<content:encoded><![CDATA[<h2>Idea</h2>
<p>I wanted to put images on my iPod Touch without using iTunes since, as most of us know, there is no <strong>good</strong> way to use it from Linux.  It turns out there is a magic directory on the iPod Touch where it saves images from Safari.  I simply looked at how it saved them, and applied it on my box here at home.</p>
<h2>Requirements</h2>
<ul>
<li>Jailbroken iPod Touch (I used WinPWN), with OpenSSH installed and working (the root password is <em>alpine</em>)</li>
<li>Firmware 2.0 (Though, 1.x may work, I just haven’t tried it)</li>
<li>A Linux box with a bash shell</li>
<li>Cool images</li>
<li><code>convert</code> and <code>mogrify</code> from ImageMagick installed</li>
</ul>
<h2>Method</h2>
<h5><span style="color:red;">These instructions might work for the iPhone as well.  YMMV</span></h5>
<p>All of your images must be in the format <strong>IMG_XXXX.YYY</strong> where <strong>XXXX</strong> is a number &lt; 9999, and <strong>YYY</strong> is either <strong>JPG</strong> or <strong>THM</strong> (THM is a thumbnail).  To rename our files, I use a simple trick I outlined in my last post:</p>
<pre><code>
EII=4; for i in *.jpg; do ls $i; \
NEWNAME=IMG_00`printf "%02d" $EII`.JPG; \
echo Renaming $i to $NEWNAME; \
mv $i $NEWNAME; EII=`expr $EII + 1`; done
</code></pre>
<p>That will rename all the JPEG files in order from 4 to, in my case, 62.  Now, I have to make the thumbnails:</p>
<pre><code>
for i in `ls *.JPG | cut -d '.' -f 1`; do \
convert $i.JPG -resize 75x75! $i.THM; \
done
</code></pre>
<p>The <strong>75&#215;75!</strong> part makes sure they are exactly those dimensions.  You end up with something like the following:</p>
<pre><code>
IMG_0004.JPG  IMG_0016.JPG  IMG_0028.JPG  IMG_0040.JPG  IMG_0052.JPG
IMG_0004.THM  IMG_0016.THM  IMG_0028.THM  IMG_0040.THM  IMG_0052.THM
IMG_0005.JPG  IMG_0017.JPG  IMG_0029.JPG  IMG_0041.JPG  IMG_0053.JPG
....
</code></pre>
<p>Now, note that the iPod can only display images under 100KB (to my knowledge).  If your high-res image is too large, it will just display the magnified 75&#215;75, which is <strong><em>really</em></strong><em></em> ugly.  So, make sure all your images fit that description, and if they don’t, <code>mogrify -resize</code> them until they do (or take other measures as necessary).  I used this:</p>
<pre><code>
mogrify -resize 400x *.JPG
</code></pre>
<p>All my images turned out to be between 30 and 90 KB.  This also keeps the aspect ratio, unlike the <strong>75&#215;75!</strong>.</p>
<p>Now, SSH into your iPod (if you can’t do this yet, google it).  You should have the following file:</p>
<pre><code>
/var/mobile/Media/DCIM/.MISC/Info.plist
</code></pre>
<p>Open this file in vi, and observe the <strong>plist&gt;dict&gt;integer</strong> part of the hierarchy:</p>
<pre><code>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
        &lt;key&gt;LastFileGroupNumber-100&lt;/key&gt;
        &lt;integer&gt;62&lt;/integer&gt;
&lt;/dict&gt;
&lt;/plist&gt;
</code></pre>
<p>So, I put <strong>62</strong> in there since the last image I have is numbered 0062.  It’s a very simple idea.  Now, just load them onto the iPod:</p>
<pre><code>
scp IMG_00* root@ipod:/var/mobile/Media/DCIM/100APPLE/
</code></pre>
<p>Let’s have a look from the iPod console!</p>
<pre><code>
HanksTouch:/var/mobile/Media/DCIM/100APPLE root# ls
IMG_0002.JPG  IMG_0014.THM  IMG_0027.JPG  IMG_0039.THM  IMG_0052.JPG
IMG_0002.THM  IMG_0015.JPG  IMG_0027.THM  IMG_0040.JPG  IMG_0052.THM
</code></pre>
<p>Beautiful.  Now, to test it…</p>
<p><img class="alignleft" src="http://ralree.com/assets/2008/8/6/IMG_0002.PNG" alt="" width="320" height="480" /><img class="alignleft" src="http://ralree.com/assets/2008/8/6/IMG_0001.PNG" alt="" width="320" height="480" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2008/08/06/putting-images-on-the-ipod-touch-from-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux command line tips and tricks</title>
		<link>http://www.ralree.com/2007/07/20/linux-command-line-tips-and-tricks/</link>
		<comments>http://www.ralree.com/2007/07/20/linux-command-line-tips-and-tricks/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 02:45:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/linux-command-line-tips-and-tricks</guid>
		<description><![CDATA[This awesome page told me about the &#60;&#60;&#60; operator in bash.  It rocks.  It also told me the best way to set an initial login password:

umask u=rw,go=
openssl rand -base64 6 &#124; tee -a PasswordFile &#124; passwd –stdin joe
chage -d 0 joe

Also, there&#8217;s ssh-copy-id:

Usage: /usr/bin/ssh-copy-id [-i [identity_file]] [user@]machine

]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.venturecake.com/10-linux-shell-tricks-you-dont-already-know-for-once/">This awesome page</a> told me about the <code>&lt;&lt;&lt;</code> operator in <code>bash</code>.  It rocks.  It also told me the best way to set an initial login password:</p>
<pre><code>
umask u=rw,go=
openssl rand -base64 6 | tee -a PasswordFile | passwd –stdin joe
chage -d 0 joe
</code></pre>
<p>Also, there&#8217;s <code>ssh-copy-id</code>:</p>
<pre><code>
Usage: /usr/bin/ssh-copy-id [-i [identity_file]] [user@]machine
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/07/20/linux-command-line-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turn off host key check for SSH</title>
		<link>http://www.ralree.com/2007/03/12/turn-off-host-key-check-for-ssh/</link>
		<comments>http://www.ralree.com/2007/03/12/turn-off-host-key-check-for-ssh/#comments</comments>
		<pubDate>Mon, 12 Mar 2007 22:11:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/turn-off-host-key-check-for-ssh</guid>
		<description><![CDATA[Just for reference, to turn off SSH host key checks for localhost, here&#8217;s the line:

#.ssh/config
NoHostAuthenticationForLocalhost yes

]]></description>
			<content:encoded><![CDATA[<p>Just for reference, to turn off SSH host key checks for localhost, here&#8217;s the line:</p>
<pre><code>
#.ssh/config
NoHostAuthenticationForLocalhost yes
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/03/12/turn-off-host-key-check-for-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

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