Showing posts from May, 2013

Backup/Sync Your Photos to Flickr Script

IF YOU JUST WANT TO USE IT PLEASE SKIP TO INSTALL PART If you haven't heard, flickr has made their free storage 1TB for your full size photos. That's a lot of storage for your photos. I have a collection of photos since year 2000, and I have only around 81GB of photos stored to my hard drive and time machine and another backup drive, but those can all fail but I have been lucky not to lose photos from hard drive failures. I was looking for a sync apps to flickr that I can leave alone and I couldn't find one. So here is a quick python script that I created. Here is how it works for backing it up: Let's say you have folder /Volumes/Storage/Pictures/ 2001   / 2001-01-01     / File1.jpg     / File2.jpg 2002 2003 When you run flickrsmartsync it will require you to login give it access then it will sync it automatically, stopping and starting it will just resume it as long as it is in the same structure. So if you sync the same structure under the root folder

Simple Mapper Class for NDB on App Engine

This class is based on the db mapper found in remote_api article. But using ndb, the purpose of this is if you want to iterate through a lot of entities but not enough time to do it on request time. So this library helps you create a map of your entities of given kind. You should use this in cases like, deleting users that requested for deletion or updating counters for specific filters. Here is the NDB version of the Mapper. I have added a bit of improvement that I have used for in the past. -Edit- I have removed the memcache ability to stop duplicates. It should just now be handled with the task scope, like taskname or different filters per task (can be done with different initial data and overriding the get_query method and use it as some filter). import logging from google.appengine.ext import deferred, ndb from google.appengine.runtime import DeadlineExceededError class Mapper(object): def __init__(self, use_cache=False): ndb.get_context().set_cache_policy