A Dharmic Discussion

I was discussing about the 4 classes defined in the Hindu dhrama as traditionally followed. My friend was under the impression that the Brahmins are priests, Kshatriyas were kings, Vaishyas were merchants and Shudras were lowly servants.

In my mind, this is a drastic oversimplification-to-the-point-of-stupidity. In fact the whole meaning of Hindu heritage is lost if this is the foolishness being taught / spread by the so-called modern ‘educated’ common man.

Now here’s the truth as I understand it. Naturally this may not agree with your perception… That’s fine, it’s my thoughts alone.

Brahmins are fundamentally the intellectuals. As we know today, this includes doctors, teachers, philosophers, theologians – keepers and givers of specialist knowledge. Quite clearly these are the most respected group of people in today’s world irrespective of religion.

Kshatriyas are fundamentally the politicians. I don’t mean the corrupt bucket of greed that we see around – a real Kshatriya would be expected to govern a vast land, manage and maintain a protection/expedition force (army), prepare advisories for the common people in the matters of economy and so on. Heck even today the President is the Commander in Chief of the armed forces in most countries!!! It’s exactly the SAME, again irrespective of religion!!

Vaishyas are fundamentally the managers, innovators, entrepreneurs. YES, ancient India had a special class called “entrepreneurs” – and they used to create, manage and operate businesses. They had a good sense for numbers and could create trades around currency or commodities (today: forex, stock exchange, commodity exchanges), in addition to creating organizational structures for each vertical, marketing the products, warehousing and supply chain management – and they did this at an ASIA-WIDE level (they travelled as far Arabia to the west and China to the east – the northern scope of the travels remains somewhat a mystery). You get these across all religions as well! No surprise there.

Shudras are the working class, the salaried class. The nearest equivalent word in modern Hindi is “Naukar” and this classification includes anyone who works for a salary (i.e. they have a ‘Job’ or a ‘Naukri’). The concept is similar to the concept of the Salary man. The usual difference is that the job undertaken used to be passed on from generation to generation… Some scum even undertook slavery – but this is an abnormality that I believe detracts from the core concept.

Possibly, in today’s world, we have possibly more freedom to transition between these categories. However it may not surprise you to know that 70-80% of people (across religions) take up salaried jobs. And even historically, the Shudras were the largest category – simply because they were the salaried class as we have today.

Naturally the all went to the Brahmins to learn core skills. The Kshatriya wanted to learn literature, martial arts/self defence, psychology, and management. Vaishyas wished to learn mathematics & statistics – and possibly transport management methods. Shudras wished to gain knowledge that would help them progress in their specific job – whatever the job was assigned by their reporting manager.

Likewise everyone visited the Kshatriya for his guidance on regional governance or political clout (i.e. ‘connections’) assistance. For example a Vaishya starting a new trade route. Shudras requested job opportunities in governance roles. And the Brahmin asked for methods to both gather & disemminate knowledge (eg. ‘temples of learning’ – that we know today as schools)

A Vaishya was the quintessential trader – he would help the Brahmin find the best rates to build their local temple, assist the Kshatriya in getting (for example) quality manufactured goods, and transportation for it. The Shudra would provide the manpower – transportation, wares display, moving material to/from the warehouse – for example. Naturally everyone would buy food / clothing from a Vaishya somewhere….

A Shudra had the most important job of all – they were the staff key to any business, or venture – and Vaishyas always had a never-ending need for good staff. Everyone genuinely needed their help as guides & interpreters, huntsmen & farmers, builders & artisans. Yes, a Vaishya would get the contract – but the actual carving / construction was done by his staff. Kshatriyas and Brahmins alike needed staff for various things – from fetching milk (handyman/gofer) to taking care of the elderly (nurses/caretakers).

So I say – nothing has changed. Everyone whether they realize it or not fall into these categories by their own choice.

I agree that a lot of bad stuff happened – some merchants got greedy and exploited their staff, some corrupt politicians robbed the people of quality governance, and some corrupt educators denied people their right to education. Ego, vanity, greed, and all the other vices as we know them today…. Sadly they have corrupted our knowledge of a fairly well-structured economic model.

As you can also plainly see, the distinctions are entirely self-made, and go beyond the concept of religion, race or anything else – they exist even today across the world, and there’s not a single thing we humans do that cannot be classified as per this way-of-life.

The ‘Techie Code’ for Business Leaders

Simplified TechSpeak for the Technically Befuddled

Thanks for reading my book. I hope it brought real value to you – and helped you recognize opportunities / gaps where your business can evolve & grow. This page is a list of credits and references for the book.

Google’s research about the digital experience in shops

Why a website is needed

My research on ‘Technology utilization patterns and business growth in Small/Medium Enterprises’ at Cornell University’s arXiv

Chaitanya Dhareshwar, 2018 June – Technology utilization patterns and business growth in Small/Medium Enterprises

Identifying what’s crap in your BLOATED PHP site and what’s not

  1. Register a shutdown function ref: http://php.net/manual/en/function.register-shutdown-function.php
  2. Call “get_included_files”
    ref: http://php.net/manual/en/function.get-included-files.php
  3. Save the returned file list to a log somewhere on your server.

This shouldn’t affect the response times – but be warned, it WILL generate higher disk I/O (which might in turn bottleneck at peak usage times).

Don’t let the size of the log file go up too much. Ensure crons/schedulers or any background processes use this shutdown function.


function shutdown()
 $included_files = get_included_files();
 foreach ($included_files as $filename) {
 $xyzzy .= "$filename\n";
 file_put_contents($_SERVER['DOCUMENT_ROOT']."/shutdownlogger/incfiles.txt", $xyzzy, FILE_APPEND );


Blocking countries that you wish to exclude

A long time back, we found that none of our products and services are applicable to the Chinese and Korean market. However my mail servers continued to get a lot of spam from these sources – which was weird!

At some point I came across Okean (www.okean.com)  and started using their list to prevent access from such sources. I find it works great; and here’s the NETSH command used to perform the block on a windows box:

netsh advfirewall firewall add rule name="IP Block" dir=in interface=any action=block remoteip=x.x.x.x/32


Transferring servers

  • Compress all unused / extra-low-usage stuff and ship it out first
  • DNS

Bulk transfer is the best way to do this.

  1. Use DNSCMD to bulk list all zones
  2. Allow them to transfer to a secondary
    dnscmd . /ZoneResetSecondaries testing.com /NonSecure
  3. Add them to the new server as secondary
    dnscmd . /ZoneAdd testing.com /Secondary (old-server-IP) /file testing.com.dns
  4. Give them 48 hours to sync correctly, optionally expand each zone and confirm that it’s actually synced
  5. Convert to primary
    dnscmd . /zoneresettype testing.com /primary /file testing.com.dns
  6. use this VBS script to ensure all the records are converted = old IP, = new IP

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & _
    Set colItems = objWMIService.ExecQuery("Select * from MicrosoftDNS_AType")
    For Each objItem in colItems
    If objItem.RecordData = "" then
    dim zone
    zone = objItem.ContainerName
    dim rr 
    rr = Replace(objItem.OwnerName,"." & objItem.ContainerName,"")
    if rr=zone then
     rr=zone & "."
    end if 
    Wscript.Echo "dnscmd /recorddelete " & zone & " " & rr & " A /F "
    Wscript.Echo "dnscmd /recordadd " & zone & " " & rr & " A "
    End If 
  • IIS

Use the IIS bulk transfer tool. This moves everything including SSLs and whatnot – but it does not move dependencies. You will need to ensure dependencies are installed using Web Platform installer else you won’t have a track record of what’s there & what’s not.

BUT it does not work for > 4GB sizes. Batch transfers get tricky as the new transfer may negatively impact the past imports…

  1. Use the Server > Management > Shared Configuration  option to export the config only
  2. Transfer the files by hand
  3. On the new box, use Server > Management > Shared Configuration to import the config.
  4. Note: Username/password relates to folder security and NOT the file encryption password.
  5. Install PHP as per your preference – I use 5.3.9 MSI installer for convenience. DO NOT select “ALL extensions” – keep it default and add more as you NEED to. Some of them malfunction causing whole PHP framework to crash.
  6. Be sure to install all the VC++ libraries needed by PHP. This is very confusing and I chose to install ALL varieties (x86 AND x64, VC9, VC11, VC15) and then it worked smoothly. Doesnt take long to install though.
  7. ASP.NET – is uber smooth. Grab it through Web Platform installer and its a zero effort setup.

Anonymous logins cause a lot more trouble than it’s worth. Use this script to fix the issue permanently:

Dim Siteobj
Dim Site
Dim SiteName
Dim SiteId

Set SiteObj = GetObject("IIS://localhost/W3SVC")

for each Site in Siteobj
 If Site.keytype="IIsWebServer" Then 
 if Site.AnonymousUserName<>"" then
 WScript.Echo Site.ServerComment
 WScript.Echo Site.AuthAnonymous


end if 
 End if 

Beware: If you do the bulk transfer without taking care of dependencies, you WILL corrupt your IIS install. It’s harder to fix after that…

  • Database

Be sure to install database and ODBC drivers – the new ACE oledb driver (ref: http://stackoverflow.com/questions/6649363/microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine) won’t work unless you install these 4 links
(I chose the 32bit version, which means in IIS application pool you’ll need to enable 32-bit execution)

Make backups “BAK” of all SQL databases and immediately thereafter delete the database / stop the server. This way the transfer state will remain consistent.

Refer to http://solutioncenter.apexsql.com/transfer-sql-logins-for-users-with-a-large-number-of-sql-authenticated-logins/ to ensure you know how to get the users list across. This article is superb for ready-to-use code too: https://support.microsoft.com/en-gb/kb/918992

Finally use this script: https://msdn.microsoft.com/en-in/library/ms187858.aspx

For MySQL:

  • do a full script export and stop the server

    mysqldump –all-databases -u root -p > mysql.txt

  • do an import on the new server

    mysql -u root -p < mysql.txt

For MongoDB: its SUPER EASY! I so love this.

  • do a mongodump and stop the server
  • mongorestore on the new server – voila! Instant running.


New found love for Fantasy Cricket

I’ve always hated cricket. No seriously – I lost matches and had such a poor experience playing cricket that I genuinely hated cricket all through school and college. However I could never understand the passion when people watch a match, or play a match themselves… So I thought I should at least make an honest effort to figure this out. I mean cricket IS the most popular game in India after all 🙂

The game itself is no biggie – standard 11 players per team, little leagues, big leagues, ODIs and Tests and so much more… But that’s the usual stuff. What really grabbed me was the Fantasy Cricket thing. It sounded like betting, and it sounded like gambling – but as I dug deeper I found that, per a court directive, cricket betting requires such great skill in selection of players that it’s actually qualified as a game of skill!

The annual market for cricket betting is estimated as USD 11 billion across the globe. This is from relatively recent news mentions on this topic (and the fact remains that some part of this is not conducted legally so I’ll just leave that piece out). The clean income from fantasy cricket is expected to exceed USD 2 billion this year. I wanted to get into the game and make my own millions (maybe not billions; but 1/1000th of that is still pretty good right?) so I started researching this angle.

What I found is this:

  • A fantasy cricket user chooses their 11 players from the squad for a given match.
  • When the real live game commences, your game is on the move as well.
  • For each run scored, wicket taken, the players you’ve chosen will earn you points!
  • Now obviously you need a serious level of skill to recognize which player will do well; thus you’re not betting on the game; you’re counting on your own incredible cricket skill.
  • Finally when all the points are pulled together, you may win various prizes based on the outcome
  • People earn as much as 7000-13000 from a single game!!

BUT – the website that runs the fantasy cricket tournament earns even more. So I got to thinking, maybe I need to create a “fantasy cricket” website instead. Now my programming skill may not be enough; but I’ve learned a lot about the fantasy cricket api and data sources in the process:

  • Cricinfo and the other sites are quite useless – I can get some data from them but I never get accurate player-wise scoring data to use for my game.
  • There are API providers who can be very expensive when it comes to fantasy API
  • The best API I could get at a really cheap rate (and 1000 hits free on signup) was the one from www.cricapi.com – and I was instantly a fan of their really cool Fantasy API! Which is why I’m endorsing them here.
  • You need to be careful how often you want to get the API data; manage expectations upfront. Tell users they will get their score updates every 10 minutes or whatever – don’t overload your servers to give a second-to-second update.
  • Once your have your data, you want to calculate the outcome of each match and store it in a database
  • Then when the match is over, or preferably the day AFTER the match is over, compare the data in your database and announce the winners!

So this is a bit of simple math. If I take Rs 100 from each player for a reward of Rs 2000 to the winner, and I get 30 people to play the fantasy cricket (which is easy enough for me to get) – I get to keep a cool Rs 1000 per match. Now that’s good money specially during the major tournaments! Also based on the logic I make I can calculate winners for each Innings of the match, and maybe make even more moolah.

Naturally I’m looking for great people who can help me program this and share the profits; but mainly I’m putting this up because I feel it’s a great way to earn, and it’s totally non-competitive. You can run it in your local clubs etc which will never impact me negatively; I may run it in my friends circle which will never impact you negatively. It’s a win-win-win!!

If you’re a great coder who wants to work with me on this contact me on chaitanyabd@gmail.com – but if you’re trying to make your own fantasy site you can drop me a line as well and I’ll try to help you out where I can.

Bacchas today and how we fret about it

Was in the train today, when the kid standing at the door was ABOUT to fall. I managed to grab his bag and pulled him in. The kid of course was grateful etc.

So I asked him

Me: Are you trying to prove a point standing on the footboard?
Kid: No

Me: Fighting cancer or something?
Kid: No

Me: Making a case for the downtrodden or the poor or the drought struck?
Kid: No. I didn’t know there was a drought

Me: Do you have parents or siblings?
Kid: Yes mom & dad work at (some bank) and 2 brothers in college

On hearing this, I totally lost it.

Kid: College ke liye late ho raha tha

Kid: 🙁 sorry sir

Some passers by mumbled about how today’s generation / millenials have no value for their own life – but anyways maybe 25-30 years later he’ll take the opportunity to screech at some other stupid kid… maybe make a difference that way.

I didn’t note the kid’s details. Didn’t even ask his name. This was 11th of April 2016 around 8:50 AM.

Call to a member function getIsGlobal() on a non-object

We came across this while using the Advanced Dataflow profiles in Magento


PHP Fatal error:  Call to a member function getIsGlobal() on a non-object in /var/www/html/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php on line 173


Finally narrowed it down to a missing column in the CSV sheet!! Hope this helps you if you’re having the same issue. Was 8-9 hours hard effort to figure out what broke and then it came down to a silly error 🙁

Research about my Internet and e-Governance research!