xyzio

Posts Tagged ‘s3

Copy a file from a URL directly to S3 using boto3 and requests

leave a comment »

Copy a file at inUrl directly to a s3 bucket bucketName. ACL is set to public-read and ContentType is maintained from the from URL.

Your AWS credentials must be pre-set.

import boto3
import requests

#Set up boto3 env vars
os.environ['AWS_ACCESS_KEY_ID'] = ''
os.environ['AWS_SECRET_ACCESS_KEY'] = ''
os.environ['AWS_DEFAULT_REGION'] = 'us-west-2'


inUrl = r'file_to_read'
response = requests.get(inUrl)

s3 = boto3.resource('s3')
s3.Bucket(bucketName).put_object(Key='test/file_path.ext', Body=response.content, ACL='public-read',ContentType=response.headers['Content-Type'])

Written by M Kapoor

February 7, 2017 at 2:09 pm

Posted in python

Tagged with ,

Mophie Juice Pack for Samsung Galaxy S3 Review

leave a comment »

I’ve been using the Samsung Galaxy S3 Mophie Juice Pack for about a month with my Samsung Galaxy S3. The Mophie Juice Pack boasts a 2300mAh battery that is slightly larger than the S3’s 2100mAh battery. It comes in white or black and consists of two pieces – a plastic hardshell with a USB port into which you slide the bottom of your S3. The S3’s power port then slides into the Mophie’s USB port. The Mophie USB port acts as a pass-through that charges the Juice Pack and phone battery, and allows USB connectivity to your computer. The 2nd piece slides over the top of the phone and snaps into the bottom. The case covers the whole phone and wraps around the front lip. It does a good job in terms of coverage.

Features
Besides covering the phone, there aren’t many features. There is a set of four white LEDs on the bottom of the case that are activated by a button next to them. Pushing the button lights up the LEDs to show how much charge is left in the Juice Pack. In addition, there is a small on/off switch that turns on or off the phone charging from the Juice Pack. Turning the switch on makes the S3 think that it is plugged into a power outlet and it draws power from the Juice Pack.

In general day to day use, I leave the pack on to conserve my cell phone battery and I can expect the juice pack to last about a day with minimal usage of my phone. Minimal usage means turning off everything and then using wifi on for about 30 minutes spread throughout the day to check my email and general web browsing. This is pretty low considering that the S3 battery will go a full day and still have charge left over.

Fit, Feel, and Finish
Despite the premium price, the Mophie Juice Pack doesn’t have the feel of its $100 price. The plastic feels cheap and gets slippery after extended use. It is difficult to guide the phone into the USB plug and the top doesn’t line up with the bottom along its seams. There isn’t enough space around the headphone jack to plug in headphones with large plugs.

One last thing is that the side buttons are very cheap. The power button on my case was locked inward which forced the phone into a endless reboot cycle after I inserted the phone into the case – I had to rip out the Mophie’s side button with a pair of pliers just to stop the reboot cycle and be able to use my phone. Not what I’d expect for a $100 phone case!

Summary
I am very disappointed by the Mophie Juice Pack. It appears to be a $20 battery covered by a cheap $10 plastic case with 10 cent buttons that sells for $100. The fact that I can’t plug in headphones with large plugs and that the buttons can lock your phone into a endless reboot cycle makes the high price tough to swallow. Especially considering that I can get a 4200mAh battery for $25.

Pros
Protective case that covers the whole phone

Cons
Expensive!
Poor battery life
Not good value for money – cheap construction and bad button design
Other cases available at lower prices with similar capabilities

Broken by design

Top and bottom don’t align!

Written by M Kapoor

June 27, 2013 at 6:51 pm