<?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>WHMCR</title> <atom:link href="http://www.whmcr.com/feed/" rel="self" type="application/rss+xml" /><link>http://www.whmcr.com</link> <description>Just another WordPress site</description> <lastBuildDate>Tue, 06 Dec 2011 16:48:41 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>Yubikey and server authentication</title><link>http://www.whmcr.com/2011/12/06/yubikey-and-server-authentication/</link> <comments>http://www.whmcr.com/2011/12/06/yubikey-and-server-authentication/#comments</comments> <pubDate>Tue, 06 Dec 2011 16:48:05 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Projects]]></category> <category><![CDATA[Software]]></category><guid
isPermaLink="false">http://www.whmcr.com/?p=267</guid> <description><![CDATA[After starting to use the Yubikey for LastPass and various other online servers I&#8217;ve started also using my yubikey for SSH access to my server(s). I&#8217;ve touched on google_authenticator and pam_yubico for authentication in a previous post however I will &#8230; <a
href="http://www.whmcr.com/2011/12/06/yubikey-and-server-authentication/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>After starting to use the Yubikey for LastPass and various other online servers I&#8217;ve started also using my yubikey for SSH access to my server(s).</p><p>I&#8217;ve touched on google_authenticator and pam_yubico for authentication in a previous post however I will be going into this in a bit more detail.</p><p>Taking a machine at home as an example. My requirements are simple</p><li>NO SSH Key access to be allowed &#8211; as there is no way to require a second factor with an SSH Key (Passphrases can be removed or a new key generated)</li><li>Access from Local machines to be allowed without Two Factor being enabled</li><li>Yubikey to be the Primary TFA</li><li>Fall back to google authenticator should either the Yubico servers be down, an issue with my keys or I just don&#8217;t have a USB port available (IE I&#8217;m on a phone or whatever)</li><p>In order to meet these requirements I&#8217;m going to need the following</p><li><a
href="https://github.com/Yubico/yubico-pam">yubico-pam Yubikey PAM</a></li><li><a
href="http://code.google.com/p/google-authenticator/">Google Authenticator PAM</a></li><li>pam_access</li><p>The server is running Archlinux, and luckily all of these are within AUR &#8211; and as such I&#8217;m not going to cover the install of the modules.</p><p>In order to restrict SSHd access as above I need the following auth lines  in /etc/pam.d/sshd</p><div
class="my_syntax_box"><span
class="my_syntax_selecall"><a
href="javascript:;" onclick="selectCode(this); return false;">Selec All</a> </span><span
class="my_syntax_Bar">Code:</span><div
class="my_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Check unix password</span>
auth            required        pam_unix.so try_first_pass
<span style="color: #666666; font-style: italic;"># check to see if the User/IP combo is on the skip list - if so, skip the next two lines</span>
auth            <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">success</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">default</span>=ignore<span style="color: #7a0874; font-weight: bold;">&#93;</span> pam_access.so <span style="color: #007800;">accessfile</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>security<span style="color: #000000; font-weight: bold;">/</span>access_yubico.conf
<span style="color: #666666; font-style: italic;"># Check /etc/yubikey for the users yubikey and skip the next line if it all works</span>
auth            <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">success</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">default</span>=ignore <span style="color: #7a0874; font-weight: bold;">&#93;</span>     pam_yubico.so <span style="color: #007800;">id</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">url</span>=https:<span style="color: #000000; font-weight: bold;">//</span>api.yubico.com<span style="color: #000000; font-weight: bold;">/</span>wsapi<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.0</span><span style="color: #000000; font-weight: bold;">/</span>verify?<span style="color: #007800;">id</span>=<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">otp</span>=<span style="color: #000000; font-weight: bold;">%</span>s <span style="color: #007800;">authfile</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>yubikey
<span style="color: #666666; font-style: italic;"># Check against google authenticator</span>
auth            required        pam_google_authenticator.so
auth            required        pam_env.so</pre></div></div></div><p>The next step is ensure that the relevant users and IP are listed in /etc/security/access_yubico.conf</p><pre source="bash">
# Allow welby from 1.2.3.4
+ : welby : 1.2.3.4
# Deny all others
- : ALL : ALL
</pre><p>After this is setup we will also need to setup the yubikey file /etc/yubikey</p><div
class="my_syntax_box"><span
class="my_syntax_selecall"><a
href="javascript:;" onclick="selectCode(this); return false;">Selec All</a> </span><span
class="my_syntax_Bar">Code:</span><div
class="my_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">welby:ccccccdddddd:cccccccccccc</pre></div></div></div><p>I&#8217;m not going to cover configuration of google authenticator with the google-authenticator command</p><p>The final changes are to the /etc/ssh/sshd_config ensuring that the following are set</p><pre>
PasswordAuthentication no
PubkeyAuthentication no
PermitRootLogin no
ChallengeResponseAuthentication yes
UsePAM yes
</pre>]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2011/12/06/yubikey-and-server-authentication/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>PAM and Two Factor authentication</title><link>http://www.whmcr.com/2011/11/14/pam-and-two-factor-authentication/</link> <comments>http://www.whmcr.com/2011/11/14/pam-and-two-factor-authentication/#comments</comments> <pubDate>Mon, 14 Nov 2011 21:33:24 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Projects]]></category><guid
isPermaLink="false">http://www.whmcr.com/?p=262</guid> <description><![CDATA[As the need for Two factor authentication is a requirement for PCI-DSS (Payment Card Industry standard) and SSH Key with password is not always deemed to be an acceptable form of Two factor authorisation there is now a surge in &#8230; <a
href="http://www.whmcr.com/2011/11/14/pam-and-two-factor-authentication/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>As the need for Two factor authentication is a requirement for PCI-DSS (Payment Card Industry standard) and SSH Key with password is not always deemed to be an acceptable form of Two factor authorisation there is now a surge in different forms of two factor auth, all with their own pros and cons.</p><p>For a small business or &#8216;Prosumer&#8217; (professional consumers) the market incumbent (RSA) is not a viable option due to the price of the tokens and the software / appliance that is required. There are cheaper (or free!) alternatives for which two that I&#8217;ve used at Google Authenticator, and Yubikey.</p><p>Google Authenticator is an OATH-TOTP system that much like RSA generates a one time password once every 30 seconds. It&#8217;s avaiable as an App for the Big three mobile platforms (iOS, Android and Blackberry).</p><p>Yubikey is a hardware token that emulates a USB keyboard, that when the button is pressed, generates a one time password. This is supported by services such as lastpass.</p><p>Both solutions have the ability to be used with their own PAM modules. Installation of either is simple, but what happens if you want to use both, but only require one of these.</p><p>Luckily PAM makes it quite easy !</p><div
class="my_syntax_box"><span
class="my_syntax_selecall"><a
href="javascript:;" onclick="selectCode(this); return false;">Selec All</a> </span><span
class="my_syntax_Bar">Code:</span><div
class="my_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">auth            required        pam_unix.so try_first_pass
auth            <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">success</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">default</span>=ignore <span style="color: #7a0874; font-weight: bold;">&#93;</span>     pam_yubico.so <span style="color: #007800;">id</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">url</span>=https:<span style="color: #000000; font-weight: bold;">//</span>api.yubico.com<span style="color: #000000; font-weight: bold;">/</span>wsapi<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.0</span><span style="color: #000000; font-weight: bold;">/</span>verify?<span style="color: #007800;">id</span>=<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">otp</span>=<span style="color: #000000; font-weight: bold;">%</span>s
auth            required        pam_google_authenticator.so</pre></div></div></div><p>In the above example the user must enter a password and then provide either their yubikey or their google_authenticator.</p><p>Should the password be incorrect the user will still be prompted for their yubikey or google authenticator, but will then fail. Should they provide a password and then their yubikey, they will not be asked for their google authenticator. Should they provide password and not a yubikey, they will be prompted for their google authenticator!</p> ]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2011/11/14/pam-and-two-factor-authentication/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Auditd logging all commands</title><link>http://www.whmcr.com/2011/10/14/auditd-logging-all-commands/</link> <comments>http://www.whmcr.com/2011/10/14/auditd-logging-all-commands/#comments</comments> <pubDate>Fri, 14 Oct 2011 19:58:39 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Uncategorized]]></category><guid
isPermaLink="false">http://www.whmcr.com/?p=251</guid> <description><![CDATA[A common requirement for PCI-DSS is for all commands run by a user who has admin privileges to be logged. There are many ways to do this, most of the time people will opt for a change to the bash &#8230; <a
href="http://www.whmcr.com/2011/10/14/auditd-logging-all-commands/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>A common requirement for PCI-DSS is for all commands run by a user who has admin privileges to be logged. There are many ways to do this, most of the time people will opt for a change to the bash configuration or to rely on sudo. There are many ways arround this (such as providing the command that you wish to run as a paramater to SSH). As the linux kernel provides a full auditing system. Using a utility such as auditd, we are able to log all commands that are run. The configuration for this is actually quite simple. In /etc/audit/audit.rules we need to ensure that the following exists.<br
/> <code><br
/> -a exit,always -F arch=b64 -S execve<br
/> -a exit,always -F arch=b32 -S execve<br
/> </code><br
/> This will capture any execve system call (on exit) and will log this to the auditd log. A log entry will look similar to below.<br
/> <code><br
/> type=SYSCALL msg=audit(1318930500.123:3020171): arch=c000003e syscall=59 success=yes exit=0 a0=7fff65179def a1=7fff65179ec0 a2=7fff6517d060 a3=7ff54ee36c00 items=3 ppid=9200 pid=9202 auid=0 uid=1000 gid=100 euid=1000 suid=1000 fsuid=1000 egid=100 sgid=100 fsgid=100 tty=(none) ses=4 comm="xscreensaver-ge" exe="/usr/bin/perl" key=(null)<br
/> type=EXECVE msg=audit(1318930500.123:3020171): argc=5 a0="/usr/bin/perl" a1="-w" a2="/usr/bin/xscreensaver-getimage-file" a3="--name" a4="/home/welby/Pictures"<br
/> type=EXECVE msg=audit(1318930500.123:3020171): argc=3 a0="/usr/bin/perl" a1="-w" a2="/usr/bin/xscreensaver-getimage-file"<br
/> type=CWD msg=audit(1318930500.123:3020171):  cwd="/home/welby/Downloads"<br
/> type=PATH msg=audit(1318930500.123:3020171): item=0 name="/usr/bin/xscreensaver-getimage-file" inode=208346 dev=fe:02 mode=0100755 ouid=0 ogid=0 rdev=00:00<br
/> type=PATH msg=audit(1318930500.123:3020171): item=1 name=(null) inode=200983 dev=fe:02 mode=0100755 ouid=0 ogid=0 rdev=00:00<br
/> type=PATH msg=audit(1318930500.123:3020171): item=2 name=(null) inode=46 dev=fe:02 mode=0100755 ouid=0 ogid=0 rdev=00:00<br
/> </code><br
/> This should keep most auditors happy <img
src='http://www.whmcr.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2011/10/14/auditd-logging-all-commands/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Moving part of an lvm vg from one pv to another</title><link>http://www.whmcr.com/2011/06/21/moving-part-of-an-lvm-vg-from-one-pv-to-another/</link> <comments>http://www.whmcr.com/2011/06/21/moving-part-of-an-lvm-vg-from-one-pv-to-another/#comments</comments> <pubDate>Tue, 21 Jun 2011 19:57:00 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Uncategorized]]></category><guid
isPermaLink="false">http://www.whmcr.com/?p=231</guid> <description><![CDATA[Lets say that you’ve got multiple physical volumes (PV) in a Volume Group (VG) and you want to migrate the extents from one PV to another, this can be acomplished with a quick and easy pvmove command. For example pvdisplay &#8230; <a
href="http://www.whmcr.com/2011/06/21/moving-part-of-an-lvm-vg-from-one-pv-to-another/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Lets say that you’ve got multiple physical volumes (PV) in a Volume Group (VG) and you want to migrate the extents from one PV to another, this can be acomplished with a quick and easy pvmove command.</p><p>For example<br
/> <code><br
/> pvdisplay -m<br
/> --- Physical volume ---<br
/> PV Name               /dev/sdb1<br
/> VG Name               INTEL_RAID<br
/> PV Size               2.73 TiB / not usable 4.00 MiB<br
/> Allocatable           yes (but full)<br
/> PE Size               4.00 MiB<br
/> Total PE              714539<br
/> Free PE               0<br
/> Allocated PE          714539<br
/> PV UUID               XWiRzE-Ol3d-38En-ND6b-qo93-4zeF-xv8zDv</p><p> --- Physical Segments ---<br
/> Physical extent 0 to 604876:<br
/> Logical volume	/dev/INTEL_RAID/MEDIA<br
/> Logical extents	0 to 604876<br
/> Physical extent 604877 to 617676:<br
/> Logical volume	/dev/INTEL_RAID/backups_mimage_0<br
/> Logical extents	25600 to 38399<br
/> Physical extent 617677 to 617701:<br
/> Logical volume	/dev/INTEL_RAID/EPG<br
/> Logical extents	0 to 24<br
/> Physical extent 617702 to 643301:<br
/> Logical volume	/dev/INTEL_RAID/backups_mimage_0<br
/> Logical extents	0 to 25599<br
/> Physical extent 643302 to 714538:<br
/> Logical volume	/dev/INTEL_RAID/MEDIA<br
/> Logical extents	604877 to 676113</p><p> --- Physical volume ---<br
/> PV Name               /dev/sdc1<br
/> VG Name               INTEL_RAID<br
/> PV Size               2.04 TiB / not usable 2.00 MiB<br
/> Allocatable           yes<br
/> PE Size               4.00 MiB<br
/> Total PE              535726<br
/> Free PE               430323<br
/> Allocated PE          105403<br
/> PV UUID               laOuKy-5FZa-cJ3h-JffV-qUub-diKC-O0wVqK</p><p> --- Physical Segments ---<br
/> Physical extent 0 to 25599:<br
/> Logical volume	/dev/INTEL_RAID/backups_mimage_1<br
/> Logical extents	0 to 25599<br
/> Physical extent 25600 to 54202:<br
/> Logical volume	/dev/INTEL_RAID/MEDIA<br
/> Logical extents	676114 to 704716<br
/> Physical extent 54203 to 67002:<br
/> Logical volume	/dev/INTEL_RAID/NZB_DOWNLOAD<br
/> Logical extents	0 to 12799<br
/> Physical extent 67003 to 79802:<br
/> Logical volume	/dev/INTEL_RAID/backups_mimage_1<br
/> Logical extents	25600 to 38399<br
/> Physical extent 79803 to 105402:<br
/> Logical volume	/dev/INTEL_RAID/OLD_VM<br
/> Logical extents	0 to 25599<br
/> Physical extent 105403 to 535725:<br
/> FREE<br
/> </code><br
/> From here you can see that /dev/INTEL_RAID/MEDIA is a Logical Volume (LV) on both PVs within the VG. If I was wanting to grow my mirrored LV, which requires space on both PVs, I’d have to migrate some of the extents of another LV. If I wanted to move some of the MEDIA lv, I should be able to do the following<br
/> <code><br
/> pvmove /dev/sdb:643302-714538 /dev/sdc<br
/> </code><br
/> This will move extents 643302-714538 to the next contiguious block on /dev/sdc</p> ]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2011/06/21/moving-part-of-an-lvm-vg-from-one-pv-to-another/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Dahdi In LXC</title><link>http://www.whmcr.com/2011/06/18/dahdi-in-lxc/</link> <comments>http://www.whmcr.com/2011/06/18/dahdi-in-lxc/#comments</comments> <pubDate>Sat, 18 Jun 2011 19:50:20 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Uncategorized]]></category><guid
isPermaLink="false">http://www.whmcr.com/?p=191</guid> <description><![CDATA[At home we use various VoIP providers to either get free calls to various places (GTalk/GVoice to america for instance) and various other destinations over SIP providers I’ve been using Asterisk for years (I remeber the 0.7 release) and have &#8230; <a
href="http://www.whmcr.com/2011/06/18/dahdi-in-lxc/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>At home we use various VoIP providers to either get free calls to various places (GTalk/GVoice to america for instance) and various other destinations over SIP providers</p><p>I’ve been using Asterisk for years (I remeber the 0.7 release) and have implemented it for companies before, usually with no issues, baring the continuall deadlocks in the 1.2 range. Recently I enabled my VoIP network segment for IPv6 only to find that GTalk stoped working on IPV6 Day. After a bit of digging about, it seems that Asterisk 1.8 does support IPV6! But, gtalk and similar are not supported, SIP is infact the only first class citezen it seems.</p><p>I’ve toyed with using freeswitch before, but unfortuantly have had varied sucsess with FreeTDM to Dahdi with BT caller ID and the likes. I did hack in support for it, but I’m not too sure if I trust my code, as my C is quite rusty to say the least.</p><p>I did however come up with another solution!</p><p>As I’m running a moderatly new Linux Kernel I can use LXC &#8211; Linux Containers &#8211; which are effectilvy the same idea as a wpar, chroot, openvz, whatever. After setting up asterisk in the LXC I needed to expose my Dahdi card to it. LXC allows you to restrict access on a per device basis. I’ve setup Dahdi on the host machine as normal so the kernel modules can be loaded etc. Once this is done I’ve preformed the following within the LXC<br
/> <code><br
/> cd /<br
/> mkdir dev/dahdi<br
/> mknod dev/dahdi/1 c 196 1<br
/> mknod dev/dahdi/2 c 196 2<br
/> mknod dev/dahdi/3 c 196 3<br
/> mknod dev/dahdi/4 c 196 4<br
/> mknod dev/dahdi/channel c 196 254<br
/> mknod dev/dahdi/ctl c 196 0<br
/> mknod dev/dahdi/pseudo c 196 255<br
/> mknod dev/dahdi/timer c 196 253<br
/> mknod dev/dahdi/transcode c 196 250<br
/> </code><br
/> This creates the Device nodes within /dev/ for my 4 dahdi channels (3FXS 1FXO if anyone is interested). After this I’ve added the following to the lxc config file, to allow the LXC to have access to these devices</p><p><code><br
/> # If you want to be lazy just add this line<br
/> #lxc.cgroup.devices.allow = c 196:* rwm</p><p>#Otherwise use the following<br
/> lxc.cgroup.devices.allow = c 196:0 rwm<br
/> lxc.cgroup.devices.allow = c 196:1 rwm<br
/> lxc.cgroup.devices.allow = c 196:2 rwm<br
/> lxc.cgroup.devices.allow = c 196:3 rwm<br
/> lxc.cgroup.devices.allow = c 196:4 rwm<br
/> lxc.cgroup.devices.allow = c 196:250 rwm<br
/> lxc.cgroup.devices.allow = c 196:253 rwm<br
/> lxc.cgroup.devices.allow = c 196:254 rwm<br
/> lxc.cgroup.devices.allow = c 196:255 rwm<br
/> </code><br
/> This will obviously only work for the first 4 dahdi channels, but if you need more, just continue adding the 196:x lines, replacing x with the channel number, and also ensuring that you create the device nodes in the same way</p> ]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2011/06/18/dahdi-in-lxc/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>A quick (and quite unscientific!) break down of Rackspace CloudFiles UK vs Amazon S3 (Ireland)</title><link>http://www.whmcr.com/2011/01/16/a-quick-and-quite-unscientific-break-down-of-rackspace-cloudfiles-uk-vs-amazon-s3-ireland/</link> <comments>http://www.whmcr.com/2011/01/16/a-quick-and-quite-unscientific-break-down-of-rackspace-cloudfiles-uk-vs-amazon-s3-ireland/#comments</comments> <pubDate>Sun, 16 Jan 2011 16:06:14 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Projects]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Uncategorized]]></category><guid
isPermaLink="false">http://www.whmcr.com/?p=152</guid> <description><![CDATA[(Disclaimer &#8211; I&#8217;m a Rackspace Employee, the postings on this site are my own, may be bias, and don&#8217;t necessarily represent Rackspace&#8217;s positions, strategies or opinions. These tests have been preformed independently from my employer by my self) As Rackspace &#8230; <a
href="http://www.whmcr.com/2011/01/16/a-quick-and-quite-unscientific-break-down-of-rackspace-cloudfiles-uk-vs-amazon-s3-ireland/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>(Disclaimer &#8211; I&#8217;m a Rackspace Employee, the postings on this site are my own, may be bias, and don&#8217;t necessarily represent Rackspace&#8217;s positions, strategies or opinions. These tests have been preformed independently from my employer by my self)</p><p>As Rackspace have recently launched a &#8216;beta&#8217; Cloudfiles service within the UK I thought I would run a few tests to compare it to Amazon&#8217;s S3 service running from Eire (or Southern Ireland).</p><p>I took a set of files, totalling 18.7GB, with file sizes ranging from between 1kb and 25MB, text files, and contents being mainly Photos (both JPEG and RAW (cannon and nikon), plain text files, GZiped Tarballs and a few Microsoft Word documents just for good measure.</p><p>The following python scripts were used:</p><p><strong>Cloud Files</strong><br
/> Upload</p><div
class="my_syntax_box"><span
class="my_syntax_selecall"><a
href="javascript:;" onclick="selectCode(this); return false;">Selec All</a> </span><span
class="my_syntax_Bar">Code:</span><div
class="my_syntax"><div
class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> cloudfiles
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">os</span>
&nbsp;
api_username<span style="color: #66cc66;">=</span><span style="color: #483d8b;">&quot;USERNAME&quot;</span>
api_key<span style="color: #66cc66;">=</span><span style="color: #483d8b;">&quot;KEY&quot;</span>
auth_url<span style="color: #66cc66;">=</span><span style="color: #483d8b;">&quot;https://lon.auth.api.rackspacecloud.com/v1.0&quot;</span>
dest_container<span style="color: #66cc66;">=</span><span style="color: #483d8b;">&quot;CONTAINER&quot;</span>
local_file_list <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span>.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
cf <span style="color: #66cc66;">=</span> cloudfiles.<span style="color: black;">get_connection</span><span style="color: black;">&#40;</span>api_username<span style="color: #66cc66;">,</span> api_key<span style="color: #66cc66;">,</span> authurl<span style="color: #66cc66;">=</span>auth_url<span style="color: black;">&#41;</span>
containers <span style="color: #66cc66;">=</span> cf.<span style="color: black;">get_all_containers</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> container <span style="color: #ff7700;font-weight:bold;">in</span> containers:
    <span style="color: #ff7700;font-weight:bold;">if</span> container.<span style="color: black;">name</span> <span style="color: #66cc66;">==</span> dest_container:
            backup_container <span style="color: #66cc66;">=</span> container
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> upload_cf<span style="color: black;">&#40;</span>local_file<span style="color: black;">&#41;</span>:
    u <span style="color: #66cc66;">=</span> backup_container.<span style="color: black;">create_object</span><span style="color: black;">&#40;</span>local_file<span style="color: black;">&#41;</span>
    u.<span style="color: black;">load_from_filename</span><span style="color: black;">&#40;</span>local_file<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> local_file <span style="color: #ff7700;font-weight:bold;">in</span> local_file_list:
        local_file <span style="color: #66cc66;">=</span> local_file.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        local_file_size <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">os</span>.<span style="color: #dc143c;">stat</span><span style="color: black;">&#40;</span>local_file<span style="color: black;">&#41;</span>.<span style="color: black;">st_size</span>/<span style="color: #ff4500;">1024</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;uploading %s (%dK)&quot;</span> % <span style="color: black;">&#40;</span>local_file<span style="color: #66cc66;">,</span> local_file_size<span style="color: black;">&#41;</span>
        upload_cf<span style="color: black;">&#40;</span>local_file<span style="color: black;">&#41;</span></pre></div></div></div><p>Download</p><div
class="my_syntax_box"><span
class="my_syntax_selecall"><a
href="javascript:;" onclick="selectCode(this); return false;">Selec All</a> </span><span
class="my_syntax_Bar">Code:</span><div
class="my_syntax"><div
class="code"><pre class="python" style="font-family:monospace;">api_username<span style="color: #66cc66;">=</span><span style="color: #483d8b;">&quot;USERNAME&quot;</span>
api_key<span style="color: #66cc66;">=</span><span style="color: #483d8b;">&quot;KEY&quot;</span>
auth_url<span style="color: #66cc66;">=</span><span style="color: #483d8b;">&quot;https://lon.auth.api.rackspacecloud.com/v1.0&quot;</span>
dest_container<span style="color: #66cc66;">=</span><span style="color: #483d8b;">&quot;CONTAINER&quot;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> cloudfiles
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">os</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Setup the connection</span>
cf <span style="color: #66cc66;">=</span> cloudfiles.<span style="color: black;">get_connection</span><span style="color: black;">&#40;</span>api_username<span style="color: #66cc66;">,</span> api_key<span style="color: #66cc66;">,</span> authurl<span style="color: #66cc66;">=</span>auth_url<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Get a list of containers</span>
containers <span style="color: #66cc66;">=</span> cf.<span style="color: black;">get_all_containers</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Lets setup the container</span>
<span style="color: #ff7700;font-weight:bold;">for</span> container <span style="color: #ff7700;font-weight:bold;">in</span> containers:
    <span style="color: #ff7700;font-weight:bold;">if</span> container.<span style="color: black;">name</span> <span style="color: #66cc66;">==</span> dest_container:
            backup_container <span style="color: #66cc66;">=</span> container
&nbsp;
<span style="color: #808080; font-style: italic;">#Create the container if it does not exsit</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:
    backup_container
<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">NameError</span>:
    backup_container <span style="color: #66cc66;">=</span> cf.<span style="color: black;">create_container</span><span style="color: black;">&#40;</span>dest_container<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># We've now got our container, lets get a file list</span>
<span style="color: #ff7700;font-weight:bold;">def</span> build_remote_file_list<span style="color: black;">&#40;</span>container<span style="color: black;">&#41;</span>:
    remote_file_list <span style="color: #66cc66;">=</span> container.<span style="color: black;">list_objects_info</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> remote_file <span style="color: #ff7700;font-weight:bold;">in</span> remote_file_list:
        f <span style="color: #66cc66;">=</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>remote_file<span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span>
        rf <span style="color: #66cc66;">=</span> container.<span style="color: black;">get_object</span><span style="color: black;">&#40;</span>remote_file<span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> remote_file<span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">chunk</span> <span style="color: #ff7700;font-weight:bold;">in</span> rf.<span style="color: black;">stream</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
            f.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">chunk</span><span style="color: black;">&#41;</span>
        f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
remote_file_list <span style="color: #66cc66;">=</span> build_remote_file_list<span style="color: black;">&#40;</span>backup_container<span style="color: black;">&#41;</span></pre></div></div></div><p><strong>s3</strong><br
/> Upload</p><div
class="my_syntax_box"><span
class="my_syntax_selecall"><a
href="javascript:;" onclick="selectCode(this); return false;">Selec All</a> </span><span
class="my_syntax_Bar">Code:</span><div
class="my_syntax"><div
class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> boto.<span style="color: black;">s3</span>.<span style="color: black;">connection</span> <span style="color: #ff7700;font-weight:bold;">import</span> S3Connection
<span style="color: #ff7700;font-weight:bold;">from</span> boto.<span style="color: black;">s3</span>.<span style="color: black;">key</span> <span style="color: #ff7700;font-weight:bold;">import</span> Key
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">os</span>
&nbsp;
dest_container <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;CONTAINER&quot;</span>
&nbsp;
s3 <span style="color: #66cc66;">=</span> S3Connection<span style="color: black;">&#40;</span><span style="color: #483d8b;">'api'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'api_secret'</span><span style="color: black;">&#41;</span>
&nbsp;
buckets <span style="color: #66cc66;">=</span> s3.<span style="color: black;">get_all_buckets</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> container <span style="color: #ff7700;font-weight:bold;">in</span> buckets:
    <span style="color: #ff7700;font-weight:bold;">if</span> container.<span style="color: black;">name</span> <span style="color: #66cc66;">==</span> dest_container:
                backup_container <span style="color: #66cc66;">=</span> container
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> build_remote_file_list<span style="color: black;">&#40;</span>container<span style="color: black;">&#41;</span>:
    remote_file_list <span style="color: #66cc66;">=</span> container.<span style="color: #008000;">list</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> remote_file <span style="color: #ff7700;font-weight:bold;">in</span> remote_file_list:
        <span style="color: #ff7700;font-weight:bold;">print</span> remote_file
        f <span style="color: #66cc66;">=</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>remote_file<span style="color: #66cc66;">,</span><span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span>
        rf <span style="color: #66cc66;">=</span> container.<span style="color: black;">get_key</span><span style="color: black;">&#40;</span>remote_file<span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;">#print remote_file['name'</span>
        rf.<span style="color: black;">get_file</span><span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span>
        f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
local_file_list <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span>.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> upload_s3<span style="color: black;">&#40;</span>local_file<span style="color: black;">&#41;</span>:
    k <span style="color: #66cc66;">=</span> Key<span style="color: black;">&#40;</span>backup_container<span style="color: black;">&#41;</span>
    k.<span style="color: black;">key</span> <span style="color: #66cc66;">=</span> local_file
    k.<span style="color: black;">set_contents_from_filename</span><span style="color: black;">&#40;</span>local_file<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> local_file <span style="color: #ff7700;font-weight:bold;">in</span> local_file_list:
        local_file <span style="color: #66cc66;">=</span> local_file.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        local_file_size <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">os</span>.<span style="color: #dc143c;">stat</span><span style="color: black;">&#40;</span>local_file<span style="color: black;">&#41;</span>.<span style="color: black;">st_size</span>/<span style="color: #ff4500;">1024</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;uploading %s (%dK)&quot;</span> % <span style="color: black;">&#40;</span>local_file<span style="color: #66cc66;">,</span> local_file_size<span style="color: black;">&#41;</span>
        upload_s3<span style="color: black;">&#40;</span>local_file<span style="color: black;">&#41;</span></pre></div></div></div><p>Download</p><div
class="my_syntax_box"><span
class="my_syntax_selecall"><a
href="javascript:;" onclick="selectCode(this); return false;">Selec All</a> </span><span
class="my_syntax_Bar">Code:</span><div
class="my_syntax"><div
class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> boto.<span style="color: black;">s3</span>.<span style="color: black;">connection</span> <span style="color: #ff7700;font-weight:bold;">import</span> S3Connection
<span style="color: #ff7700;font-weight:bold;">from</span> boto.<span style="color: black;">s3</span>.<span style="color: black;">key</span> <span style="color: #ff7700;font-weight:bold;">import</span> Key
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">os</span>
&nbsp;
dest_container <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;CONTAINER&quot;</span>
&nbsp;
s3 <span style="color: #66cc66;">=</span> S3Connection<span style="color: black;">&#40;</span><span style="color: #483d8b;">'api'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'apt_secret'</span><span style="color: black;">&#41;</span>
&nbsp;
buckets <span style="color: #66cc66;">=</span> s3.<span style="color: black;">get_all_buckets</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> container <span style="color: #ff7700;font-weight:bold;">in</span> buckets:
    <span style="color: #ff7700;font-weight:bold;">if</span> container.<span style="color: black;">name</span> <span style="color: #66cc66;">==</span> dest_container:
                backup_container <span style="color: #66cc66;">=</span> container
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> build_remote_file_list<span style="color: black;">&#40;</span>container<span style="color: black;">&#41;</span>:
    remote_file_list <span style="color: #66cc66;">=</span> container.<span style="color: #008000;">list</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> remote_file <span style="color: #ff7700;font-weight:bold;">in</span> remote_file_list:
        <span style="color: #ff7700;font-weight:bold;">print</span> remote_file.<span style="color: black;">name</span>
        f <span style="color: #66cc66;">=</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>remote_file.<span style="color: black;">name</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span>
        rf <span style="color: #66cc66;">=</span> container.<span style="color: black;">get_key</span><span style="color: black;">&#40;</span>remote_file.<span style="color: black;">name</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;">#print remote_file['name'</span>
        rf.<span style="color: black;">get_file</span><span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span>
        f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
remote_file_list <span style="color: #66cc66;">=</span> build_remote_file_list<span style="color: black;">&#40;</span>backup_container<span style="color: black;">&#41;</span></pre></div></div></div><p>The test was preformed from a Linux host which has a 100MBit connection (Uncapped/unthrottled) in London, however the test was also preformed with almost identical results from a machine in Paris (also 100mbit). Tests were also run from other locations (Dallas Fort Worth &#8211; Texas, my home ISP (bethere.co.uk)) however these locations were limited to 25mbit and 24mbit , and both reached their maximum speeds.  The tests were as follows:</p><li>Download files from Rackspace Cloudfiles UK (these had been uploaded previously) &#8211; This is downloaded directly via the API, NOT via a CDN</li><li>Upload the same files to S3 Ireland</li><li>Upload the same files to a new &#8220;container&#8221; at Rackspace Cloudfiles UK</li><li>Download the files from S3 Ireland &#8211; This is downloaded directly via the API, NOT via a CDN</li><p> The average speeds for the tests are as follows:<br
/> <strong>Cloudfiles</strong><br
/> Download: 90Mbit/s<br
/> Upload: 85MBit/s<br
/> <strong>S3 Ireland</strong><br
/> Download: ~40Mbit/s<br
/> Upload : 13Mbit/s</p><p>Observations</p><li>Cloud files seems to be able to max out a 100mbit connection for both File</li><li>S3 seems to have a cap of 13mbit for inbound file transfers?</li><li>S3 seems to either be extremely unpredictable on file transfer speeds for downloading files via the API, or there is some form of cap after a certain amount of data transferred,  or there was congestion on the AWS network</li><p> Below is a graph showing the different connection speeds achieved using CF &#038; S3<br
/> <a
href="http://www.whmcr.com/wp-content/uploads/2011/01/cf-s3.png"><img
src="http://www.whmcr.com/wp-content/uploads/2011/01/cf-s3.png" alt="" title="Cloudfiles UK &amp; Amazon S3-EU" width="491" height="275" class="alignnone size-full wp-image-157" /></a></p><p>As mentioned before this is a very unscientific test (and I’d say that these results have not been replicated from as many locations or as many times as I’d like to, so I would take them with a pinch of salt) , but it does appear that Rackspace cloudfiles UK is noticeably faster than S3 Ireland</p> ]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2011/01/16/a-quick-and-quite-unscientific-break-down-of-rackspace-cloudfiles-uk-vs-amazon-s3-ireland/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>iPhone to Android SMS Converstion Script</title><link>http://www.whmcr.com/2010/05/25/iphone-to-android-sms-converstion-script/</link> <comments>http://www.whmcr.com/2010/05/25/iphone-to-android-sms-converstion-script/#comments</comments> <pubDate>Tue, 25 May 2010 10:56:29 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Android]]></category> <category><![CDATA[Apple]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[iPhone]]></category> <category><![CDATA[Andorid]]></category> <category><![CDATA[Linux]]></category><guid
isPermaLink="false">http://www.whmcr.com/?p=134</guid> <description><![CDATA[As promised here&#8217;s a copy of my iPhone to Android script. Just a quick and dirty python script that reads in a backup from itunes and converts it to a bit of XML able to be read in by SMS Backup and &#8230; <a
href="http://www.whmcr.com/2010/05/25/iphone-to-android-sms-converstion-script/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>As promised here&#8217;s a copy of my iPhone to Android script. Just a quick and dirty python script that reads in a backup from itunes and converts it to a bit of XML able to be read in by SMS Backup and Restore on the android platform</p><div
class="my_syntax_box"><span
class="my_syntax_selecall"><a
href="javascript:;" onclick="selectCode(this); return false;">Selec All</a> </span><span
class="my_syntax_Bar">Code:</span><div
class="my_syntax"><div
class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> sqlite3 <span style="color: #ff7700;font-weight:bold;">import</span> *
<span style="color: #ff7700;font-weight:bold;">from</span> sqlite3 <span style="color: #ff7700;font-weight:bold;">import</span> *
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">xml</span>.<span style="color: black;">sax</span>.<span style="color: black;">saxutils</span> <span style="color: #ff7700;font-weight:bold;">import</span> escape
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">codecs</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
f <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">codecs</span>.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'sms.xml'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'w'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'utf-8'</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">write</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'''&lt; ?xml version='1.0' encoding='UTF-8' standalone='yes' ?&gt;
&lt;smses&gt;
'''</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;"># This is 31bb7ba8914766d4ba40d6dfb6113c8b614be442.mddata or 31bb7ba8914766d4ba40d6dfb6113c8b614be442.mdbackup usally</span>
c <span style="color: #66cc66;">=</span> connect<span style="color: black;">&#40;</span><span style="color: #483d8b;">'sms.db'</span><span style="color: black;">&#41;</span>
curs <span style="color: #66cc66;">=</span> c.<span style="color: black;">cursor</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
curs.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'''SELECT address,date,text,flags FROM message WHERE flags &amp;lt;5 ORDER BY date asc'''</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> row <span style="color: #ff7700;font-weight:bold;">in</span> curs:
        a<span style="color: #66cc66;">=</span> escape<span style="color: black;">&#40;</span><span style="color: #008000;">unicode</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        d <span style="color: #66cc66;">=</span> escape<span style="color: black;">&#40;</span><span style="color: #008000;">unicode</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        t <span style="color: #66cc66;">=</span> row<span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span>-<span style="color: #ff4500;">1</span>
        t <span style="color: #66cc66;">=</span> <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>t<span style="color: black;">&#41;</span>
        b <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">re</span>.<span style="color: black;">sub</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&quot;'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">&quot;'&quot;</span><span style="color: #66cc66;">,</span>escape<span style="color: black;">&#40;</span><span style="color: #008000;">unicode</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
        f.<span style="color: black;">write</span><span style="color: black;">&#40;</span> <span style="color: #483d8b;">'&lt;sms protocol=&quot;0&quot; address=&quot;'</span>+a+<span style="color: #483d8b;">'&quot; date=&quot;'</span>+d+<span style="color: #483d8b;">'000&quot; type=&quot;'</span>+t+<span style="color: #483d8b;">'&quot; subject=&quot;null&quot; body=&quot;'</span>+b+<span style="color: #483d8b;">'&quot; toa=&quot;0&quot; sc_toa=&quot;0&quot; service_center=&quot;null&quot; read=&quot;1&quot; status=&quot;-1&quot; /&gt;'</span>+<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>
<span style="color: #483d8b;">'''&lt;/smses&gt;'''</span> <span style="color: black;">&#41;</span></pre></div></div></div>]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2010/05/25/iphone-to-android-sms-converstion-script/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>iPhone to Android</title><link>http://www.whmcr.com/2010/04/16/iphone-to-android/</link> <comments>http://www.whmcr.com/2010/04/16/iphone-to-android/#comments</comments> <pubDate>Fri, 16 Apr 2010 15:41:22 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Apple]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[Software]]></category><guid
isPermaLink="false">http://www.whmcr.com/?p=127</guid> <description><![CDATA[I&#8217;m in the process of migrating from my iPhone 3g to an HTC desire. So far i&#8217;m really impressed with the desire, but a full view on it is reserved for a month or so after I&#8217;ve used it day &#8230; <a
href="http://www.whmcr.com/2010/04/16/iphone-to-android/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;m in the process of migrating from my iPhone 3g to an HTC desire. So far i&#8217;m really impressed with the desire, but a full view on it is reserved for a month or so after I&#8217;ve used it day in day out!</p><p>One thing that I did quite want was to have my SMS messages migrated from my iPhone to the Desire. As the iPhone keeps the SMSes in a SQLite DB this wasn&#8217;t to hard. I&#8217;m going to post the procedure and the script I used later!</p> ]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2010/04/16/iphone-to-android/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Slice</title><link>http://www.whmcr.com/2009/10/08/slice/</link> <comments>http://www.whmcr.com/2009/10/08/slice/#comments</comments> <pubDate>Thu, 08 Oct 2009 16:00:17 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Uncategorized]]></category><guid
isPermaLink="false">http://www.whmcr.com/2009/10/slice/</guid> <description><![CDATA[I&#8217;ve moved this site (and a few others) from its semi-temporary home of one of my NAS boxes (proper x86 machines remember, not any of these silly 200MHz mips devices!) to a Slice at the wonderful slicehosts. I&#8217;d Highly recommend &#8230; <a
href="http://www.whmcr.com/2009/10/08/slice/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve moved this site (and a few others) from its semi-temporary home of one of my NAS boxes (proper x86 machines remember, not any of these silly 200MHz mips devices!) to a Slice at the wonderful slicehosts. I&#8217;d Highly recommend them.</p> ]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2009/10/08/slice/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Subway using Apple&#039;s &quot;There&#039;s an app for that&quot; slogan ?</title><link>http://www.whmcr.com/2009/09/10/subway-using-apples-theres-an-app-for-that-slogan/</link> <comments>http://www.whmcr.com/2009/09/10/subway-using-apples-theres-an-app-for-that-slogan/#comments</comments> <pubDate>Thu, 10 Sep 2009 15:39:01 +0000</pubDate> <dc:creator>welby</dc:creator> <category><![CDATA[Apple]]></category> <category><![CDATA[Non Geeky]]></category> <category><![CDATA[Adverts]]></category> <category><![CDATA[Subway]]></category><guid
isPermaLink="false">http://www.whmcr.com/?p=121</guid> <description><![CDATA[Tagging along at lunch with a few colleagues at work today to the local subway and notice a new set of adverts on the window. It appears that subway are imitating Apple&#8217;s &#8220;there&#8217;s an app for that&#8221;. It turns out &#8230; <a
href="http://www.whmcr.com/2009/09/10/subway-using-apples-theres-an-app-for-that-slogan/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Tagging along at lunch with a few colleagues at work today to the local subway and notice a new set of adverts on the window.<br
/> It appears that subway are imitating Apple&#8217;s &#8220;there&#8217;s an app for that&#8221;. It turns out that this campaign has been done by <a
style="color: #256b7f; padding: 0px; margin: 0px;" href="http://www.mccann.co.uk/" target="_blank">McCann Erickson</a> and is a &#8216;light-hearted&#8217; campaign complete with UK TV adverts. The phrase Imitation is the sincerest form of flattery comes to mind.</p> ]]></content:encoded> <wfw:commentRss>http://www.whmcr.com/2009/09/10/subway-using-apples-theres-an-app-for-that-slogan/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using memcached
Database Caching using memcached
Object Caching 552/692 objects using apc

Served from: whmcr.com @ 2012-05-19 21:03:02 -->
