SmugMug Images showing up as a Mac OS X Screen Saver

I have my Mac Mini connected to my computer in my living room and i really wanted a way to have the latest X images from my SmugMug account show up as a screen saver. There are a number of links that show you how to use an RSS Feed as the way to get these images into your screen saver, but you loose a lot of the photo options when they are not local and its really slow to actually start the screen saver. As a result, i wrote a small tool called smugler that just does the following:

1. Takes an RSS Feed from Smugmug
2. Retrieve all photos from Smugmug to a local directory
3. Will make sure to only retrieve the file if its not already in the local directory

Prerequisites:

gem install simple-rss

The script is below:

#!/usr/bin/ruby

require 'rubygems'
require 'simple-rss'
require 'open-uri'

SMUG_FEED = "http://prasadfamily.smugmug.com/hack/feed.mg?Type=nicknameRecentPhotos&Data=prasadfamily&format=rss200&ImageCount=500&Size=XLarge&Paging=0"

DOWNLOAD_DIRECTORY = "/Users/kiranprasad/projects/smugler/photos"

def get_image_name(url)
  url.rpartition("/")[2]
end

def get_and_store(url)
  image_name = get_image_name(url)
  file_path = DOWNLOAD_DIRECTORY + "/" + image_name
  unless (File.exist? file_path)
    puts "Retreving File: #{image_name}"
    File.open(file_path, "wb") do |saved_file|
      open(url, 'rb') do |read_file|
        saved_file.write(read_file.read)
      end
    end
  else
    FileUtils.touch(file_path)
  end
  return true
end

puts "Getting Smug Feed: #{SMUG_FEED}" 

rss = SimpleRSS.parse open(SMUG_FEED)

puts "Found #{rss.items.count} photos"
rss.items.each do |item|
  #puts "Processing File: #{item.guid}"
  get_and_store(item.guid)
end

entries = Dir.entries(DOWNLOAD_DIRECTORY)
if entries.count > 500
  puts "Found more than 500 entries"
  entries = entries.sort_by { |f| -1 * File.mtime(f) }
  to_delete = entries[500, entries.count]
  to_delete.each do |item|
    puts "Deleteing: #{item}"
    File.delete(DOWNLOAD_DIRECTORY + "/" + item)
  end
end

puts "Successfully finished"

In addition, if you want a launch agent that does this every day at midnight then add this to file named com.phegaro.smugler.plist in ~/Library/LaunchAgents

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.phegaro.smugler</string>
<key>ProgramArguments</key>
<array>
<string>/Users/kiranprasad/projects/smugler/smugler.rb</string>
</array>
<key>KeepAlive</key>
<dict>
  <key>SuccessfulExit</key>
  <false/>
</dict>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>0</integer>
</dict>
</dict>
</plist>

I hope this helps someone and just ask questions if there is something unclear about the script or the launch agent file.

Posted in Uncategorized | Leave a comment

How can everyone be an author?

I have been thinking a lot about all the blogs out there and all the blog services like Tumblr or BlogSpot or Posterous and I wonder who all these services are targetting? I think back to high school and there were a few people who had the ability to express their lives in words that others could comprehend. Now we are expecting everyone to start posting interesting topics and opinions on what they are reading or what is happening in their world. It makes me understand more why social networks like Twitter, LinkedIn and Facebook are becoming so popular. Its the quick easy way to give an opinion. You Like it or Share it and you are done. I wonder if this is adding any real value to the community of authors and the total information shared. It feels more like copying a paper from the student net to you instead of actually writing something useful and informative. What do all of you think?

Posted in theory | Leave a comment

Stages of life

I just finished watching the final series episode of Greek. I am not really sure how I got into the show but I think it was from the 2 weeks while the family was in India. Whenever a show or series ends and the group moves on to the next stage in their life, some part of me tries to understand the stages of life and where I am. There are the classic stages: Elementary, Middle, High, College, First Job, Married, Kids… but then what? How do the stages of life continue to evolve or do the stages of life repeat themselves just through your children? There are lots of events that are still large post these basic stages like new jobs and new homes but I am not really sure if they warrant being called stages in life. What really defines a stage of live. I guess it would be when you have learned enough within the current stage that you can move forward and engage what you have learned at the next level. Each job within my life seems to let me grow and learn and then evolve at the next level and that might be the new definition of stages. So it stops being about time or places but about abstract growth points in your life. Its clear on the professional world as you move through these stages but I wonder what those same growth steps are in the personal world.

As most people that know me should know, I will eventually build and lead a successful company. Once I have reached that stage and have learned from it, what will be the next stage? What stage are you in life today (personal and professional) and what are your definitions of stages?

 

Posted in Uncategorized | Leave a comment

Registering a new .local domain on mac os x

I am sure there are better ways to do this but this is what i have found allows me to do it easily

/usr/bin/dscl localhost -create /Local/Default/Hosts/#{hostname.local} IPAddress 127.0.0.1

Posted in Uncategorized | Leave a comment

Namespacing in Javascript

After reading this article by , i was pretty much sold on the design pattern #5 suggested for namespacing your functions. Then I ran into some problems/questions. First off, I’d assume you want to do some amount of sub-levels into the namespace. I know the article says dont do it but sometimes i have an application lets say btp. Then i want to add something like btp.devices.functionToCall. I want to define the functionToCall method in a file called devices.js. I think the best way I have found to make this work so far is to do something like the following:

var btp = {}
function() {
  this.someOtherFunction = function() {
     // do something else
  }
}.apply(btp);

btp.devices = {}

function() {
   this.functionToCall = function() {
      // do stuff
   }
}.apply(btp.devices);

I think this seems clean enough but I dont know if there is a better way to do this or if it makes more sense to just start creating namespaces at the toplevel like btpDevices or something. Just thought I’d share where I ended up for now. Any ideas for a better way?

Posted in tech, Uncategorized | Tagged , , | 4 Comments

Exceptions vs method missing in Ruby and Rails

After some looking around here is what i found and thought others would find useful as well
Exceptions in general are really slow in ruby and should be thought of as exceptional. method_missing is not an exception but is actually a kernel method of ruby. When you invoke a method on ruby the runtime will search the entire class and module heirarchhy all the way to object, class and module and then as a last case call method_missing. Its more like it just calls this method and you can override this method at anypoint in the chain. Its definitely slower than calling a method that does exist because it has to search up the heirarchy but it is definitely faster than exceptions.
Here are some other posts that i found useful during my review of this area:
Posted in tech | Tagged , | Leave a comment

Thinking sphinx and passing conditions for joins or includes to search

http://github.com/phegaro/thinking-sphinx

Since Sphinx only returns ids of items that match the search query, thinking sphinx actually does the work of running a find and retrieving all the records by using a find method and passing all the arguments you sent to the search method to the find query. It passes things like :include and :joins etc but it does not pass conditions so i created a new options called :sql_conditions and  you can pass the normal sql conditions you might want to pass to have joins be filtered etc. Hope it helps and good luck

Posted in tech, tools | Leave a comment

WordPress and Ubuntu 64bit and zlib extension

I looked all over the web and found some links to this but it was not easy to find so i thought i would write a little article about it.

You will see this error:

Abort class-pclzip.php : Missing zlib extensions

This is because in the file class-pclzip which is in your wordpress directory

at ${wordpress_root}/wp-admin/include

wordpress looks for gzopen and now in php that is called gzopen64 so just find all occurances of gzopen and replace it with gzopen64.

Now you can install plugins and themes again. Good luck and hope this helps others.

Posted in tech | Tagged , , | 3 Comments

Innovation, Evolution and Revolution

Walt Mossberg said in his most recent review of the  iPad:

“Still, the software looked impressive, and that could help Steve Jobs do the one thing even he has never done in an amazing career: get the public to love not just a better version of an existing type of gadget, but a whole new category of gadget.”

It brought back a thought i have had about products and how they are created, evolved and revolved. Most of the products that come out today are either evolutions or revolutions of existing products. Very very rarely are there actually truly new an innovative products.

When i talk about evolutionary products, i look at products that are continuing to add features, adding performance and slowing moving towards a better product. Most of the phones made today are evolutionary products that continue to change in small slight ways and then marketing/advertising teams work hard to call it innovation.

When we I talk about revolutionary products, i think about products like the iPhone or they Hybrid Car. These are still steps in products that already existed but is such a large step that it feels like a whole new product. iPhone re-introducing touch and making that a central part of the user experience with physics integrated was a revolution, but the concept of a phone, apps, email and even music had been around for some time. It was not a whole new category of product or a whole new solution.

The few true innovations that i can think of in the recent past are Tivo and Eink. I am sure there are others that i have not thought about but these stand out to be me very easily. For years people were trying to build smarter and smarter VCR 1 click remotes and then the Tivo came out and showed us how we need to navigate content and how to really watch/manage tv shows and content. The stopped the focus on channels and moved the focus to the actual shows. It was a whole new category of product that was not just a smaller, or faster or brighter version of something that already existed. EInk has not really hit the mainstream yet but the idea is the same. If we really can move to a model where we will use eInk and ePaper to replace pen/paper for all our hand written content that would be a true change and evolution of a new category.

Right now, I am the founder and CTO of a small company called sliced simple. We are working on software solutions for real estate agents and I think we are building something that is revolutionary. I don’t think it is really going to create a new category of solution but it will definitely change the tool landscape for real estate agents. After this venture, i hope to have the change to build something truly innovative.

What do you think are some innovative solutions out in the world and what do you think of my categorization of the products above?

Posted in theory | Tagged | Leave a comment

Todo managers, GTD and what I do

Efficiency and tools to make me more efficient are kind of an obsession with me. To some extent, it might be such an obsession that it might actually stop me from being efficient :) . I try many many many tools and only a few of them survive for more than about a few minutes and even fewer survive longer than about 2-3 weeks. The ones that stay behind are ones that i dont have to change to adapt to but ones that can easily change to adapt to me.

Todo applications are a great example of this type of tool that has gone through a number of different cycles and i have finally ended on one. Once again, i dont think any of these have ever lasted more than a few weeks and maybe some a few months but here is my take on each.

Palm Pre Todo App

I tried to use the device side todo application for doing all my task management because i thought “Hey its with me all the time why not do it there”. Let me tell you this was a disaster in about a few days. I tried really hard but there are just many issues with the solution:

  1. You cant access it anywhere but on your phone. While i can type fast there, i can type much faster on my desktop
  2. Most of my tasks are created while on the Mac and only some are created while mobile
  3. There is no concept of inbox
  4. Free form notes are not really supported outside of being attached to a task.
  5. etc etc..

Things

Things is an application from Cultured Code. The application itself is pretty beautiful and is designed around the concept of GTD. You have an inbox and projects and tags and can really just keep a list of things to do very effectively. They have plugins for QuickSilver and with its Applescript interface you can pretty much push anything into it as a task. In fact, i wrote a couple scripts that move entourage mail into it as a task and also apple mail could be moved into it as tasks as well. Since some of my tasks come from email, i thought that this was a great model because i just had to hit a button and boom the email was now a task and it was cleared out of my email inbox. It was now in my task manager inbox. I used tags and projects and tried to keep track of everything, but there were a couple things that finally made me leave this application.

  1. It did not have a wireless sync to my phone (Palm Pre) and it was not accessible on the web so if my computer was not with me i was SOL.
  2. I spent too much time organizing my tasks and tags etc and it was just too much organization for me. Most of this was not because of the time to do this it was because when i created the task i knew where it needed to go but things would change over time and task would change tags, projects and just move around. It was not keyboard effective to really manage a task after it was entered into the things.
  3. Notes are attached to tasks. They are the connected to tasks. Sometimes i am just taking notes and they will become tasks later but for now they are just ideas or thoughts and i want to keep them in a list.

From here i realized i wanted something that made entering the task easy but also available every. I did some quick googling and found

Remember the Milk

This app continues to amaze me. It is fast for a web based application and they have a iphone sync app and a mobile site. I built a WebOS application to get my tasks on my phone. It has TONS of plugins for Quicksilver and every other app to get tasks into the system. You can email it stuff with just a forward it to the app and it would show up in the Inbox of the task manager. It is a super duper task and list management service and have used this for a while now. To make it feel more like a local native application, i used Fluid to make it feel like a native application. While it was easy to get things into the list and tag it and manage it there were other issues:

  1. It was kind of a pain in the butt to share tasks. They have some model of a shared task list and i tried to use it with my team at work (3 people) and it worked but just did not let me select a set of tasks and cut/paste them into an email and send them to someone that was not part of the RTM system. Everyone has to join just for me to send them a task list.
  2. Since it was so task/list driven there was no place to just take notes that are free form. You can put notes down that are attached to a task but you cant just keep notes. This was one of the same issues i had with things but at this point i did not realize that was the issue
  3. At the same time i was starting my startup and tied to use this to manage my project schedule. To say the least this is not a tool to do that because it does not have milestones and time tracking is just a secondary thought.

I continue to use this application cause it is so ubiquitously available but i still end up using another tool to perform some of my basic task management. I also use this tool to keep track of things like books to read, movies to see etc. It ends up being a long list of stuff more than a todo list it is more of a list of things to catalog and reference periodically.

Plain Text Files

While i was happy using RTM, i realized quickly that i was still bringing up textedit and just keep a list of items to do with notes and tasks in a text file. I did this when i was starting a project and things were still pretty free form. I kept a list of ideas there or a list of tasks and would take them and send them into RTM periodically. As i did this more and more, i quickly realized that my best todo list was plain text files. They are not as ubiquitous as RTM so i cant easily add to it or remove from it unless i am on my Mac. I have the text files sitting in drop box synced folder so its kinda available just not very easily on my phone. Text files are pretty awesome cause Quicksilver and Launchbar allow me to just add text to the end easily. Moving things around is easy. Sharing it with others is just an email with a cut and paste and indentation works. The things that are missing are the organization of tags and search.

Task Paper

This is an app that i have only been using for about 2-3 days so ask me again in a few days if this is still good. It seems to be pretty perfect in that it gives me tags/search and projects but it is all just a text file. It just feel natural to use for a programmer or someone who just likes to type out what he is thinking. Notes are easily mixed as in plain text files and at the end it IS just a plain text file. My only downside on it  so far is that it is not ubiquitous in terms of access. It is a app that runs on a Mac, i need it on my phone.

Nirvana

What i would love is a web app version of Task Paper that works on the web and my phone and also has a desktop app. The text files are just synced and kept easily accessible everywhere. I guess i can either keep hoping or maybe one day I will just end up building this for myself :)

Sidenote: Many times I use the tools other than the above to do feature/issue tracking. Currently we are using redmine but i have also used jira and bugzilla. They all have their own issues but have different needs/requirements. I think the one that seemed to be the best for my on this front was thymer but I did not want to pay for something when it was in alpha/beta and we are still a small startup.

Update: 2.8.10

I have been using TaskPaper for a few weeks now and i think it is something that has become a central part of my tool arsenal for todo management. In the comments, you can see that the author of TaskPaper is also providing a iPhone app and text sync tool that seems to be working pretty well. Task Paper seems to be the solution for my free form thoughts and in general for notes. I am using RTM for keeping track of long lists like “books to read” and we are using Redmine for simple project task management. Thanks everyone for the comments and ideas but these are the solutions that seem to work for me for now.

Posted in tech, tools | 15 Comments