Monthly Archives: December 2014

Ideas for a 21st Caribbean – The future

The future is already here — it’s just not very evenly distributed.

—–William Gibson, SciFi Author

Today, I saw my mom’s world change.  She had a video chat with her mother in the UK with Skype.  Thanks to this tool, she will now be able to stay in touch with her sisters and mom’s mum’s at a level that would have been unthinkable 10 years ago.  While she and her sisters were FB friends, this type of communication is asynchronous(timeline) and semi-synchronous (realtime chat) at best.  In addition, my Grandma doesn’t have a FB account.  So the idea that that my mom could see and talk with her mother was definitely a major step forward.

Now, many in the First World may say that this is a trivial task and that they have been there, done that.  This is true. However, I think this is just an example of the quote mentioned above.

As more and more members of the Caribbean diaspora start embracing and implementing technology to solve local problems, the future won’t be the luxury of the technology elite, but in addition allow for my mom to strengthen her family ties.

p.s  Auntie Suset…. love the hair !!!

Ideas for the 21st Caribbean

One of my flaws is that I tend to keep my ideas secret, in the strange notion that only I can pull them of and to share them will negate the future opportunities for fame and fortune.  I won’t get into the excuses that stopped me from sharing what gifts, ideas and dreams that I have been brought here to share.  The only thing to know is that 2015 and forward is when I will “release the Kraken” !

Mobile communications economies in the Antigua – version 0.01

Visiting folks in Antigua posed a number of problems that  knew I of for along time, but have solved differently based on my need for access to the Interwebs.  On this trip I couldn’t count on Wifi at certain places, since I was relatively on the go.

Solution :  A cheap android with a data plan that I could create I Wifi hotspot(tethering).   It came up to $203 ECD ($180 for device; $20 for voice; $13 for 1GB/24 hours for data).  About $75 USD.

The device is Alcatel Pop C2

 

The service is with LIME.  Since I have  6+ hour layover in Dominica, I can breeth easier that I can still be connected to the Grid.

Assuming I max out my 1GB per day, I am looking at $5 per day.  Rest of my trip will cost me $30 USD.

Was able to skype from my Sprint HTC with it.

More than worth it for the freedom to move around.  Next trip will be less as I will have the device already.

If anyone wants more details, like on FB and Fav on Twitter.

ISP Bandwidth test monitoring

 

This allows you to test your internet service and get an regular email with the bandwidth test.

Requirements

 

Install

Python -c:\python
Speedtest_CLI – c:\scripts
SendEmail – c:\scripts\sendEmail
Crontab -(Default)

 

Setup

  1. Create folder c:\scripts
  2. Run and connect to Atlanta Comcast
    1. Hosted by Comcast (Atlanta, GA)  : Server # 1767
    2. c:\python34\python c:\scripts\speedtest_cli.py –server 1767
    3. See Results below for example
  3. Batch File ( c:\scripts\speedtest.bat )
  4. Add to Crontab
    Every hour – 0 * * * * c:\scripts\speedtest.bat

 

c:\scripts\speedtest.bat

date /T > c:\scripts\ga.sp
time /T >> c:\scripts\ga.sp
c:\python\python c:\scripts\speedtest_cli.py –server 1767 >> c:\scripts\ga.sp
c:\scripts\sendemail\sendemail -f %COMPUTERNAME%@%USERDOMAIN% -t stanford@tech.vi -u “SpeedTest %DATE:~4,2%-%DATE:~7,2%-%DATE:~-4%” -o message-file=”C:\scripts\ga.sp” -a “C:\scripts\ga.sp”


Results (e.g) :
 

Retrieving speedtest.net configuration…

Retrieving speedtest.net server list…

Testing from Communications Technologies (xx.xx.xx.xx)…

Hosted by Comcast (Atlanta, GA) [2588.72 km]: 126.965 ms

Testing download speed………………………………….

Download: 4.06 Mbits/s

Testing upload speed…………………………………………..

Upload: 4.30 Mbits/s

 

 

code … killproc.c

This week is Computer Science Education Week.  As part of their Hour of Code, I will be posting my source code from as far as back as possible.

It’s a bunch of gunk and fudges, so don’t judge me.  BTW… everything is BSD licensed.


 

After years of having to do it either manually through Task Manager or using a scripting engine like AutoIT, I finally settled down and wrote my own Win32 application that does massacres processes that I don’t like.  Will post source code later. Note that this kills all instances of the specified process. Usage : killproc.exe […]


 

 

killproc.c

#include<windows.h>
#include<process.h>
#include <Tlhelp32.h>
#include<winbase.h>

#include<stdio.h>

#include<string.h>

void killProcessByName(const char*filename){
HANDLE hSnapShot =CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);
PROCESSENTRY32 pEntry;
pEntry.dwSize =sizeof(pEntry);
BOOL hRes =Process32First(hSnapShot,&pEntry);
while(hRes){if(strcmp(pEntry.szExeFile, filename)==0){
HANDLE hProcess =OpenProcess(PROCESS_TERMINATE,0,(DWORD) pEntry.th32ProcessID);
if(hProcess != NULL){
TerminateProcess(hProcess,9);
CloseHandle(hProcess);
}
}
hRes =Process32Next(hSnapShot,&pEntry);
}
CloseHandle(hSnapShot);
}

int main(int argc, char * argv[]){
if (argc>1)
{
killProcessByName(argv[1]);
printf (“Killing process named %s\n”,argv[1]);
} else
{
printf (“Usage : killproc <procname>\n”);
}

return 0;
}

 

Code – helloworld.c

This week is Computer Science Education Week.  As part of their Hour of Code, I will be posting my source code from as far as back as possible.

It’s a bunch of gunk and fudges, so don’t judge me.  BTW… everything is BSD licensed.


 

Hello World on Windows.

#include “stdio.h”

void sayHello()
{
printf (“Hello Stanford ! Welcome back to Win32 API. You have been missed !! \n”);
}

int main()
{
sayHello();
return 0;
}

Using…too …much memory ……..

So about 2 months ago,  I installed ChruBuntu on my Acer Chromebook and  have been loving it for the most part.  However there is one nagging issue and it’s the memory usage that slows the system to a crawl when visiting some rich content websites (e.g. Youtube, FB, Gmail, etc).

A normal task would be to simply kill the browser process, ie. Firefox when the system gets sluggish. However by that time, opening a terminal window and then waiting for inputs to appear on the screen was getting ridiculous.  On average it would take me 2-4 minutes,  before I could kill the FIrefox process.

My solution : A shell script that runs every minute and monitors the memory usage.  The moment free memory drops below a certain threshold, all firefox (and Chrome) processes are executed with prejudice  !!

Here is the script

————————————————————————————

#!/bin/sh

/usr/bin/free -m | grep Mem | grep -v grep | awk ‘{print $4}’ > /tmp/freem1.log
mem=$(cat /tmp/freem1.log )
lmt=”95″
#echo “memory usage is $mem\n”

if [ “$mem” -gt “$lmt” ]
then
echo “Memory usage is fine at $mem \n”
else
echo “Memory is Less than $lmt at $mem. Killing chrome and firefox\n”

ps ax | grep firefox | grep -v grep| awk ‘{print $1}’ | xargs kill -9
ps ax | grep chrome | grep -v grep| awk ‘{print $1}’ | xargs kill -9
fi

————————————————–