Month: September 2013

Is this the best we can do?

This is a post that has been in the works for a while, even though I have not been able to find a way to frame it in a manner that is to my liking. It does not cover the usual tech/early stage/digital topics that I prefer to write about here. In a sense, it actually does cover all of them, but it goes a little bit further than that.
The time since June this year has really been quite an intense one, mostly thanks to a complete switch to focusing only on executing plans made over the past year. Somewhere in that time period I stopped logging into Twitter (I don’t have Facebook/G+ accounts other than ones I keep for work) to intensify the effort to get more done as I’m really prone to getting distracted easily. The idea also was to hit a few targets before I allowed myself to be active on Twitter. Some of those targets have been met, while others have not (that’s a post for later) and even though I have started lurking on-and-off on Twitter these days, something about the state of affairs in this very (digitally) social age bothers me.
The question that keeps coming back to me is: “Is this the best we can do?”
If you look at the history of mankind, this very moment that you are reading these words is the most enabled entire societies have been able to do good. A vast chunk of humanity carry in their pockets more computing power than what was available to an individual, irrespective of the money, even as recently as 50-years-ago. We have access to information, at practically zero cost, on our fingertips, the creation and access for which  tens and thousands have fought and died for in earlier times. We can connect and communicate with others, sitting half way across the globe, at the speed of light, while 50-years-ago, two-way-communication was still a marvel of technology that was accessible to a handful of people.
All of this should have made better people of us. We should have be more open, considerate and warmer towards our fellow beings. Yet, for how all of this should have enabled us, we only seem to have grown a stronger sense of entitlement. As people, we communicate more (actively and passively); yet, we are more isolated from each other than ever before. All this technology should enable governments to serve who they truly serve — the people — a lot better; yet, the same technology is being used to shackle people than to free them.
This, I must stress, is not a holier-than-thou exposition on my part. In the past months I have had fleeting episodes where I could set aside my own limitations, prejudices and conditioning to reflect on the life that I have lived and the values that I have lived by and it is not a pretty picture. I have often reveled in being sarcastic, dismissive and not doing even 1/10th of what I could really do. I am as much part of the problem as anyone else is and my disappointment is with myself as much as it is with anyone else.
We think of legacies as what we leave behind at a particular point in time. We are wrong in thinking that. Our legacy is what we create over a lifetime of individual moments. If we are not living the best lives we can live and be the best that we can be through most of our lives, chances are that our legacies are not what we would ideally have liked it to be. We also leave the fate of our legacies to circumstances, bosses, political leadership and and a million other factors, while the truth is that we are the only people who really control it, while anything else is just an excuse to shy away from doing what you say that needs to be done.
What is also lost in all the noise is that most of my generation is slowly progressing towards middle age. We are the age group that will determine where things go from here. Most of us are no longer twenty-year-old youngsters who really don’t wield much influence. A lot of us are in places and positions of influence and if we truly desire a world that is better, we should use that influence in a better manner than just sit on the sidelines lamenting how wrong things are.
And it need not even be about going out there and starting a revolution. It is about stepping up, taking the responsibility towards your immediate environment. Be nicer to people,  be more helpful. Help others succeed while you chart your own course for success. Be less negative and snarky. You have far more with you than what most others have and to get more you need to first learn to give more; not just that what can be touched, but also that cannot be touched.
At least, that is what I feel. That it is not enough to just want better things for myself, but also for the world around me and back it up with action. A first small step towards that for me is stop being negative, cranky and being proud of being an ass. In the end, for me, it is about using these great tools I have been provided with, in a better manner. Yes, the world usually uses these same tools in a negative manner, but I can choose to use the same things in a different way and that’s my first step small step.

Filed under: Uncategorized

Scaling Notifications On Elgg To Support Rich, Context-Aware Emails

One of the core aspects of a social networking site is its ability to notify its users by leveraging different frameworks. Social networks that have complex access restrictions are entirely different beasts to build and scale compared to sites that are either mostly open, or are those where the content generation can only be done by a handful of users.
I have been running an Elgg site for an old client since 2009, which is a private gated network. At an early stage itself we ran into problems with the newsletter that had to go out to the entire user base. This was from a time when products like MailChimp were not an option and we were also working with a fairly limited budget. At the first stage, we mitigated the problem by using a job queue that was built on MySQL.
As any engineer will tell you that a job queue based on an RDBMS that can only run one worker, or even worse depends heavily on locking to run multiple workers is not a job queue. Eventually, it will cause more trouble than what it is worth and that is what we got into. Besides, as an Elgg site grows and you introduce more features to it, something that can farm out jobs and handle them asyc is worth its weight in gold.
Eventually, I wound up creating a simple set-up using Beanstalkd. The notification handler and the generic mail handlers are overwritten to add jobs to the Beanstalk queue and a PHP worker job (managed by Supervisord) processes the jobs in the background. I could go a level deeper and even leave out the individual job creation to Beanstalk itself, but the current approach seems to be holding up well for the moment, so, that next step can easily wait for a while longer.
Couple of pitfalls you need to watch out for, should you attempt to do the same thing:
1. Content encoding. This will drive you nuts if your scripts, DB tables and the CLI environment are different in how their locales are set up. Do not assume that everything that works in the browser will work the same in CLI. It won’t.
2. Access: The CLI script loads the Elgg environment and has no user. So, be aware of any functions that use sessions to return results.
3. Valid entities: PHP will error out when faced with an attempt to call a method on a non-object. If you don’t kick or bury a job (which is not possible when the script exits with an invalid object error) that is causing the error, the script will endlessly start and stop again. You have to obsessively check every object for validity before you attempt to do anything with it.
4. Use MailCatcher on your development set up. It will save you a ton of time, even though it does make the server itself a bit sluggish.
There are few other options available in the Elgg ecosystem to do the same like Jettmail and the upcoming Async notifications feature in Elgg 1.9. But both have their own complexities and issues and I could not wait till 1.9 and I needed something that didn’t require as much fiddling as Jettmail.
It is also possible to further extend this kind of development to leverage some of the transactional email services out there to use the inbound email feature to post to Elgg with webhooks. There are, though, no plans to roll that out right now and I will update this post if we ever get around to doing that.

Filed under: TechnologyTagged with: ,

Running 3.8.0-29 Kernel On ElementaryOS Luna

After a bit of tweaking and fiddling I have managed to get the 3.8.x kernel running on the Acer Aspire V5 431. Unlike the previous time when I tried it and failed to get bcmwl-kernel-source to compile from the package manager, this time it worked with a different approach. Thanks to this post on AskUbuntu, I picked up the latest bcmwl-kernel-source (6.30.223.30) and installed it.
The package installs without any issues and it enables WiFi for the machine. If hit the problem where the driver is shown and installed and activated, yet, you can’t seem to get the WiFi going, just make sure the other WiFi modules are blacklisted and disabled.
My blacklist looks something like this:

blacklist b44
blacklist b43legacy
blacklist b43
blacklist brcm80211
blacklist brcmsmac
blacklist ssb

You also have to make sure that the ‘b43’ is commented out in cat /etc/modules if it is present there.
I have also been able to make the Huawei EC1260 Wireless Data Modem (Tata photon+ being my provider) to work with the kernel. You will need to configure usb_modeswitch for that. After which the device will show up with the 12d1:140b profile.
The profile data looks like this:

DefaultVendor= 0x12d1
DefaultProduct=0x140b
#HuaweiMode=1
MessageEndpoint=0x08
MessageContent=”55534243123456780000000000000011062000000100000000000000000000″
NeedResponse=1
CheckSuccess=10
DisableSwitching=0

The 3.8.x kernel seems to be pretty good. The machine runs a lot cooler than what it has with the 3.2.x kernel and I am yet to run into any issues. The older kernel seemed to have the odd lock-up now and then. I have not experienced that in a day or two now. It has been a wrthwhile upgrade for me.

Filed under: Technology