Thursday, 18 December 2008

dm-paperclip is a port of Paperclip to Datamapper. It's a pretty straightforward port so most of the Paperclip documentation is valid for dm-paperclip. One of the most attractive features of Paperclip is it's ability to host your files on Amazon S3 instead of locally. Here's how you do it:

You will need 3 extra parameters on your has_attached_file declaration in your model:


has_attached_file :photo,
:storage => :s3,
:s3_credentials => Merb.root / "config" / "s3.yml",
:path => ':attachment/:id/:style.:extension'
validates_attachment_presence :photo
validates_attachment_size :photo, :in => 1..200000

The config/s3.yml file stores your S3 credentials and bucket name. This is very handy because you can have different configs and inheritance, just like database.yml:

development: &defaults
access_key_id: ...
secret_access_key: ...
bucket: project_images_development

production:
<<: *defaults bucket: project_images_production


That's it!

Sunday, 30 November 2008

I updated my iPhone to 2.2 today and was very pleasantly surprised to see that the ability to update all the applications at once has returned.

To upgrade an iPhone that has been jailbroken on version 2.1 to version 2.2:

  • Open up iTunes and plug in your iPhone
  • Sync and backup your iPhone
  • Open up iTunes and click Restore to restore the factory default, this should also ask you to upgrade to 2.2
  • Use QuickPwn to jailbreak your fresh 2.2 install
  • Restore your backup
NOTE: You can also use AptBackup from Cydia to backup your jailbroken apps.


Tethering an iPhone to another device, usually a laptop, is not allowed. AT&T contracts ban the practice (though this is rumoured to be changing soon). However, when you're stuck without a decent WiFi connection, an iPhone tether is a tempting proposition. Sadly, since it is banned, Apple have not made it easy.

Most solutions revolved around something called a SOCKS proxy. A proxy is just an application that runs on the iPhone that the tethered device communicates with in order to retreive data from the web. Despite it's simplicity, there is a major drawback: every application that needs to use the internet must have SOCKS compatibility built in. Many applications do, but the implementations are usually hasily added and tend to be buggy (even Firefox has issues).

If you were lucky enough to acquire the NetShare iPhone application (a SOCKS proxy that was available on the App Store for a very short period before being removed by Apple) you do not need to jailbreak your iPhone to be able to tether a device. However, most people will need to do this. However, this is really easy these days and quite safe. A tool such as QuickPwn will do the job with very little fuss.

Once your iPhone is jailbroken, you have a number of proxy server choices. From the NetShare style 3proxy to the old school SSH server. However, there is a much better solution: PdaNet. This is not a SOCKS proxy, it acts more like a software router, passing all your network traffic over the iPhone's internet connection. This means that your applications don't need to have SOCKS built in.

There are a number of issues with NetShare. Sometimes the DNS setup doesn't work very well (especially using an Ad-Hoc network on a Mac). It will also heavily drain your battery. You will need to plug it in for it to last for any long period (i.e. over an hour). You also have to pay to use it with encrypted websites (i.e. HTTPS) - but there is a way around that. Just visit the link printed at the bottom of the PdaNet screen on the iPhone, pretend to buy the software, but stop when you hit the payment screen. You can then browse any site you want without paying!

However, it's definitely the best tethering solution at the moment. Though you might also like to try solutions like proxifier for making SOCKS proxies easier (and more reliable).


Facebook do not allow group owners with more than 5000 members to message all their members at once. Facebook have made this decision to stop people from acquiring large Facebook groups in order to spam the members. A group with over a million members would be incredibly valuable as there is a very direct and clutter free communication channel with the members.

However, I think that Facebook have missed a trick here. They have been struggling to find a revenue model for a while now and allowing this kind of marketing might give them a stready income stream by charging companies who want access to their group members. For example, say a million people sign up to the 'I Love Sprite' group. Sprite would have no way of sending a message to these users, despite them all having expressly shown their interest in Sprite.

Facebook could charge Sprite to message their users. This fee could also help to pay for decent quality control and to enforce any rules they might have. Facebook is already proficient at rejecting low quality ads (though they do have a inventory problem), this shouldn't be difficult for them.

Saturday, 29 November 2008

A schoolboy mistake from the king of social networks today. They sent me this email:

Please reset your email notification settings

Unfortunately, the settings that control which email notifications get sent to you were lost. We're sorry for the inconvenience.

To reset your email notification settings, go to:

http://www.facebook.com/editaccount.php?notifications

Thanks,
The Facebook Team

Made me chuckle

Friday, 28 November 2008

Donate 2 Date is a website that helps raise money for charity by setting people up on dates. This is not just for celebrities (though you might find one or two), it's for everyone. It's a fantastic way to raise money, no marathons or shaved heads, just a good time with philanthropist.

After you sign up, you're listed in the current auctions. People can come along and bid for a date with you. You are in complete control over who you accept. No need to worry about some weird (but rich) person winning your auction. You can pick the person you most like the look of (if they show suitable generosity to your chosen charity of course!)

Despite being brand new, there have already been a number of bidding wars over some people, reaching into the hundreds of pounds.

You can read more about Donate 2 Date here.