Archive by Author

Fake – Mac OS X Web Browser Automation and Webapp Testing Made Simple.

Fake is a new browser for Mac OS X that makes web automation simple. Fake allows you to drag discrete browser Actions into a graphical Workflow that can be run again and again without human interaction. The Fake Workflows you create can be saved, reopened, and shared.

Inspired by Apple's Automator application, Fake looks like a combination of Safari and Automator that allows you to run (and re-run) "fake" interactions with the web.

I am starting to think of an idea browser/OS independent.

Django Debug Toolbar 0.8 on Vimeo

Yes, I am working on Django and I need a way to debug. This tool seems very interesting.

Test Users – Facebook Developers

A test user is a user account associated with an app created for the purpose of testing the functionality of that application. You can use test users for manual or automated testing.

We allow you to access the test account via a login_url which allows you to directly login to the account. The login_url expires after one hour, but you easily refresh it to get a new login_url for the same test user. We also provide you an access_token for the test user so that you can take actions on behalf of the test user via the api.

An application can create up to 500 test users to start testing an application.

Currently one can only create and manage test user accounts via the API described below but in the near future we will be providing access to this via the developer app.

jsPerf: JavaScript performance playground

jsPerf — JavaScript performance playground

What is jsPerf?

jsPerf aims to provide an easy way to create and share test cases, comparing the performance of different JavaScript snippets by running benchmarks. For more information, see the FAQ.

Great place to do some JS tests and learn from others.

ReaditLaterList + Bit.ly + Tweeter

Thanks to the great APIs from each of three different services (Readitlaterlist, bitly and tweeter) I was able to create a mashup that allows me to view the ReaditLaterList items on the browser. There are times when I want to share the links with others in tweeter but I need to open a new browser and create the bit.ly link, after that I need to create a new tweet using the title of the page I was looking at.

I could have used different browser shorcuts but I figured that it was a good opportunity to use some JQuery to create a simple web app and the app does the following:

1. Load list from ReaditLaterList
2. Create "tweet" and "load" options for each item listed
3. The "Load" option loads the site on an iframe
4. The "tweet" option tweets the link but before doing so the link is pushed to bit.ly from where we get a short url and then automatically posted to tweeter.

This is a lot faster and allows me to keep up with my reading list as well as being able to share the content with just one click. Not only that but I am able to keep all my links organized on my bit. This allows me to keep everything organized under each one of my personal accounts.

How my iPhone made me miss my first flight of the year

It was 2:00 AM on a brand new and sparkling year, 2011 to be exact. I was aware that I had to wake up at 3:30 am to get ready and head out to the airport by 4:00 AM, this would give me plenty of time at the airport to check-in and to make it to my flight since my flight was not taking off until 5:40 AM. This was a business trip that had been planned months ahead and that it was necessary for me to fulfill without any error. If I remember correctly I was on a conference call 6 months earlier talking about how I already had to reserve January 1st for this business trip. That is how far in advance my schedule for this trip was set up.

As an iPhone owner that has grown to rely on the integrated alarm clock I set up my alarm but something was telling me that I was going to miss the flight and I was going to wake up late, I guess its the same feeling everyone has when traveling and all of the sudden feels the fear of missing a flight. So my wife set up her alarm clock on her iPhone as well, this would help us have double assurance that everything was going to work out as planned. Now, lets remember that this is January 1st at 2:00 AM and we received the new year with two kids in bed, watching a TV show and chatting about the new events of the new 2011 so it is not like my fear was grounded due to excess of partying but rather it was probably only due to all the planning that was involved ahead of time was keeping me on my toes for this day.

When I was laying in bed trying to fall asleep at some point I considered going to the living room and doing some preliminary work which would keep me awake until 3:30 AM to get ready for the flight but I figured an hour and a half of sleeping was well worth it since I was going to be working and traveling at least until 10:00 PM the same day. Besides we had two alarm clocks, What could go wrong?

Fast forward to 6:09 AM. An email from my bank came in to report the current balance of my personal account as it does every day but this time was different, it came in with a "Bing"! which woke my wife and I. At this time I was not aware of what time it was but I knew it was later (or earlier depending on how you see it) since a glimpse of light was coming through the bedroom curtains. I knew I was in trouble. I quickly picked up my iPhone and saw it was after 6:00 AM and that there was no way I was making it to the airport to my flight, rapidly I started running ideas through my head trying to figure out what to do and how to "fix" this issue. While I was trying to figure out what to do I kept repeating to myself - I knew I was going to oversleep - I fired up the Delta iPhone app and checked for the next flights available from my city to my destination. The next flight was at 6:45 AM, I knew it would take me at least 30 minutes to get to the airport plus the flight change at the front desk and going through security there was no way I was going to make it. So I browsed through the app and the next direct flight was not until 11:45 AM. Too late.

I realized it was time to do damage control, I fired off some emails and waited for everyone else to wake up in my destination area so I could let them know that I definitely missed my flight and that I was not going to fulfill this business trip.

While I was in my home office browsing through the world news, waiting for email responses I ran across a post that stated that there is in fact a software glitch on the iPhone for January 1, 2011. After reading the post it all made sense,

1. There was not a "Snooze" screen on my phone indicating that I had slept through the alarm clock and that it tried to wake me up.
2. How was it possible that the one sound of an incoming email woke us up but not the continuous sound of an alarm?

We had been victims of the software glitch.

I fired up twitter and there multiple reports of people missing work or similar due to the alarm issue so I knew I was not alone. If you do a search in google you can find multiple sites describing the issue.

Interestingly enough some people are replying to the posts with "Give it a rest" or "It's just an alarm clock, no a big deal".

I will agree with some people who say it is not a big deal since it is just an alarm, but when you have grown to rely on the alarm for important occasions, it becomes a big deal. I did learn my lesson and for the important dates I will go back to a good old battery-powered alarm clock, or maybe two.

What a great way to start the sparkling new year!
* Missed first flight of the year [check]
* Missed first meeting of the year [check]

If you were in my shoes would you attribute these issues to a wonderful software glitch by Mr. Jobs or would you assume it is all your own fault?

Chmod codes explained

Codes below for quick reference:

All seven permissions are listed below, with their numeric values on the left.
1. --x
2. -w-
3. -wx
4. r--
5. r-x
6. rw-
7. rwx

Common combinations in use on web servers are as follows:

644 = rw-r--r-- Usual permissions for reading an HTML web page or Read-only text files.
664 = rw-rw-r-- Used in most plain text hit-counter logs (writable = on)
666 = rw-rw-rw- Used in scripts that require World writable permission.
711 = rwx--x--x Used by Perl scripts to make them executable only upon access.
751 = rwxr-x--x Used by Perl scripts that must be written to and executed (hit counters).
755 = rwxr-xr-x Used by some Perl-scripts and binary database files.
775 = rwxrwxr-x Normal permission for your website's Root directory
777 = rwxrwxrwx The whole ball of wax. You better have tight security on any file marked with these permissions. 777 is usually only assigned to a CGI Directory, rather than to an individual file.

source

Running Django in a Rackspace cloud

Problem

Run Django in a Rackspace server and be able to restart the services if necesary.

Solution

It is rather easy to have a copy of Django running on the cloud if you follow the steps to the letter in the tutorial here. One of the problems that I personally encountered was to kill the Python service and then bring it back to continue development.

You need to find the ID that the service is using in order to "kill" it. One effective way that I found to display all the services that are running is by running the following command:

$ ps ux

Once you get a list of all the services running you can find the ID of those running under Python. In my case mine was ID 4193. So all I have to do is the following:

$ kill -9 4193

Do any changes I need that need to be made which were necessary to stop the service and run it again

$ python /projects/sample_project/manage.py runfcgi host=127.0.0.1 port=8080 --settings=settings

Extras

As an extra feature I added couple of aliases to help me to run commands faster:

alias start='/etc/init.d/nginx start'
alias stop='/etc/init.d/nginx stop'
alias restart='/etc/init.d/nginx restart'
alias py='python /projects/sample_project/manage.py runfcgi host=127.0.0.1 port=8080 --settings=settings'

Adding serveral unversioned files to an existing repository

Problem

You have already added a directory to SVN and you need to add several new files to SVN. As you may know the default way to add new files to an existing repository is by doing the following:

$ svn add filename1.ext
$ svn add filename2.ext

or one line

$ svn add filename1.ext filename2.ext

this works well when you have a few file names but how about several files that need to be added at once and with complex names?

Solution

You can add the --force option when re-adding a directory

$ svn add directorycontainingfiles --force

If you want to take it a step further you can clean up your directories from those extra hidden files:

$ find . -name '*.DS_Store' -type f -delete

Error SVN Checksum missmatch while updating

Error

svn: Checksum mismatch while updating 'thenameofyourfile.ext'; expected: 'e0585e8a5e638c6d5490ab2feb9b4267', actual: 'd41d8cd98f00b204e9800998ecf8427e'

Solution

open the "entries" file that lives inside the ".svn" folder in a text editor. I use TextMate
Do a "find" and look for the expected checksum. In the example above is "e0585e8a5e638c6d5490ab2feb9b4267"
Replace with the actual checksum. In the example above is "d41d8cd98f00b204e9800998ecf8427e"
Done. Now you can commit your changes.

Possible roadblocks

The entries file needs to be writable.