11/6/12

Estranged in my own land!

Today, I will take a little break from political analysis to rant a bit about my vacation woes. My particular problem is unlikely to be of direct relevance to the greatest majority of Egyptians who are struggling to gain some mastery over their future and trying to eke out a decent existence in a very cruel economic environment. Continue reading if you allow me a degree of self indulgence.

Having decided that I desperately needed a respite from the madness of Cairo and the political malaise  and growing pains and  that the country is going through, I headed south. I sought peace and tranquility in Soma Bay an incredibly beautiful resort that I have been frequenting for years. This is I decided to spoil myself a bit and stay at the exquisite Kempinski Hotel. A wonderful place that I would strongly recommend to all my friends.

My trouble started when I decided to do some a bit of windsurfing with a friend of mine, who happens to be champion surfer and a winner of numerous awards in competitions in Egypt. We went to a surf center that was conveniently close to our hotel. It was managed by the the well regarded Robinson Club. However, our experience there was nothing short of agitating.

It started with the overtly blasé staff member who explained that we really can not use their equipment without going through an orientation session the following day. They then went on to explain that have there own clock, they operate in a time zone that is in sync with Berlin, not Cairo. We were given a time to drop by the following day for their so called “orientation” session. Note that the club is not in anyway particularly remarkable, it nothing more than a fancy shack with a non-impressive storage space for windsurfing and sailing equipment, it was not like we are going to be handling deadly chemicals. We were also told by this unfriendly guy that a license is need if we were to use there catamarans, but that windsurfing  would be okay. We were summarily given their price list (pretty standard) and the guy walked away to carry out more pressing duties (such a picking his toes, ….or so it seemed!).

My friend and I were not too happy with such treatment, but we decided to shrug it off, a couple of hours surfing the bay would surely make us for such nastiness. We were also pretty mad about this whole time zone thing and how it is disrespectful to our country, but decided that we fight out this battle latter. After all we are supposed to be on a vacation.

We showed up the next day at what we thought was the appointed time. We were told that we got the time zones wrong and that we have to wait for another hour. After waiting we were promptly asked by another equally unfriendly member of staff if we carried a windsurfing license to which we replied that his colleague (now mysteriously vanished!) told us the day before that it was okay. That new super rude guy then  said “Sorry, our rules!” and he shooed away with  a hand wave and proceed to help his German customers. When we tried to explain to him that this does not make sense and that this is unacceptable, he dismissed us with a shout in thick German accent “I TALK TO YOU …LATER!”

We latter complained to our hotel, who got us in touch with a manager in charge at Robinson club, who offered nothing more than saying “I am sorry!”.  This reeks of racism. It seems to me that they were making ridiculous rules just to keep the locals ways. It would be easier if they just put up a sign at their entrance:

Dogs and Locals are not welcome!

The Kempinski’s  guest relationship manager was truly embarrassed by what had happened and was very upset with attitude of the people at Robinson club. She arranged for us to do windsurfing at the Sheraton’s surf center where the Egyptian staff there were incredibly friendly and helpful. So our story had a happy ending, but with a unpleasant  latent bitterness.

10/17/12

The limits of tolerance

As I observed the ugly events of Friday, I had trouble swallowing the argument that all sides were plain wrong. To my mind it was the MB who was the instigator in all of this. Their thuggery, dishonesty, and their relentless desire to fully appropriate Tahrir is the primary cause of clashes.

Intolerance exists in every faction, but more so amongst those who claim to have a divine mission. They see those who disagree with them as apostates. Liberals, on the hand, have no problem with what others think or believe so long as they do not trespass on their own rights.

The recent conflagration was primarily about the MB trying to restrict the rights of others to object. It started there and ugliness on all sides ensued. I hoped that the battle for the constitution would be carried out through rational debate. I see now that there many religious conservatives would rather conduct this battle via a street fight.

The tectonic plates of modern Egyptian culture have collided at Tahrir. The stresses are building and left to its own devices, an Earthquake in bound to ensue. In their voracious pursuit of power and hegemony, the MB have effectively killed  the cross cultural/class dialog that characterized the early days of the revolution.

10/2/12

Using Python and wget to download certain file types from a web-page

Recently I wanted to download all the movies in Mackay’s information theory course. That was a great deal of files and I though it would too tedious to try to do it using the browser or even manual wget. So digging around, I found this decent tutorial on python HTML processing. I also dug around some information on parsing URLs. I combined that with my knowledge of python’s subprocess and put together this nice piece of code.

 

#!/usr/bin/python

import sgmllib

class MyParser(sgmllib.SGMLParser):
"A simple parser class."

def parse(self, s):
"Parse the given string 's'."
self.feed(s)
self.close()

def __init__(self, verbose=0):
"Initialise an object, passing 'verbose' to the superclass."

sgmllib.SGMLParser.__init__(self, verbose)
self.hyperlinks = []

def start_a(self, attributes):
"Process a hyperlink and its 'attributes'."

for name, value in attributes:
if name == "href":
self.hyperlinks.append(value)

def get_hyperlinks(self):
"Return the list of hyperlinks."

return self.hyperlinks

import urllib, sgmllib

# Get something to work with.
webPage="http://www.inference.phy.cam.ac.uk/itprnn_lectures/"
f = urllib.urlopen(webPage)
s = f.read()

# Try and process the page.
# The class should have been defined first, remember.
myparser = MyParser()
myparser.parse(s)

# Get the hyperlinks.
links=myparser.get_hyperlinks()
print links

movies=[x for x in links if x.endswith('mp4')]
print movies

import urlparse
movieURLs=[urlparse.urljoin(webPage,x) for x in movies]
print movieURLs

from subprocess import call

for movieURL in movieURLs:
call(["wget -c "+movieURL],shell=True)
09/30/12

Mutating your MAC address

Recently I was at an airport that offered free WiFi for the first 15 minutes, afterwards the system asked you pay. I knew that they must be checking identity via MAC address, so I wrote this little nifty python script that changes it to some random value each time you call it. This would only work on Linux (or maybe a MAC) OS.
I am not suggesting that you violate any laws, I put this up for educational purposes. Use it at your own risk.
For obtaining the MAC address through python, I used synthesizerpatel‘s code snippet. Alternatively the MAC address could have been obtained via a system call ifconfig using “subprocess.Popen”, as described in here.

 #!/usr/bin/python  
   
 import fcntl, socket, struct, random  
 from subprocess import call  
   
 def getHwAddr(ifname):  
   s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)  
   info = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', ifname[:15]))  
   return ''.join(['%02x:' % ord(char) for char in info[18:24]])[:-1]  
   
   
 a=getHwAddr('wlan0')  
 i=random.randint(2,5)  
 b=a[:3*i]+hex((int(a.split(':')[i])+random.randint(1,255))%255)[2:].zfill(2)+a[(i+1)*3-1:]  
   
 print "Changing from "+a+" to "+b  
 call(["sudo ifconfig wlan0 down"],shell=True)  
 call(["sudo ifconfig wlan0 hw ether "+b],shell=True)  
 call(["sudo ifconfig wlan0 up"],shell=True)  
   
08/13/12

Changing the rules of the game

Morsi turned out to be a mastermind at scheming and hatching plots and making bold moves. In one swoop he:

  1. Neutered the dreaded SCAF
  2. Cut sweet deals with high members of the judiciary and the military 
  3. Singlehandedly canceled  amendments to the constitutional declaration and even rewrote bits of the constitutional declaration to give him more power

The events that transpired yesterday is still leaving many with their heads spinning. None expected the mighty SCAF could be so easily displace. Very few are questioning if his moves are legal or constitutional. Among the ranks of the revolutionaries, many are just happy to see SCAF gone, and that an elected president is asserting his powers. With regards to ridding rough-shoot over legal constraints, the logic is  “SCAF has already  done that before, many times, so why not a elected president”.

Yesterday, Morsi managed transform himself from a fumbling president to a national (or even supranational) leader. His powers seem to expanding without limit. During last night’s speech his tone, demeanor and words seemed to be of someone who is trying to attain full spiritual and corporeal powers in the manner of the “rightly guided caliphs” in the early days of Islam. He made sweeping allusions to the wider Muslim Ummah and the important role the Egypt must play in it. Morsi alluded to the divine mandate under which he sees himself operating. His said:

Islam has everything we need as we progress to stability, security, safety, renaissance, and development…. we move towards and better tomorrow. Do not worry, for it is God who protects this Ummah, not by my work, but through his will.

Morsi clearly sees himself as the executer of  divine will and the man most capable of gleaning solutions to the nation’s troubles via his elevated reading of Islam. Some went as far as seeing his speech as a veiled declaration of the “Islamic Republic of Egypt”. The new Caliph is in town, he gets make new rules and execute them at will. 

Many do not yet see it, but this is bad news for the revolution and the revolutionaries. Combining executive and legislation powers and having substantial influence over the judiciary is quite worrying. Morsi has more power than Mubarak ever did. History teaches us that power,once obtained, is rarely ceded without a fight.

08/12/12

Deflecting Criticism

If somebody raises an important and valid point with regards to a given political situation or fumbling leadership, the standard responses by many of the fans of the status quo to detract from the serious issues at hand is:

1. Where were you when X happened
2. In the past you did X or Y and hence have been labeled Z. How dare you bring that up now
3. Political group A or B used to do something similar while you looked on, how come you are now complaining
4. Your criticism stems from the fact that you HATE us, so it can not be taken seriously
5. Mr. A or Mrs. B who are universally acknowledged as scumbags are voicing a similar sounding criticism, hence your perspective on the matter has to be wrong.

All to these patterned responses would either put on the defensive or steer the discussion away from the issue that you are raising. Hence, shouting matches ensue, angry words are exchanged, frustration peaks and …. the issue remains unresolved.

If you are lucky enough to manage to neutralize all of  above points while maintaining a modicum of civility, the final line of defense is:

6. In this or that country they are also having a similar messy situation, why do you expect that we should be any better?

At this point my advice would be to just walk away from the discussion. Continuing at the point is likely to cause an artery to burst.

08/6/12

The fumbling president

The tide of mass frustration is welling up in Egypt once more. Most people did not have high hopes for president Morsi. Those who knew the complexities of the highly entangled governmental bureaucracy were highly skeptical of the electoral  promises for the first 100 days of his presidency.  However, it is quite surprising to many that he is fumbling so badly.

Lets go through litany of frustrations:

  1. Morsi formed a ministerial cabinet that is widely perceived to reflect his ideological leaning with little attention payed to competence or experiance
  2. Daily blackouts in major cities with little understanding of the root cause or the why the government did such a poor job at capacity planning. It also does not help that Morsi promised increase the flow of electricity to his friends in Gaza.
  3. Morsi is dragging his feet in releasing political prisoners that have been detained by SCAF and tried in sham military courts, yet he promptly pardon jihadists  who have been implicated in terror cases well before the revolution. 
  4. Morsi did little to quell the sectarian strife that  has flared up in Dahshur. It is believed by many that inaction in this matter will give rise to widespread attacks against Copts.
  5. The recent attack on Egyptian soldiers on the Gaza border. Morsi was slow to react and his administration did little to clarify what has really transpired to the population. 

Morsi will continue to be the lightening for anger and criticism if he continues to fails  at communicating with the country’s citizens. He seems to follow Mubark’s style of perpetual vagueness and opacity. As a member of an underground organization for most of his life, Morsi it grossly inept at being transparent or making the government in general more transparent.  His leadership abilities are now being questioned by many.

 Morsi’s Islamist supporters  try hard to spin his actions into something more palatable, yet the president seems determined to shoot himself in foot and presenting himself as a gruff rookie. Their frantic defense is eroding the little of what is of their credibility.

If Morsi were continue along the current trajectory, it is highly unlikely that he will survive his four year term.

07/23/12

The trouble with our right brained revolution

In Ian McGilchrist’s master piece “The Master and his Emissary: The Divided Brain and the Making of the Western World” a brilliant exposition is made of the functional divisions of the brain, but more importantly between two modes of experiencing the world that are often in conflict with each other. The right hemisphere with it focus on synthesis and connection on the broadest universal sense and the left hemisphere with its focus on breaking things up and narrow attention. That conflict is beautifully captured in a fable (attributed to Nietzsche) the goes

There was one a wise spiritual master, who was the ruler of a small but prosperous domain, and who was known for his selfless devotion to his people. As his people flourished and grew in number, the bounds of this small domain spread; and it with it the need to trust implicit the emissaries he sent to ensure the safety of it ever more distant parts. It was not just that it was impossible for him personally to order all that needed to be dealt with: as he wisely saw, he needed to keep his distance from, and remain ignorant of, such concerns. And so he nurtured and trained carefully his emissaries, in order that they could be trusted. Eventually, however, his cleverest and most ambitious vizier, the one he most trusted to do his work, began to see himself as the master, and used his position to advance his own wealth and influence. He saw his master’s temperance and forbearance as weakness, not wisdom, and on his mission on the the master’s behalf, adopted his mantle as his own – the emissary became contemptuous of his master. And so it came about that the master was usurped, the people were duped, the domain became a tyranny; and eventually it collapsed in ruins.

The master (right hemisphere) has been usurped by the emissary (left hemisphere), such has been the tragedy of our times. We live in “[a]n increasingly mechanistic, fragmented, decontextualised word, marked by unwarranted optimism mixed with paranoia and a feeling of emptiness”. It is a case of a “dysfunctional left hemisphere” dominating our experience of the world  

The impetus of the Egyptian revolution as I experienced it, was clearly of the right brained variety. There were no plan,  script, or grand idea that roused noble passions. It was, as McGilchrist would put it “essentially involv[ing] a certain disposition, the disposition to experience sorrow at the other’s misfortune… To be just is to be disturbed by injustice. Pain, suffering, and the loss of pleasure, then, sometimes constitute who we are and what we value. They are essentially woven into our deepest commitments. As reasons flow from our deepest commitments, we will sometimes have non-instrumental reason to suffer.”

It was the pain and suffering that we experienced during the revolution that made many of us feel  more human, more willing sacrifice our physical being for something with a touch of the divine. Something electrified our right hemispheres and awaken in us a fresh, yet somewhat latent, vision of reality. What that “something” is? Words fail at capturing it. It feels to me that the attempt to describe it would limit it, defile it, and cheapen it.  This is beautifully put by McGilchrist

Making things explicit is the equivalent of focusing on the workings, at the expense of the work, the medium at the expense of the message. Once opaque, the plane of attention is in the wrong place, as it we focused on the mechanics of the play, not on the substance of the play itself; or on the plane of the canvas, not what is seen there. 

Yes, we cried in Tahrir for “bread, freedom, and social justice”, but the words have since been prey to demagogic abuse and political manipulation. It was the process, the mechanism, the prime cause that gave rise to those words and a myriad of creative expressions in Tahrir we should have protected and preserved. We now seems to be chasing phantoms of that humanizing force. Mere shadows, distortions, and reflections and not the pure light itself.

Today marks the 60th anniversary of the 23 July revolution. A purely left brained affair. Young officers planned, schemed, and calculated to maximize their personal self-interest. The young officers lacked little in terms of rational ability. They often fumbled, but their rational motives were always clear. Their drive to dominate was a purely selfish affair, no empathy, no love of other, and no altruism. The current ruling Junta (SCAF) are a byproduct of the earlier revolution. We rose against those mechanical men, who can only conceive of a world were people are spurs and gears in a diabolical machines of their construction. Devoid of creative abilities their machines jammed and broke down and yet they continue to fix them. They are prisoners of their hackneyed mental constructions.

Many who truly witnessed the revolution of 2011 still believe in their hearts that another world is possible. It was a world that they had a glimpse of in the 18 days following January 25, 2011. But it is also a world that they failed to protect. The rise of Islamists now represents yet an another manifestation of the lifeless and mechanical vision of the world. Yet, it is far more insidious. It makes appeals to that which gives meaning and beauty to the lives of many. In its ascent it will lay barren fertile fields of human values. Religion, like many things that are of crucial importance to our human existence

…cannot withstand being too closely attended to, since their nature is to be indirect or implicit. Forcing them into explicitness changes their nature completely, so that in such cases what we come to think we know ‘certainly’ is in fact not truly known at all. Too much self-awarness destroys not just spontaneity, but the quality that makes things live; …. religious devotion [can hence] become  mechanical, lifeless, and may grind to a half if we are too self-aware.

With each passing day, I feel the memory of the early days in Tahrir ebbing away. The sublime beauty of the experience is giving way self-doubt and disbelief. The noise of the immediate is becoming overbearing. A noise that captures the attention of the left brain. Through innumerable logical (yet mostly fake and self-serving) contraptions the limits of what is possible are being drawn. How will our right brained revolution survive as its pathos gradually slips away from mass consciousness? 

In the absence of truly inspired artists, all that will remain will be some slogans with continually diminishing potency, as smattering of confused ideological posturing, and dreams that can not “be make explicit” lost in the detritus of time.

I can only pray that the following statement will hold true: “The spirit grows, [and] strength is restored, by wounding”

Increscunt animi, virescit volnere virtus
06/20/12

إين خط الدفاع عن الثورة المصرية؟

أشعر انه يتم استدراجنا الآن إلي معارك ليس لها علاقة بالثورة و أهدافها. الناتج من هذه المعارك هو تقسيم كعكة السلطة بين أطراف عندهم مصلحة في بقاء منظومة الاستبداد التي ثار لتحطيمها المصريون في يناير 2011. 
كان لهتاف “الشعب يريد إسقاط النظام” في الثورة دلالات عميقة تتعدي تنحي حسني مبارك عن رئاسة الجمهورية. منظومة الاستبداد كانت ترتكز علي أربع دعائم هي:
  • عدم الشفافية: لم يكن يعلم الشعب ما يحدث في دهاليز السلطة حيث تحدد مصائره.
  • الانعزالية: كان هناك إحساس عام بالضعف و قلة الحيلة و عدم القدرة علي علي توصيل الآلام و المعانة و الأحلام ل”أولي الأمر”.
  • الهيمنة المطلقة: كانت النظام يسعي لأن يكون المتحكم الذي ليس له منازع في مصائر الخلق. كان هناك إحباط لمحاولات المبادرة الفردية أو الجماعية. حتي المؤسسات الغير حكومية كانت تعاني من تدخل سافر من الدولة في عملها و حرية حركتها.
  • تزييف الوعي: كان النظام يقوم بحملات منظمة لنشر أكاذيبه و إعطاء الإنطباع  انه يعمل من الأجل الشعب و مصالحه في مواجهة قوى خفية تريد الشر لمصر. كان أحد محفزات الثورة أن النظام فقد القدرة علي تطوير أدائه في ظل التطور الرهيب الذي حدث في سبل الاتصالات في العقد السابق.
 هذه الدعائم أدت بدورها لانتشار المحسوبية و الفساد لدرجة جعلت الحياة اليومية للمواطن العادي لا تطاق.  لهذا هتفنا “عيش، حرية، عدالة اجتماعية” في الثورة و نحن نعترض علي الناتج الطبيعي لهذه المنظومة.
 الآن نري جماعة الإخوان في أوج صراع عنيف من أجل السلطة و ليس من الغريب أن نري كثير من الثوار منحاز إلي الجماعة في هذا الصراع المحموم. العسكر هم من قتل و سحل و عري و عذب و أعتقل من بعد التنحي. الإخوان و إن كانوا تخلوا عن رفقائهم في الثورة  لم تلطخ أيديهم بالدماء (علي الأقل بالشكل المباشر).  قد يبدوا لكثيرون أنهم أولي بالتأيد في هذه اللحظة. هذا علي أساس انه يمكننا أن بعد نساعدهم في سحب كل مقاليد السلطة من العسكر أن نكمل صراعنا معهم كمدنيين أمثالنا.
 أرى في ذلك سقطة فكرية و منهجية شديدة. في قراءتي لأحداث ما بعد التنحي أري أن الإخوان هم شديدي الحرص علي الحفاظ علي الدعائم الأربعة السالف ذكرها. آري في تنظيم الإخوان الداخلي تكريس لهذه الدعائم و لهذا لا أستطيع أن أراهم محطمون لها. و إن كنت أرى في بعض شبابهم بصيص لبادرة أمل و لكن قياداتهم لا أمل فيهم و لا رجاء.
صراع القوى القائم اليوم بين الإخوان و العسكر ليس له علاقة بما أراه انه الهدف الرئيسي المستتر لقيام الثورة و هو:

بناء نظام سياسي و اقتصادي  بتميز بالشفافية و الانفتاح و يتيح لأفراد المجتمع كامل الحرية في اتخاذ المبادرات الإصلاحية و العمل لحل مشاكل الوطن بشكل جمعي. 

هذا الهدف يستحيل تحقيه طالما لم تهدم دعائم الاستبداد.  لا أري جدوي من إهدار الثوار لمجهوداتهم في “حروب رمزية” ضد المجلس العسكري أو أن يهبوا لمساعدة الإخوان طالما إن هناك غياب للرؤية في كيفية تحطيم هذا الدعائم. الأفضل هو استغلال اللحظة لرسم مسار لتحطيم هذه الدعائم العفنة و استبدالها بدعائم أكثر نبلاً و فاعلية لتحقيق أمال المصريين في إطلاق طاقاتهم الإبداعية و الإصلاحية. 
الهتاف في التحرير ضد النتائج الطبيعية لمنظومة الاستبداد لن يغير من الواقع شيئ طالما لم تصحبه رؤية واضحة لخلق نظام أفضل. المعركة الآن يجب أن تكون من أجل خلق  دعائم لنظام جديد و نشر التوافق عليه.
06/19/12

Where is the Front Line of the Egyptian Revolution?

We are now being dragged in battles that are of marginal significance to the  aims to the Egyptian revolution. They only alter the distribution of power amongst parties that have a vested interest in maintaining the very same political structure and web of interests that Egyptians revolted against a year and a half ago.

One of he prominent rallying calls of the revolution was “the people want to bring the system down”. The major features of the system where:

  • Opacity: nobody had a clue of what goes on the in corridors of powers where  destinies were being shaped.
  • Insularism: the population felt helpless and that the voices are not heard and their needs are not answered. There was a general feeling that a things were getting worse, not much could be done about it.
  • Overbearingness: the state was the all powerful and would stifle any attempts of independent or group action. NGO work was often restricted and subject to intrusive governmental oversight. 
  • Duplicitousness: the state promoted lies and engaged in disinformation campaigns to justify its existence. It made life difficult for dissenters and free thinkers and tried to isolate (and when no one was looking eliminate) them to prevent any nascent challenge to their authority. 

Those feature gave rise to cronyism and wide spread corruption that made daily  life very bleak for the average Egyptian. Hence, the popular chant in the early days “Bread, Freedom, and Social Justice”. Now the Muslim Brotherhood (MB) is  engaged in a power struggle with the Supreme Council of the Armed Forces (SCAF). Both of them have shown very clearly, during the past year and a half, that they are eager to maintain the promulgate  those features.

The power struggle between MB and SCAF has little bearing on what I see as the a key implicit demand of Egyptian revolution:

To create an open and transparent econo-political system with maximum latitude for popular initiative and collective problem solving.

This can never come about while the above features remain intact. I do not see it worth the effort of the revolutionaries to engage in “symbolic wars” against SCAF or to come to the aide MB as long as those features remain intact. There should be instead a concerted intellectual effort to chart and path that would  eliminate those rotten features and supplanting them by novel and efficient ones.

Chanting in Tahrir against the symptoms (or emergent properties) of the said features will not bring about positive change. The battle now is for outlining a clear plan for system wide transition and forming popular consensus about it.