Archive for the ‘Programming’ Category

Check Gmail From the Command Line

Gmail provides the ability to view your new/unread email as an ATOM feed via https://mail.google.com/mail/feed/atom.  With cURL and some Perl we can check gmail from the Linux command line.

Just change the email address to your email address and when your hit enter you will be prompted for your gmail password.

#!/bin/bash
curl -u motersho@gmail.com --silent "https://mail.google.com/mail/feed/atom" |
 perl -ne \
  '
    print "SUBJECT: $1 \n" if /<title>(.+?)<\/title>/;
    print "RECEIVED $1 \n" if /<issued>(.+?)<\/issued>/;
    print "FROM: $1 " if /<name>(.+?)<\/name>/;
    print "($1)\n\n" if /<email>(.+?)<\/email>/;
  '

50 Excellent Ajax and JQuery Demos

9lessons has an excellent post/tutorial on using Ajax and Jquery to make you website come alive.

In these demos I had explained about jquery connectivity with MySQL database, Ajax implementation with PHP and Animation addons to your web pages. I hope it’s useful for you. Thanks!

More..

Barcode Scanner Written For Android Phones in Just 6 Lines of Code

Here’s a barcode scanner written in six lines of Python code using the Google released the Android Scripting Environment (ASE):

import android droid = android.Android()
code = droid.scanBarcode() isbn = int(code[‘result’][‘SCAN_RESULT’])
url = “http://books.google.com?q=%d” % isbn
droid.startActivity(‘android.intent.action.VIEW’, url)

This is just a proof-of-concept but it show the power and ease of Google’s Python scripting tools when combined with Android.

Written By Matt Cutts (Sorry I don’t have the original link)

Google Code University

Have you ever wanted to learn how to program?  Ever wanted to learn how program for free?  Have you ever wanted to learn how to program from worlds largest on-line search provider?  Well now you can!

Google Code University is a free site that has on-line courses to teach you how to  program in many different programing languages.  It include on-line video lectures, written material, and code examples.  Currently I am taking the Python class so I am sure you will see some Python projects on this site soon.

Trace Watch iPhone Plugin (TWiPP)


Click here for the *UPDATED VERSION*

Ever since I have configured my website to use Google Analytics I have become a bit of a statistics nut.  I find myself checking every free moment I get and while I don’t get a lot of traffic it is always nice to see when someone does visit my site.

The other day I discovered another way to fill my website statistics fix by installing an application called Trace Watch.  Trace Watch is similar to Google Analytics but it gives you real time stats and a few alternate ways to see the data that I have not discovered with Google Analytics.

So I was out and about the other day doing shopping with my wife  and I decided to check my Trace Watch web stats from my iPhone.  While I could connect to the stats site it was a little cumbersome to see just the basic information that I craved; hit counts and visitor counts.  I though it would be nice if there was an iPhone app for this.  I did a few searches of Apple’s App Store which came up empty.  I then did some Google searches to see if there was any available plug-ins and it also came up empty.  So I decided to try my hand at writing one.

I knew that I didn’t want to download and install Apples SDK so I started to look for information about how to create web apps for the iPhone, which lead me to this: iUI.  Its a java-script/CSS library that mimics the iPhone look and behavior.  I also found the Trace Watch API documentation on their site.  So now that I had both pieces to the puzzle I was off and here is the outcome.

Installation is a snap and there isn’t any configuration changes that need to take place in either the plug-in or the Trace Watch application.  This app currently is only made to get some basic information from Trace Watch and will not be a complete iPhone GUI replacement for the main Trace Watch application.

Installation Instructions:

*UPDATED VERSION*

Step 1:

Download the plug-in zip file: Trace Watch iPhone Plugin (180)

Step 2:
Extract the zip file to a temporary directory

Step 3:
Upload the extract directory name “m” to the root of your Trace Watch installation folder (assuming /twatch)

Step 4:
Browse to this site via your iPhone:  http://<yoursite>/twatch/m

Here are some screen shots of the application:

TWIPP

Home Screen

TWIPP

Statistics Screen

EDIT: Both the misspelling of Visitors and the Average Page Views per Visitor has been fixed in the attached zip file.  I will update the screen shots soon

TWIPP

Breakdown of Hits per Hour

More features are coming soon but I wanted to get quick version 0.1 out to get people’s opinions and feedback to see if this was worth continue to pursue.  So please any feedback, good or bad, is appreciated. Either via email at motersho@gmail.com or as a comment on this page.

Also I have not tested this on any other mobile browser so I don’t know how it will behave but I have a feeling it will not work too well seeing that it doesn’t behave very well in Firefox.

Download: Trace Watch iPhone Plugin (140)

Update: (08/01/2010):
The latest version now support multiple websites.

Remote Process Kill via WMI. A Replacement to rkill.exe/wrkill.exe

In the past I have use an application from the Windows 2000 Resource Kit called rkill.exe and its GUI counter part called wrkill.exe to remotely kill processes.  But lately I find that it is more and more unreliable and I get an error message “The RPC server is unavailable“.  So I decided to write a utility that uses Windows built-in WMI (Windows Management Instrument) to find and kill processes instead.  This application is freely available and I have included the source code released under the GPL v3 license.  The application is written in AutoIT. If you use this and like it please let me know in the comments. I find it useful when trying to remove spyware from people’s computers around the office.

Application: Remote Process Kill (392)
Source:
Remote Process Kill Source (345)

RemoteProcKill.exe

RemoteProcKill.exe