Automating date change on Flickr photos with SikuliX


I recently migrated several gigabytes of photos from Google Plus photos (formerly Picasa) to Flickr. Flickr provides a generous 1TB of data, allows full resolution images and videos and has a thriving community. This was a great opportunity to backup and showcase my photos. I began migrating photos but I hit a serious usability issue. The Flickr photostream is sorted according to the date on which photos are uploaded. There is no option to organize the photos by date taken. This meant that my entire photostream was organized by a single date (the date on which I uploaded all of these photos). The fix was to change the uploaded date to the date the pictures were taken. This meant that I would have to go thru thousands of photos and videos and manually change the date. This was a daunting task that would have taken me the entire weekend. Being a QA/Automation engineer in my day Job I thought surely there must be a faster and easier way to do this.

I found Sikuli a visual automation tool, which can be used to quickly automate things like filling forms, clicking buttons etc and has a much easier learning curve when compared to Selenium or iMacros. With Sikuli my workflow mimicked what I would have done manually.

  1. Click on You>Organize menu item & then on the “sets & collections” ta
  2. Click a photo set to edit, double click on the first photo in the set
  3. Switch to “Dates” tab.
  4. Copy the date in the “Date taken” field
  5. Paste the copied date into the “Date uploaded” field
  6. Check the “go to next item when you save?” box if unchecked
  7. Press save and advance to next photo.

With the Sikuli Script All I had to do was select the set, bring up photo properties, switch to date tab. Edit the sikuli script and update the total number of photos in the set. Run the automation script. What should have taken days took me about 2 hours flat. Take a look at the video below to see it in action.

SikuliX & Flickr demo

SikuliX & Flickr demo

SikuliX can be downloaded at http://www.sikuli.org/

Fix for "Cannot shutdown using power button" on Ubuntu


After my recent upgrade to ubuntu, pressing the power button to shut down stopped working. I had to remap the script mapped to the power button by

  1. Editing  /etc/acpi/events/powerbtn using the command
       sudo gedit  /etc/acpi/events/powerbtn
  2. Commenting line shown below by adding a # to the beginning  of the line
       action=/etc/acpi/powerbtn.sh
  3. adding a new line
       action=/sbin/poweroff
  4. Saved and exited Gedit. Tested to make sure the functionality is restored by pressing the  power button to shut down

Setting up mediatomb using ffpstick on a Zyxcel NSA210


  1. Download FFPStick 0.5 from here
  2. Format a USB stick with FAT16, extract the contents of the FFPStick Archive you downloaded on the the root of the USB stick.
  3. Shutdown the NSA210, Plug in the USB stick and reboot
  4. wait for 2 minutes and then login to the box via telnet
  5. change root password, delete account called “user”
  6. start ssh with
    chmod a+x /ffp/start/sshd.sh
    /ffp/start/sshd.sh start
  7. logout from telnet and log back in via ssh, login as root with the newly changed password.
  8. stop telnet and then disable telnet service using commands
    chmod -x /ff/start/telnetd.sh
    /ffp/start/telnet.sh stop
  9. Start mediatomb to create the initial config file by using the command
    chmod -x /ff/start/mediatomb.sh
    /ffp/start/mediatomb.sh start
  10. Wait for 30 seconds and then issue the stop command to stop mediatomb
    /ffp/start/mediatomb.sh stop
  11. Customize the /ffp/var/mediatomb/config.xml file
  12. Start mediatomb again, navigate to http://cerberos:49152 and begin adding media to database.
  13. To remove the listing for PC directory add the following line under <server>
    <pc-directory upnp-hide=”yes”/>
  14. Verify that the upnp server is reachable using the client on a droid or using enna or moovida.

Fonera router hack-update


After upgrading my Fon router successfully to DD-WRT  I  have been experiencing frequent disconnects, every few hours The WiFi connection drops for a few seconds and connects back .  Some posts on the DD-WRT forum point to overheating of the router as the cause for this issue. A few people have gone so far as to drill holes and attach cooling fans to remedy the situation. I have switched back to my old router until I find a better solution (other then drilling holes in the cabinet)  to this problem.

If you have a Fon router be advised that it might heat up excessively and give poor performance if placed in a poorly ventilated spot.

Powered by Qumana

Upgrading Firmware on the Belkin F5D7230-4 router


After successfully flashing DD-WRT onto my FON router I wanted to try and upgrade my Belkin router to DD-WRT . The Belkin F5D7230-4 v2000 router is a cheap router based around the Broadcom chipset with 2mb of flash. The complete specifications for this router can be found here. After some research on the net I found out that

  1. DD-WRT is partially supported on this router.
  2. Since the available memory is too small nothing usable can be accomplished by upgrading the firmware.
  3. Work is going on on several fronts to get DD-WRT micro edition compatible with this router.
  4. A lot documentation is available to install a USB port as well as a serial console on this hardware.

The FCC ID for this particular router is FCC ID: K7SF5D7234A I decided to go ahead despite the fact that the router is partially supported by DD-WRT, You can easily recover from a bad flash by making sure the firmware is available to the router during startup. As stated on most sites I was able to flash the router successfully and got WLAN working but LAN ports were not working properly. Some of the sites that I found useful were

  1. haxxed.com : Custom firmware for Belkin routers with 2MB Flash
  2. F5D7230-4 v2000 firmware : Original firmware for the Belkin F5d7230-4 v2000 router.
  3. TFTP server : TFTP server used to upload the firmware onto the router.

Note: DO NOT I REPEAT DO NOT TRY FLASHING DD-WRT onto this particular router, you will gain no serious advantage and will be left with a router with no web based administration interface and will have to re-flash to original firmware.

Hacking Fonera – How to install dd-wrt onto fonera


I received the FON router from a friend and decided to install DD-WRT onto it as FON’s custom firmware lacks certain features that I wanted. After doing a quick Google search I found out that

1. the Fonera’s firmware version is noting but a customized version of DD-WRT
2. the Fonera’s firmware version which is crippled disables ssh access by default.
3. the Fonera’s firmware version does not allow you to flash custom images of DD-WRT without signed firmware.

There are several hacks on the net that rely on exploiting certain vulnerabilities in the router software, chief among them is the ability to inject custom commands through a specially crafted set of HTML pages. The HTML pages allow you to enable ssh access on the router by enabling access to port 22 in iptables. Once ssh access is gained a series of steps will enable you to first disable the Fonera router from downloading and reverting to the custom firmware thus disabling SSH access, The tutorial will also enable you to flash the latest version of DD-WRT on to the router.

The latest hack released by these guys called the kolofonium makes it as easy as changing the DNS settings on the router to enable the SSH shell.

I downloaded the Tutorial detailing the process from here. A slight change would be to use the kolofonium hack to enable access SSH shell rather then using the 2 HTML pages and once SSH access is gained follow the rest of the tutorial to flash DD-WRT on to the router. The only problem that I faced during the process was the lack of a cross cable which was easily resolved by cutting up a straight cable and rewiring it to work as a cross cable, the result while not very pretty got the job done.

dscf0149.jpg

dscf0150.jpg

Some of the sites that I researched before trying the hack are:

1. http://stefans.datenbruch.de

2. http://dltv.wordpress.com

3. http://uselesshacks.com

4. http://www.easy2design.de

5. http://en.wikipedia.org/wiki/DD-WRT

6. http://www.belkin.com/support/tech/isp/

7. http://sodoityourself.com

8. http://www.gettingpumped.com/

It was pretty straight forward and took about 30 minutes (if only I could type the commands properly it might have gotten done sooner).

Happy hacking 🙂

Modify, Simplify ,Aquafy


For those poor souls like me who cannot afford to have a shiny new Mac book pro or an even an old G3 or those who are stuck with plain jane Windows XP a new Package called flyakite OSX provides the necessary files to turn your Windows XP computer into a pretty good Impersonation of MAC OSX.

Here is how my winXP desktop looks after aquafication 🙂

mydesk.jpg
Click image to view full screen

powered by performancing firefox

Kiosk browsing – update


A couple of months ago I posted about trying to get a Kiosk up and running with XUL, Turns out that the method I suggested does not work too well. Here is what I did to get it working

1. Use customize to remove address bar.
2. Clear out the bookmarks.
3. Use the tutorial here to lock the homepage to the page you want.
4. If needed remove the navigation bar as well.
5. Install R-kiosk from here.
6. Setup your mac/windows to disable loading any other browser.
7. Setup Firefox to auto load on startup.
8. Additionally you can install Public fox for much greater control.

However be aware that a sufficiently savvy user can circumvent all this by calling the browser from the command line with the desired website as an argument.

powered by performancing firefox

Kiosk mode browser using XUL


I volunteer at the Warren memorial library and was asked recently to create a Kiosk mode browser that could not be used to browse anything else except for the library’s book catalog. I started exploring the various options available and soon settled on two browsers, Opera and Firefox, while it is fairly easy to setup opera in kiosk mode you still need to pay Opera for the professional version to make it work.That ruled out opera and I was left with Firefox.I started hunting around for an extension that would turn the Firefox browser into a locked down version where you could not navigate to any site. I downloaded the R-Kiosk extension this extension does a pretty decent job of locking down the browser.The extension disables most of the menu items and does a pretty good job in disabling the navigation bar and the address bar,but the extension fails to block the preferences menu item thus leaving a chink in its armor which can be exploited by anyone who is computer savvy. The person can use the preferences menu to set the home page to any desired site close preferences and hit alt+home on the keyboard to navigate to that page.

For e.g if you wanted to restrict the patron from visiting any other site except for the library’s own home page a malicious user could set the home page to something like http://www.google.com and navigate to any site from there. The author also claims that the extension can only be uninstalled from safe mode, but by going to http://addons.mozilla.com and installing any addon you still get access to the addons window and can uninstall the extension from there.

In the end I found that the only way to circumvent these issues was to disable almost all the menu items, this was too much work which included hacking the perf.js file in the profiles folder so I decided to write a XUL widget instead.

Here is the XUL code

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
id="google's Online catalog"
title="googleOnline catalog"
orient="horizontal"
width="1000"
height="768"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<vbox flex="1">
<hbox pack="center">
<html:font face="verdana" color="blue">
<html:strong>
<label value="Google's online catalog"/>
</html:strong>
</html:font>
</hbox>
<hbox flex="1" orient="vertical">
<html:iframe src="http://books.google.com/" flex="1"></html:iframe>
</hbox>
</vbox>
</window>

PS: Copy pasting the code above will not work please download the code here, for some reason the code tag in wordpress does not work with XUL code 😦 properly. once you download the file from the above link rename the file from kiosk.doc to kiosk.xul.

you can preview the above code in this excellent XUL live editor.

googlexul.jpg

On a Mac you can setup a restricted account, set it to auto login without password and then set Firefox to start this XUL file at login. to further prevent access to the OS install the profile password extension for Firefox. This is not an elegant solution but it got the job done.

The XUL file can be started on login with the following command line typed into a shell script

cd /
cd Applications
cd Firefox.app
cd Contents
cd MacOS
./firefox -chrome /nameofxulfile.xul

On a windows machine the default shell can be changed to something like Blackbox which is a minimal shell and can be used for the same purpose, but it isn’t foolproof the only other way is to set the shell as Firefox which I haven’t found a way to do yet.

powered by performancing firefox