Twitter

Saturday, December 17, 2011

Devices.com

Devices.com


Backup images or almost anything from iPhone (any iOS) to Amazon S3

Posted: 16 Dec 2011 01:00 PM PST

This guide is for jailbroken iPhone/iPod touch only
I had recently needed a quick and dirty way to backup some of my images and additional content from my jailbroken iPhone 4 to a safe and accessible location. Well, you could always backup through iTunes (or any other USB/WiFi/Bluetooth means available), but being in love with the Amazon web services I decided to utilize some available tools and backup/sync to the Amazon S3.

In order to do so, I had decided to use one of my favorite FREE tools s3cmd from s3tools.

S3cmd is a command line tool for uploading, retrieving and managing data in Amazon S3. It is best suited for power users who don’t fear command line. It is also ideal for scripts, automated backups triggered from cron, etc.”

There are a few prerequisites in order to get this running. You will need the following:

  • Amazon account ( I will not get into details on how to create one, but if interested let me know and I’ll post a detail step-by-step)
  • WiFi connection
  • Computer (Mac/PC/and Linux flavor with command line)
  • SSH Access to iPhone
  • Wget package from Cydia
  • Python from Cydia
  • s3cmd tools from s3tools

So, here’s what worked for me:

The final goal was to be able to create a bucket on S3 and upload/sync some content directly to the new S3 bucket.

    1. Enable SSH access to the iPhone: On your iPhone go to Cydia and search for OpenSSH and install it.

Download OpenSSH on iPhone - Cydia

    1. Still in Cydia, search for wget and install it as well.

Install wget on iPhone - Cydia

    1. Search for Python on Cydia and install that package too.

Install Python on iPhone - Cydia

Now we have the necessary tools on the iDevice and could continue easier from the computer.

    1. Go to your computer and fire up your terminal (Putty on your Win PC).
    2. Find out the iDevice’s IP address and ssh as root into it.

On your device go to: Settings->WiFi. Click on the blue arrow on the selected WiFi network and memorize your IP address. Mine at this time is: 192.168.0.103

SSH as root (your IP will be most likely different):

ssh root@192.168.0.103

The default root password for the iOS is: alpine . At that point you will be at:

/var/root
    1. You now need to download s3cmd by using wget:
wget http://downloads.sourceforge.net/project/s3tools/s3cmd/1.0.1/s3cmd-1.0.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fs3tools%2Ffiles%2FOldFiles%2F&ts=1324066371&use_mirror=cdnetworks-us-2
    1. Unarchive the downloaded software:
tar -zxvf s3cmd-1.0.1.tar.gz

Remove the downloaded archive and rename the new folder:

rm s3cmd-1.0.1.tar.gz
mv s3cmd-1.0.1/ s3cmd
    1. Move into the new folder and fireup s3cmd. First thing we need to do is associate the tool with your existing Amazon S3 credentials:
./s3cmd --configure
Access key and Secret key are your identifiers for Amazon S3
Access Key: YouRAcceSSkEy
Secret Key: YourVeryLoNGSecrEtKey
Encryption password: YourGreatPassw0rd
Path to GPG program [/usr/bin/gpg]: leave empty
Use HTTPS protocol [No]:
HTTP Proxy server name: leave empty
New settings:
Access Key: YouRAcceSSkEy
Secret Key: YourVeryLoNGSecrEtKey+8A0Cs
Encryption password: YourGreatPassw0rd
Path to GPG program: /usr/bin/gpg
Use HTTPS protocol: False
HTTP Proxy server name:
HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n]

Type Y and hit enter to save the configuration. We are now ready to create our bucket on S3 and end some files there.

  1. Create an S3 bucket
./s3cmd mb s3://my-new-S3-bucket
Bucket 's3://my-new-S3-bucket/' created

Now I’m ready to upload some images to my new S3 bucket. The images on my iPhone are located at:

/var/mobile/Media/DCIM/100APPLE

Now I can upload the entire folder to S3:

./s3cmd put --acl-private --guess-mime-type --recursive /var/mobile/Media/DCIM/100APPLE s3://my-new-S3-bucket

The command above will recursively –recursive upload the entire folder to S3, it will automatically set the mime type –guess-mime-type and it will set all files to private –acl-private. If I was to set the flag to –acl-public, all of the images would become public and accessible through http/https.

In order to sync the folder, s3cmd has that option as well which is similar to the Unix rsync:

./s3cmd sync --dry-run --skip-existing --delete-removed /var/mobile/Media/DCIM/101APPLE s3://my-new-S3-bucket
upload: /var/mobile/Media/DCIM/101APPLE/IMG_1002.JPG -> s3://my-new-S3-bucket/101APPLE/IMG_1002.JPG
upload: /var/mobile/Media/DCIM/101APPLE/IMG_1003.JPG -> s3://my-new-S3-bucket/101APPLE/IMG_1003.JPG
upload: /var/mobile/Media/DCIM/101APPLE/IMG_1007.JPG -> s3://my-new-S3-bucket/101APPLE/IMG_1007.JPG
WARNING: Exitting now because of --dry-run

I had used –dry-run to check what will get synced before I run it.

Please feel free to ask any questions. I will follow with automating this and adding it to the Springboard.


Kindle US Power Adapter (Not included with Kindle or Kindle Touch)

Posted: 12 Dec 2011 01:47 PM PST

Kindle US Power Adapter (Not included with Kindle or Kindle Touch)
Price: $9.99 
 



Product Features

  • The United States Kindle power adapter
  • Approved charger for Kindle, Kindle Touch, Kindle Keyboard, and Kindle DX
  • Fully charges Kindle, Kindle Touch, Kindle Keyboard, or Kindle DX in 4 hours or less
  • See Kindle User’s Guide for instructions and important safety information


Kindle Touch, Wi-Fi, 6″ E Ink Display – includes Special Offers & Sponsored Screensavers

Posted: 12 Dec 2011 01:47 PM PST

Kindle Touch, Wi-Fi, 6
Price: $99.00 
 



Product Description

Simple-to-use touchscreen, with audio and built-in Wi-Fi – Most-advanced E Ink display, now with multi-touch – New sleek design – 8% lighter, 11% smaller, holds 3,000 books – Text-to-speech, plus audio books and mp3s – Built in Wi-Fi – Get books in 60 seconds – Massive t book selection, over 800,000 titles are $9.99 or less – New – Borrow Kindle books from your public library


Kindle Fire, Full Color 7″ Multi-touch Display, Wi-Fi

Posted: 12 Dec 2011 01:47 PM PST

Kindle Fire, Full Color 7
Price: $199.00 
 



Product Description

Movies, apps, games, music, reading and more, plus Amazon’s revolutionary cloud-accelerated web browser – 18 million movies, TV shows, songs, magazines and books – Amazon Appstore – thousands of popular apps and games – Ultra-fast web browsing – Amazon Silk – Free cloud storage for all your Amazon content – Vibrant color touchscreen with extra-wide viewing angle – Fast, powerful dual-core processor – Amazon Prime members enjoy unlimited, instant streaming of over 10,000 popular movies and TV shows


0 comments:

Post a Comment