The Thieves Tale 1980.

There were three of them, Ben, Andy and Jeff. At first I thought Ben and Andy were brothers, later I realized that it was because they wore similar clothes, were about the same height, and always hung out together.  Andy had a thin face with an athletic build, Ben’s face was rounder, with a thin mustache, that barely showed up against his dark black skin. Jeff was the runt of the trio, shorter and feral, his face always seemed to be breaking out. He was furtive, always looking for an angle. Where Ben and Andy were cheerful revelers, there was a dark cynicism about Jeff. 

When I first me them, Ben and Andy worked at the same small engineering shop, went clubbing together, and every Saturday hung out round the downtown. The hub of the downtown was a large department store. The boys laughed that they were shareholders in the store, and would sing the radio jingle when they were out. Saturday afternoon was not complete without a visit to the clothing section of the store where they would steal large quantities of clothes. They had a proven strategy of first going through to select their targets, then returning at a fast jog to pick up the items of interest and then running out as fast as possible. It was simple and effective, they were always dressed in brand new clothes at the clubs, which they discarded after wearing once. 

This had been going for quite a while when I got to know them, they were very open about it – its what they did at the weekend. Kingston was a predominately white town, and they were very large and loud black boys, it seemed impossible that they could be getting away with such brazen theft. They knew all the shop assistants who alerted them to the presence of security at the store. Meeting up with some of them it became clear that they were stealing as much stuff as the boys. It seemed as if everyone was in on the game. Individuals favored particular brands, I remember one girl who wore nothing but Burberry. Lacoste was popular with the boys and they would spend hours coordinating the looks of their stolen merchandise. 

Jeff would follow them into the department store, but would not steal as much as Andy and Ben, he was not so interested in the clothes and had little luck with girls. To make his mark  he stepped it up and transitioned to car theft, and carried an automatic center punch with him. It was a crude tool that he would hold up against a car window, and then shatter it by pulling the trigger. I later met a prosperous brick layer who sidelined in car theft, but carried a huge selection of car keys, that in the days before electronic car keys could get him into anything on four wheels. His approach was a little more subtle then Jeff, and he had never been arrested, unlike Jeff. 

Andy was only interested in clubbing and being social, so Jeff hung around Ben and got him interested in some of his projects. Despite looked down upon by the boys, he gradually pulled Ben into his world of small time crime. Ben and Andy gradually fell out as Ben became more of a criminal and less of a dancer.   

Advertisements

The Money Changer

Arjun Singh was a black market money changer in Kabul, Afghanistan. A Sikh immigrant from Punjab, he lived the good life in a large house on the outskirts of the city. During the day he could be found in his office in the main Bazaar with large wads of cash doing rapid calculations of exchange rates of a dozen currencies in his head. Most travelers would come to the bazaar to get the black market exchange rate which was may times better than what could be had in the tightly controlled government exchanges. You could find a selection of hippies, Central Asian merchants, tall Pathans all doing business with the money changer. In the evening he would host his friends at his well appointed home. 

Punjabis are much like the Irish where drinking is concerned, extremes of consumption or abstinence abound. Arjun Singh was my first experience of this outside of my family.  I went to his house with my father, I was at that time something of a curiosity with my shoulder length hair. We went up to the lounge, where we met Arjun, his brother, and son. His son who was my age wore a turban and had the first wisps of a beard. He regarded me with some curiosity as in appearance and dress I looked more like the hippies that were flocking to Kabul at the time for the cheap  and easily available drugs.  He was also the only one that spoke English, in which he was fluent as well as Persian, and Punjabi. I had a few weeks earlier met a boy who worked in his fathers jewelry shop in the huge bazaar in Istanbul, who at twelve was fluent in four European languages, as well as his native Turkish. I was increasingly insecure around these well educated boys from the bazaars. 

A huge dinner of pilau and kebabs was served. After the debris from the meal was cleared the main event of the evening commenced. A chair was moved to reveal a huge bottle of White Horse whisky. The bottle was so large that it required a cradle to hold and pour, it was about two thirds full. I would guess that full it would hold several gallons. 

Arjun Singh turned to my father, and uttered the only English I heard from him all evening. “OK Latif, lets finish the bottle”. My dad careful not to insult the hospitality of his friend and generous host, grunted his approval. There were four of us in the room who were to empty the bottle. Arjun’s son worked tirelessly as a barman, but did not touch a drop. To finish the contents of the bottle, we would have each had to drink the equivalent of several regular bottles of scotch. Glasses appeared and were filled, in recognition of my youth, my pint glass was filled two inches short of the lip with scotch and then topped up with water. A toast was given and then glasses were emptied, except mine. I had no experience with Scotch and even with the dilution it was undrinkable. I looked over at the bottle, the level appeared to have dropped down about three inches. There was maybe two more feet to go, it was going to be a long evening. 

Several more toasts were made, I never managed to finish my first glass, the contents of the large bottle went down a total of maybe five inches. The evening ended with a taxi being called for my father and myself. My dad had to crawl down the stairs on his hands and knees. As we got into the taxi to take us back to the hotel, Arjun Singh came out on the verandah to wave goodbye to his guests. He raised his hand and then slowly toppled over, falling off the veranda on the first floor to the garden below. There were shouts and cries of pain, he came up, holding his arm, telling us he was alright. My father relieved that he did not have to deal with the stairs again, ordered the taxi on, and we left early the next morning for the Khyber Pass and Pakistan. 

My dad returned to Kabul several weeks later, and went to visit his friend. The  bottle had gone from the lounge, and Arjun’s arm was in a cast. Falling from the verandah had broken it, and he immediately swore off alcohol. He was emphatic in his refusal to drink the hard stuff ever again. They had a more subdued evening, before my dad returned to home in London. 

It was several months before my dad came back to Kabul, to find the bottle reinstated back in the lounge. Once he had quit drinking, Arjun had been ostracized by a large part of the drinking Sikh community, who also happened to be the majority of his business partners and colleagues. Facing economic ruin he had come back around. The bottle came back and the well lubricated parties recommenced. However goodbyes were now done in the lounge, not from the verandah.

Christmas 1977

Luke had just been thrown out of his parents house two weeks before Christmas, he was 17. He moved in with some friends living in a squat in Brixton with no running water or working toilets.

I knew him from college, we liked the same type of music, hung out with the same people. He was trying to make it as a musician in the burgeoning punk scene, first as a singer and more successfully as a drummer. He was solidly built with a shock of blonde hair and prominent cheek bones. There was a soft charming side to him that was usually hidden below the loutish posturing that we all practiced.

He disappeared from college for a while when things went downhill at home. There was some problem at home was with his step father, it ended with Luke getting thrown out of the house with little more than the clothes on his back.

He  still wanted to buy his mother something for Christmas though. His dole money had not come through yet, and he only had a few coins to get food. His plan was that we would go up to London, busk the underground to raise funds. He had a student rail card, so that covered the cost of the train fare, once we got there we would start at Waterloo station and then head to the Embankment. I would bring a guitar, he would bring his mouth organ, we’d play some blues and hopefully get about 20 pounds in a couple of hours.

Luke was two hours late showing up to the station as he had missed the train. We decided to start in the tunnel connecting the Shell building and the South Bank with Waterloo. This was not really a tunnel, but more of a covered pedestrian walkway

It had already got dark, and there was a freezing wind blowing through the tunnel. My guitar was not loud enough, we had no tunes to play, just some chords over which Luke would blow.  The commuters would come in clumps of people as the trains emptied out, we would see people coming and start playing, a few people acknowledged us, most ignored us.

The good busking sites are very competitive, people come early to snag the good spots, our spot had no competition, but we did get moved on by the railway police. We next tried the Embankment tube station, the tunnels were long and occasional blasts of wind would come through as trains went though the tunnel under the Thames, followed by a shuffling crowd of commuters It was not as exposed as the Waterloo tunnel, but we only collected 20p or so in our time there before we were moved on. I knew Embankment well, I frequently walked through there on my way back from seeing bands at the Lyceum ballroom on the Strand. At night when the trains would get cancelled or would come late, it was quicker to walk the two miles across the Thames to Waterloo. We would come out of the concert hall, soaked though and starving. On the way through Embankment we would pass hundreds of homeless people sleeping under the railway arches.

It was getting late. With the little money we had in our pockets and what we had come with, we bought some beer and got on the warm train to go home. I saw him a few weeks later, propping up the bar at a gig. He’d got a job drumming for a band with a single out, he was on the dole, things were looking up. His career took off for a short while as a drummer with a one of the more popular second rate Punk bands of the era, they recently had a reunion tour, but he was not on the bill.

Steamers

It was the end of a long day at the Notting Hill Carnival, I had walked back down the Portobello Road towards Notting Hill Gate tube station after spending most of the day down at the Ladbroke Grove end of Portobello. This was the early eighties, the riots at the Carnival and heavy police presence were yet to come, but with a half million in attendance, there still seemed to be police everywhere. I was at the more touristy end of Portobello, the end with the antique shops and pubs. The Ladbroke Grove end, had some funky record stores and Caribean food shops, a tube station and the Westway – a raised freeway into Central London booming overhead.

I stood down a side street of the main road. It was hot and I was thirsty after walking for hours to check out the reggae and hip hop sound systems around and under the Westway. I had been coming to this part of London for several years, there had been recent gentrification around Ladbroke Grove, many of the illegal squats had been replaced with upmarket homes, but come carnival at the end of August there were still a reassuring number of dread locked heads that made an appearance, stalls selling curried goat, and walls of enormous speakers from the local sound systems battling it out with volume and the skills of the their MCs.

I stood at near a pub, it was tempting to go in, but it was overflowing with people, and so I stayed outside enjoying the air, and contemplating the long train ride back home. It was early evening people were smiling and laughing. There was a police man and woman chatting with the crowd.

From further down the street a gang of steamers came on. They ran in single file at high speed, and with the numbers of people around they appeared instantly front the crowd and vanished back into it. They were all in their late teens, dressed in t shirts with slacks and trainers. Smart but casual, the choice of brands would have identified which part of London they were from, if I had had enough time to identify them. As they ran, they appeared to be reaching out and gently touching people in the crowd, each touch was a necklace or brooch that was taken. A woman talking to the policeman lost a brooch, a couple holding hands a necklace. The crowd was lethargic and sated after a day enjoying the carnival, no one reacted until the steamers were out of sight.

No blood was spilt, but the violation left the victims subdued and shocked. There was no response not even from the police, they were gone so fast, all that was left was to go home.

Memorable Meals #2

I was staying in the Loire valley and was at something of a loose end, I got an invitation to go with a friend to have dinner with her dentist. We arrived at a small chateau, and met the  dentist and his family. 

 The dentist was from Dahomey, an African country I only knew about from the Victorian explorer Richard Burton, who had written two slim volumes about his travels amongst the cannibals and slave traders of that region. The dentists wife was a charming French lady, and they had a young son and daughter.

The chateau was under construction – they were in the process of building it, and had been working at it for some ten years already, it looked as though they had another twenty years to go to complete it. They were working on the bedrooms but had completed the huge lounge and dining room where we sat to have dinner. At one end there was a huge fire place. The large garden surrounding the chateau had a well tended garden that supplied most of the vegetables for our dinner.

Dinner was a formal French sit down affair, which meant that there were at least seven courses, with wine, and the meal itself lasted for many hours. The dentist was a very warm and gregarious host, smiling, and laughing unrestrainedly at stories, his and ours, and clearly delighting in the company of both his guests and family. So maybe not such formal a dinner, but all the better for it.

 As it was late in the year, it got colder as the evening wore on and our host lit a huge fire in the large fireplace, and then started to play some of his favorite music, jazz of which he had an extensive collection – he was a complete fan. He started with Rahsaan Roland Kirk, but quickly went to John Coltrane, a particular favorite. It was at about time after about three hours, after the cheese course, with the fire roaring that I dozed off. Fortunately I woke for the dessert course.

Amritsar Cafe

The food was good, very good in fact, I vaguely  remember enjoying the Lassi, but other than that I have no other recollection of the wonderful food we were served. 

The restaurant in the Amritsar bazaar was so old that the building itself had collapsed, from what looked like benign neglect. The simple solution had been to move the kitchen out of the collapsed building into the street, and continue cooking there, while serving meals to customers who were seated between the new kitchen and the collapsed back of the restaurant. While you enjoyed your meal, you were also able to enjoy the view of collapsed masonry, rafters and plaster, with rats running up and down them at regular intervals. 

 

As far as I could tell the food was good and well prepared, in fact everything was prepared in front of us, the cooking utensils were spotless, it was as good and probably cleaner than many of the meals we had already eaten on this trip, I did not get sick, although after 6 weeks on the road I had already had suffered from diarrhea  so bad I thought I would get turned inside out. 

 

Amritsar was just across the border from Pakistan, crossing the border at Waga we had been greeted by a large Sihk border guard with a splendid mustache and beard. To speed our passage he was presented with a couple of bottles of scotch and perfume to help speed passage through the customs check. He proceeded to pour the contents of the perfume bottle into his beard, which was so thick and large that it completely absorbed the full bottle without spilling any. Satisfied with this improvement , we were speedily discharged to India. Coming out of the customs shed, we crossed to the road to the only store on the border. 

At most major airports and border crossings you will find duty free shops, at that time there were none of these at the Waga border crossing, but there was a large Indian Milk Marketing board store. We bought some bottles of milk and were on our way. 

 

Getting Started with STAF

I’ve used STAF in a several engagements where I’m tasked with building a distributed testing framework. STAF will give you a platform that you can build on to top off. Its one of those kitchen sink frameworks that takes a while to get ramped up on, and has more than you ever use. I find myself using a small percentage of its tools, wrappering them in Python, and ignoring most of its fancy features. Extensive documentation can be found here http://staf.sourceforge.net/docs.php
I’ve found that it takes a while for people to get started, so this article give you some simple examples to get started and get something working. I’m going to ignore all the fancy features, you can read about them in your infinite free time and figure out how to integrate them into your applications at your leisure. We’ll start off with getting a simple example script running and then using integrating it with Pythons unittest module.

STAF comes with a core that is for the most part implemented in C++. Several services are provided, that come as part of the default install or can be added on later, these might be implemented in Java, C, C++ or Perl, Python.
http://staf.sourceforge.net/current/STAFCMDS.htm
http://staf.sourceforge.net/current/stafsdg.html

I’m going to ignore all but two of these, the FS and Process services. The process service will allow me to kick off program on remote machines, and get the output. The FS service will allow me to upload files to those hosts.
Once you have a basic set up with STAF running on a number of hosts, you can then kick off tests on several hosts at the same time,  collect logs and clean up. For the most part I’m only interested in leveraging STAF’s ability to provide facilities for executing remote procedures, with maybe the occasional call to the FS service to move some small number of files around. Because. The programs I’m writing may also be interacting with VMWare Vcenter, virtual machines, and a database. Its been  sufficient to have everything written as Python libraries that are imported by the test cases that my users have set up.

To get started install the latest version of STAF. I’m going to assume that you are running on some sort of Linux system, as thats what my examples are written on. In a nutshell the install process is download the installation package for your architecture and operating system. Then run the installer – on Windows, double click it, on Unix do something like `sudo sh STAF345-setup-linux.bin’. Accept all the defaults and that should be it.
http://staf.sourceforge.net/current/STAFInstall.pdf

Once its installed, the only thing that I will change is to modify the configuration file /usr/local/staf/bin/STAF.cfg or C:\STAF\bin\STAF.cfg:
Modify the line

# Set default local trust
trust machine local://local level 5

To be

# Set default local trust
trust default level 5

From a security point of view this leaves your test system wide open with the most promiscuous setting, but it will also allow you to run programs remotely from a different host. If you are on a closed test network, this should not be a problem, as always consult the extensive documentation at

http://staf.sourceforge.net/docs.php

At this point restart your staf service:

/usr/local/staf/startSTAFProc.sh

If you are on Windows you can find the appropriate start/stop combination under START menu. On Unix you will find that the command returned , created a file called nohup.out, but probably did not start. You will need to set the environment for STAF to find its libraries

source  /usr/local/staf/STAFEnv.sh
/usr/local/staf/startSTAFProc.sh

See this link for setting scripts up /etc/init.d to start and stop STAF at boot and shutdown.
http://www.mail-archive.com/staf-users@lists.sourceforge.net/msg01066.html

you should be good to go. You can verify that its running by doing:

STAF <host ip address> ping ping

steve@herat:~/projects/staf$ staf  localhost ping ping
Response
--------
PONG

This will verify that its up and running

staf localhost PROCESS START SHELL COMMAND 'ls -l /' WAIT RETURNSTDOUT STDERRTOSTDOUT

or

staf localhost PROCESS START SHELL COMMAND 'dir C:\' WAIT RETURNSTDOUT STDERRTOSTDOUT

This will verify that you can run remote commands on the system

steve@herat:~/projects/staf$ staf localhost PROCESS START SHELL COMMAND 'ls -l /' WAIT RETURNSTDOUT STDERRTOSTDOUT
Response
--------
{
  Return Code: 0
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : total 96
drwxr-xr-x   2 root root  4096 2010-11-08 09:27 bin
drwxr-xr-x   3 root root  4096 2010-11-08 10:10 boot
drwxr-xr-x   2 root root  4096 2010-11-03 11:46 cdrom
...

At this point you should have a system with STAF installed and configured.
I’ll continue using localhost to illustrate the commands, but it should
be easy to see that you can change all the instances of `localhost’ to the host
where you want to run the commands.

If you look at the documentation there is a source code example that has many interesting features
that at some point you will get to:
http://staf.sourceforge.net/current/STAFPython.htm#Header_Examples

I found myself wading through this example of what is really a comprehensive unit test. If you are like
me with a very short deadline (usually missed) and need to run tests that kick of programs on a remote host
then then you could do something like:

from PySTAF import *
import sys

def createHandle():
    handle = None
    try:
        handle = STAFHandle('foo')
    except STAFException, e:
        print "Error registering with STAF, RC: %d, Result: %s" % (e.rc, e.result)
        sys.exit(e.rc)
    return handle

def  runCommand(handle, host, comm):
    command = "START SHELL COMMAND %s  WAIT RETURNSTDOUT STDERRTOSTDOUT " % (comm)
    result = handle.submit(host, 'PROCESS', command)
    if (result.rc != STAFResult.Ok):
        print "Error on ping request."
    mc = unmarshall(result.result)
    ro = mc.getRootObject()
    data = ro['fileList'][0]['data']
    print "Received RC: %d, Result: %s" % (result.rc, data)

if __name__ == '__main__':
    handle = createHandle()
    runCommand(handle, 'localhost', 'ls -l /')
    runCommand(handle, 'localhost', 'netstat -a')
    runCommand(handle, 'localhost', 'ifconfig')

This bare bones example will run the commands on the localhost and print the output. Not
very sophisticated, but enough to get you started.

You may need to modify your environment to run it:

 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/staf/lib
 export PYTHONPATH=$PYTHONPATH:/usr/local/staf/lib

There is much you can accomplish with this example.
To make it a little more useful, you can leverage the python unit test tools. You may need to install
these separately onto your system.

from PySTAF import *
import unittest
import sys

class SimpleTest(unittest.TestCase):
    def setUp(self):
        self.createHandle()

    def createHandle(self):
        handle = None
        try:
            handle = STAFHandle('foo')
        except STAFException, e:
            print "Error registering with STAF, RC: %d, Result: %s" % (e.rc, e.result)
            sys.exit(e.rc)
        self.handle = handle

    def  runCommand(self, host, comm):
        command = "START SHELL COMMAND %s  WAIT RETURNSTDOUT STDERRTOSTDOUT " % (comm)
        result = self.handle.submit(host, 'PROCESS', command)
        if (result.rc != STAFResult.Ok):
            print "Error on ping request."
        mc = unmarshall(result.result)
        ro = mc.getRootObject()
        data = ro['fileList'][0]['data']
        return data

    def testLs1(self):
        out = self.runCommand('localhost', 'ls  /vmlinuz')
        self.assertEqual(out, '/vmlinuz\n')

    def testLs2s(self):
        out = self.runCommand('localhost', 'ls  /initrd.img')
        self.assertEqual(out, '/initrd.img\n')

if __name__ == '__main__':
    unittest.main()

This is just a rewrite of the first script. I modified it to be object oriented
as test suite requires that you create a class, with each test case defined as a
method in that class. The setup method is run before the other methods and we create the
STAF handle that will be used by all the test cases.
The details on the test suite module can be found here:
http://docs.python.org/library/unittest.html

More to follow …

Just another WordPress.com site