August 21, 2008

Using WebInject With GroundWork Monitor

Wow.. I love seeing my Open Source code propagate through the community.

I am the author of WebInject, which is a popular web application/service test tool that also works as a Nagios plugin. GroundWork has an Open Source monitoring system based on Nagios.

I just stumbled across an awesome screencast tutorial from GroundWork called "Using WebInject To Monitor Web Applications And Services". It shows how to install and setup WebInject as a monitoring agent.

Go check it out!


you can also download the screencast and PDF without registering by going here: http://www.groundworkopensource.com/resources/webcasts/monitoring-web-applications-thanks.html

August 7, 2008

Editra - Nice Python Editor

I just saw this post about Editra from Flávio Codeço Coelho:
Editra: a Great New Python Editor

I downloaded it and was VERY impressed. For Python programming, I don't use a full blown IDE. I prefer a cross-platform text editor with syntax highlighting and integrated shell that works well on Windows and Linux.

I have been using SciTE as my programmer's editor for several years now; going back to my days as a Perl programmer. I have never seen an editor that rivals SciTE (shut up VIM freaks :)

Well, Editra just might be that editor. It is only in an Alpha stage, but is very useful and packs most of the features I want including autocomplete (which SciTE lacks).

I will definitely be keeping an eye on this editor as its development progresses.

http://editra.org/

August 6, 2008

Top Screen Resolutions - My Web Visitors

This is a breakdown of screen resolutions from visitors to my site and blog during the past 30 days

Python - Downloading Binary Files

Here is a quick example showing how to download and save a binary file (image, zip, etc) to disk using HTTP. This will grab the image file from a website and save it locally:
import urllib

url = 'http://www.goldb.org/images/goldb.png'
f = urllib.urlopen(url)    
fh = open('goldb.png', 'wb')
fh.write(f.read())
fh.close()

August 5, 2008

Default Languages on Linux, Mac, Windows

Mark Damon Hughes:
"All Linux distributions ship with: Python, Perl, C, and C++"

"A standard install of Mac OS X Leopard has: Python, Perl, Java, Ruby, AppleScript"

"MS Windows ships with nothing. No BASIC. No C compiler. You're trapped, stuck playing with Solitaire and MS Paint"

July 25, 2008

Python - Counting Items In A List

Counting items in a list...

Lets say you have a list like this:
foo = [1, 2, 1, 2, 1, 2, 1, 1]
... and you want to count the items in the list, ending up with a dictionary full of items (dict keys) and counts (dict values), like this:
{1: 5, 2: 3}
Here is an easy way to do it:
d = {}
for i in set(foo):
    d[i] = foo.count(i)
got anything more Pythonic?

July 3, 2008

Searching For Your Open Source Code

One cool thing about developing free open source software is seeing where your code ends up. It is satisfying to know that bits of code you wrote end up in other projects and code bases.

There are several online services that index source code from various places like websites and online svn/cvs repositories. It makes searching for my code a breeze. This is also useful for looking up examples of code I have written in the past that I want to copy from.

  • Google Code Search:
    Search public source code for: "corey goldberg"
  • Koders Search:
    Search public source code for: "corey goldberg"
  • Krugle Code Search:
    Search public source code for: "corey goldberg"



  • July 2, 2008

    Twitter API vs. Yahoo Web Services - Performance and Reliability

    I've noticed the Twitter API is very slow and unreliable. Requests often take 10+ seconds to return. Sometimes they timeout with no response at all.

    I put together some monitoring tools to see exactly how slow and unreliable the API really is (when it is even available!). This is obviously not a very scientific test; just a ballpark idea of performance. The monitoring tools are built with Python and RRDTool. To start with, I used a modified version of my rrdpy suite of tools (http://code.google.com/p/rrdpy).

    I ran a test for 2 hours, hitting the API's Test Method every 30 seconds. The tools generated the following time-series graph of server response times:

    The average response was 2.53 seconds, and we see a *lot* of variance in the data samples.


    In comparison, here is the same test run against the Yahoo Search REST API:

    Notice the small variance and the average server response time of 0.186 secs!


    I would be interested in running these tests again in a few months to see if Twitter's API has become faster and more reliable.