<?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>gj |</title>
	<atom:link href="https://blog.gaiterjones.com/category/mobile/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.gaiterjones.com/category/mobile/</link>
	<description>gaiterjones</description>
	<lastBuildDate>Mon, 27 Jul 2015 06:47:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>
	<item>
		<title>IOS 7.x Jailbreak SSH Access / SSH Tunnel</title>
		<link>https://blog.gaiterjones.com/ios-7-x-jailbreak-ssh-access-ssh-tunnel/</link>
					<comments>https://blog.gaiterjones.com/ios-7-x-jailbreak-ssh-access-ssh-tunnel/#comments</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Thu, 23 Jan 2014 21:19:50 +0000</pubDate>
				<category><![CDATA[IOS]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SSH]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=1092</guid>

					<description><![CDATA[&#160; There are 3 reasons why I always &#8220;Jailbreak&#8221; my iPad. The Apple iPad is a (bloody expensive) computer. When I buy a (bloody expensive) computer I expect to have...<a class="more-link" href="https://blog.gaiterjones.com/ios-7-x-jailbreak-ssh-access-ssh-tunnel/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p>There are 3 reasons why I always &#8220;Jailbreak&#8221; my iPad.</p>
<ol>
<li>The Apple iPad is a (bloody expensive) computer. When I buy a (bloody expensive) computer I expect to have 100% usability from it. The restrictions imposed by Apple on their i device operating system (IOS) inhibit it&#8217;s practical usability considerably, and I <em>really</em> don&#8217;t like that.</li>
<li>When I am travelling I use the excellent <a href="http://intelliborn.com/mywi.html" target="_blank">MyWi </a>app to turn my iPad into a wireless hotspot.</li>
<li>For privacy and security I like to be able to tunnel my iPad traffic through a secure SSH connection to my server.</li>
</ol>
<p>&#8220;Jailbreaking&#8221; exploits vulnerabilities in IOS to achieve root access to the operating system thus &#8220;liberating&#8221; IOS and allowing ad hoc software to be installed and executed. If you come from a Unix background this is great, because your (bloody expensive) computer now becomes really useful in accessing other Unix based systems and doing geeky Unix type stuff.</p>
<p>I have been Jailbreaking my iPad since IOS v.5 &#8211; I find little point in Jailbreaking my iPhone as the screen size limits use.</p>
<p>The Jailbreak process itself is always seamless:</p>
<ul>
<li>Backup with iTunes</li>
<li>Install update from iTunes (not via OTA update)</li>
<li>Restore from iTunes</li>
<li>Jailbreak</li>
<li>Restore Cydia software and purchases, i.e. MyWi.</li>
</ul>
<p>The IOS 7.x Jailbreak was released recently and I finally decided to upgrade my iPad from IOS 6.x to IOS 7.x and apply the Jailbreak, as usual this worked pretty well, but some changes in IOS 7 caused problems:</p>
<ul>
<li>IOS 7 stops applications from connecting to localhost SSH on port 22</li>
<li>IOS 7 multi tasking affects SSH background connections</li>
</ul>
<h2>IOS 7 Stops Applications from Connecting to localhost SSH on Port 22</h2>
<p>This was a devious software change by Apple. Normally after Jailbreaking the first task is to install Open SSH via Cydia &#8211; this gives you normal SSH terminal access to the device, and then use a terminal application such as iSSH to login to the device (localhost) as root.</p>
<p>With IOS 7 Apple have hardcoded a restriction into the operating system that stops (App Store) Apps from making an SSH connection to localhost on the default SSH port 22. When you try and connect with iSSH you will get a <em>connection cancelled error</em>. You can still SSH from an external device, but not locally.</p>
<p>The workaround for this is to change the listening TCP/UDP ports used by the SSH daemon to something other than 22.</p>
<p>To do this you need to edit a couple of system files. An easy way to edit the files is with the Cydia app iFile.</p>
<p>Take a look at <strong>/etc/services </strong>this file defines network services including SSH. Find the entries for SSH:</p>
<p>ssh    22/udp    # SSH Remote Login Protocol<br />
ssh    22/tcp      # SSH Remote Login Protocol</p>
<p>and duplicate them creating a new service called ssh2</p>
<p>ssh2    52222/udp    # SSH Server<br />
ssh2   52222/tcp      # SSH Server</p>
<p>Save the file.</p>
<p>Here I am using 52222 for the UDP/TCP ports, you can use other port numbers but stay clear of well known ports from 0 &#8211; 1023 (dynamic/private ports 49152 to 655535 are preferable).</p>
<p>Now edit <em>/Library/LaunchDaemons/com.openssh.sshd.plist </em> and change the SockServiceName string to <strong>ssh2</strong>.</p>
<p>&lt;key&gt;SockServiceName&lt;/key&gt;<br />
&lt;string&gt;<strong>ssh2</strong>&lt;/string&gt;</p>
<p>Save the file and reboot.</p>
<p>We are basically telling the operating system to continue using port 22 for SSH connections but to listen for SSH connections on a different port.</p>
<p>You can now connect using SSH on the port you specified i.e.</p>
<p>ssh root@my.ipad.address:52222</p>
<p><em>Remember to change the root and mobile default passwords of your i device when you login.</em></p>
<h2>IOS 7 multi tasking affects SSH background CONNECTIONS</h2>
<p>So now I have root access to my IOS 7.0 device I can run SSH to create a secure tunnel to my Ubuntu server:</p>
<p><a href="http://linux.die.net/man/1/ssh" target="_blank">ssh </a>-N -g -D XXXX user@myserver.com</p>
<p>This creates a SOCKS proxy tunnel on port XXXX over SSH to my server, the i device can be configured to send all traffic via this proxy with a <a href="http://en.wikipedia.org/wiki/Proxy_auto-config" target="_blank">proxy auto config </a>(PAC) file.</p>
<p>On IOS 7.0 this worked as expected, <em>hurrah</em>! I ran the shh tunnel changed my Wifi proxy settings to auto using my PAC file URL, switched apps to Chrome, checked my IP address to confirm I was proxying via the SOCKS tunnel and was happy that my iPad data was going through the &#8220;secure&#8221; tunnel &#8211;  until a few minutes later when it stopped working, <em>doh!</em></p>
<p>The tunnel stops working because shortly after switching apps the SSH connection to the iPad is terminated, also terminating the SSH tunnel. This is because Apple has changed the way App <a href="http://support.apple.com/kb/ht4211" target="_blank">multitasking works</a> in IOS 7.x</p>
<p>When you switch apps in IOS 7 some apps continue to run for a short while and are then set to a suspended state to reduce system resources. They will &#8220;instantly&#8221; launch when you return to them. Of course when an app like iSSH switches to the background and is suspended by the operating system any active SSH connections will quickly timeout and terminate. This means our session running the SSH tunnel will be terminated, closing the tunnel.</p>
<p>Some apps are allowed to update in the background, and this is controlled via the background refresh options in settings, but as of the time of writing iSSH (and Prompt) do not appear in this list. (in IOS 6 apps were allowed to run for 10 minutes in the background and iSSH used to prompt you to return to the app to keep connections alive).</p>
<p>Fortunately there is a simple work around to this problem, install the <a href="https://code.google.com/p/mobileterminal/" target="_blank">mobile terminal</a> app via Cydia and reboot. The mobile terminal app has been around for a while and gives you direct command line access as the mobile user. Although Cydia says it only supports IOS v4 to v6 it installs and runs perfectly on IOS v7.x too.</p>
<p>The great thing about mobile terminal is that it creates a direct local login session. When you switch the app to the background this session will keep running even when the mobile terminal app is suspended and reset. In fact if you install <em>adv-cmds</em> via Cydia you can login via SSH and see this login session running as a process with the <strong>ps</strong> command.</p>
<p>So we execute our SOCKS proxy ssh command in mobile terminal and setup the tunnel, when the mobile terminal app switches to the background the tunnel will stay open in the login session <em>indefinitely</em>, or until you kill the session manually from another command line using the kill process command.</p>
<p>If you don&#8217;t want to use mobile terminal have a look at the cydia implementations of screen and autossh.</p>
<p>Now I have full SSH functionality from my (bloody expensive) IOS 7.x computer again!</p>
<p>Here is the pac file I use for my proxy auto config:</p>
<p>function FindProxyForURL(url, host) {<br />
return &#8220;SOCKS localhost:XXXX&#8221;;<br />
}</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/ios-7-x-jailbreak-ssh-access-ssh-tunnel/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Enable Magento iPhone Theme for Mobile Browsers</title>
		<link>https://blog.gaiterjones.com/enable-magento-iphone-theme-for-mobile-browsers/</link>
					<comments>https://blog.gaiterjones.com/enable-magento-iphone-theme-for-mobile-browsers/#comments</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Mon, 13 May 2013 13:57:27 +0000</pubDate>
				<category><![CDATA[5 Minute Fix]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[Mobile]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=962</guid>

					<description><![CDATA[Do you know how many of your customers are visiting your site using a mobile device? If you don&#8217;t, take a quick look at your Google analytics and check the...<a class="more-link" href="https://blog.gaiterjones.com/enable-magento-iphone-theme-for-mobile-browsers/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p><a href="https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_02.jpg"><img decoding="async" class="hang-2-column      alignnone" alt="Magento Default IPhone theme" src="https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_02-226x440.jpg" width="136" height="264" /></a></p>
<p>Do you know how many of your customers are visiting your site using a mobile device? If you don&#8217;t, take a quick look at your Google analytics and check the figures under Audience -&gt; Mobile -&gt; Overview and Devices. If the % of visits from mobile devices is more than 10% of your total site visits then you might want to think about providing specific content for mobile visitors to your Shop otherwise you maybe losing out on sales.</p>
<figure id="attachment_968" aria-describedby="caption-attachment-968" style="width: 316px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2013/05/mobile-device-analytics.jpg"><img fetchpriority="high" decoding="async" class=" wp-image-968 " alt="Mobile Device Visitor stats from Google Analytics" src="https://blog.gaiterjones.com/wp-content/uploads/2013/05/mobile-device-analytics-395x440.jpg" width="316" height="352" srcset="https://blog.gaiterjones.com/wp-content/uploads/2013/05/mobile-device-analytics-395x440.jpg 395w, https://blog.gaiterjones.com/wp-content/uploads/2013/05/mobile-device-analytics.jpg 493w" sizes="(max-width: 316px) 100vw, 316px" /></a><figcaption id="caption-attachment-968" class="wp-caption-text">Mobile Device Visitor stats from Google Analytics</figcaption></figure>
<p>&nbsp;</p>
<p>Since Magento v1.4.x a built in mobile theme called iPhone is included with the source code.but it is not enabled by default. Here is a quick fix to enable the built in Magento iPhone theme for your Magento store to provide a better browsing experience for visitors using mobile devices.</p>
<p>Login to admin and goto <strong>System -&gt; Configuration</strong>. Click on <strong>General</strong> in the left hand menu and then <strong>Design</strong>. <strong></strong>Expand the theme section and then configure the following exceptions under Templates, Skin and Layout.</p>
<p>Matched Expression &#8211; iPhone|iPad|iPod|Android|IEMobile</p>
<p>Value &#8211; iphone</p>
<figure id="attachment_963" aria-describedby="caption-attachment-963" style="width: 440px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_01-2.jpg"><img decoding="async" class="size-medium wp-image-963" title="Configure Exceptions for iPhone Theme" alt="Configure Exceptions for iPhone Theme" src="https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_01-2-440x346.jpg" width="440" height="346" srcset="https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_01-2-440x346.jpg 440w, https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_01-2-620x488.jpg 620w, https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_01-2.jpg 642w" sizes="(max-width: 440px) 100vw, 440px" /></a><figcaption id="caption-attachment-963" class="wp-caption-text">Configure Exceptions for iPhone Theme</figcaption></figure>
<p>&nbsp;</p>
<p>Click Save to save your settings.</p>
<p>Notice the user agents in the matched expressions, these define which mobile browsers identified by User Agent should use the mobile theme. The iPad has a fairly large screen so you might decide to exclude that for example.</p>
<p>If you visit your store now with a mobile device you will see the default iphone theme in action.</p>
<figure id="attachment_964" aria-describedby="caption-attachment-964" style="width: 226px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_02.jpg"><img loading="lazy" decoding="async" class="size-medium wp-image-964" alt="Magento Default IPhone theme" src="https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_02-226x440.jpg" width="226" height="440" srcset="https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_02-226x440.jpg 226w, https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_02-318x620.jpg 318w, https://blog.gaiterjones.com/wp-content/uploads/2013/05/screenshot_02.jpg 368w" sizes="(max-width: 226px) 100vw, 226px" /></a><figcaption id="caption-attachment-964" class="wp-caption-text">Magento Default IPhone theme</figcaption></figure>
<p>&nbsp;</p>
<p>Actually &#8211; its not very good is it, but it&#8217;s better than nothing and provides a good place to start building your own mobile theme. Alternatively (and I don&#8217;t say this very often) invest some $$ in the <a href="http://ecommerce.aheadworks.com/magento-extensions/iphone-theme.html" target="_blank">Aheadworks Mobile theme</a> because it really is excellent.</p>
<p>Whichever mobile theme you decide to use make sure you test it thoroughly on your staging server, especially if you have a lot of extension modules installed. You may need to customise the mobile theme to achieve the same functionality as you have from your desktop version. Remember to include an option switch from desktop to mobile versions on both sites so that visitors can also decide which theme they want to use.</p>
<p>For testing (if you don&#8217;t have a mobile device) set the user agent in your browser to a mobile browser i.e. iPhone. This is possible in Safari by enabling Developer Mode and clicking Develop -&gt; User Agent and selecting a mobile version of Safari from the drop down list. If you are a Mac user you can also use Xcode to run up an iPhone simulator as used for the screenshots above.</p>
<p>If your desktop site uses Flash, now is the time to start replacing it with HTML5 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/enable-magento-iphone-theme-for-mobile-browsers/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
