The E-Myth Revisited by Michael E. Gerber

One of my goal with this new blog is to organize my thoughts and knowledge. The E-Myth Revisited by Michael Gerber is a recent book I listened. So I will start with it.

My biggest takeaway from this book was that most people start business to create a job for themselves. For example, a person who enjoys baking may start a cake shop. The problem with this approach is that one is working in the business, not on it. The right way to start a business is with a goal of eliminating one’s job. For example, the person above should figure out a way to hire someone else to do baking.

This was a slightly hard lesson to digest because as programmer, I have often dreamed about starting consulting business. Mostly, so that I get to work with more interesting technologies.

The other lessons were:

Establish Processes & Document Everything

Create a business that can be easily franchised. In order for a business to be franchisable, it needs processes and systems. So document and create repeatable processes. You may never want to franchise, but well-established processes will help a business run smoother.

How to choose business

This was another interesting way to figure out what sort of business one should pursue.

  1. Start with your life’s goal. Of course, life’s goals change but choose something for now. It could be something like spend more time with family and volunteer at homeless shelter. It could be to own a biggest house in the town.
  2. Now choose your business strategy that will help you achieve your life’s goals. It could be a business that you can sell in a few years for $10 Million. Or it could be a business that can run on its own with minimal involvement from you and generate $100K yearly income.
  3. Finally, look at business opportunities. The first requirement for any business is revenues. Then see if it aligns with your business strategy. If your strategy is to generate semi-passive income while traveling the world, then pursuing a Silicon Valley style startup is probably not a good idea.

Write Job Descriptions

Another interesting idea presented was to write down all positions you see your business will need eventually. Draw organization chart. Then start hiring for each position. Initially, you will be filling all these positions, from CEO to lowest ranking worker. Your goal should be to work in each position, systemize it, and hire someone else. You should start filling positions at the bottom of chart first, slowly moving up as you systemize each position.

Manage by Delegation

One last point, many first time business owners manage by absenteeism once they hire someone. This usually doesn’t end well as employees then have no idea if they are doing good or not. Before you hire someone, their position should have well defined criterias to measure against. And you should actively review work done by your direct reports.


If you like to read this book, you can purchase it here using my Affiliate Link:

HSTS & NET::ERR_CERT_COMMON_NAME_INVALID

Without understanding, I had enabled HSTS on amerkhalid.com with option includeSubDomains. I had a subdomain that was used as “Custom Domain” to SmugMug site. After enabling HSTS, these subdomains started to throw NET::ERR_CERT_COMMON_NAME_INVALID.

The fix is of course simple, don’t use includeSubDomains. But that opens up your top level domain to man in middle attacks.

For now, I decided to follow the best practices and leave includeSubDomains enabled. And decided to not use custom domain for my SmugMug site.

Lastly, you can clear HSTS settings in Chrome by:

  1. Enter in Address Bar chrome://net-internals/#hsts
  2. Under “Delete domain” type your domain
  3. Hit “Delete” button.

 

Error: xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory is a command line tools instance

I have been playing with Cordova lately and was getting this error when building iOS version:

Error: xcode-select: error: tool 'xcodebuild' requires Xcode, 
but active developer directory is a command line tools instance

Even full install of Xcode didn’t fix this error.

The solution was to run following command to use full Xcode instead of command line tools version that I had installed earlier:

sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer

The Subtle Art of Not Giving a F*ck

I learned of Mark Manson through his blog, especially this post, 7 Strange Questions That Help You Find Your Purpose. Since then I have been on and off following his blog. He usually has a lot of good advice, so finally I decided to get his book. Makes it easier to have all information in one place.

I had no idea what Subtle Art of Not Giving a F*ck was about. It was an impulse purchase, perhaps to support his blog. It turns out to be a really good book. As a semi-regular reader of his blog, I sort of knew what his philosophies were. Still it was good to read everything in one place.

He is not encouraging to not care about anything but to care about things that matter. It is human nature to care. But a lot of us start to worry about things that don’t matter. Sometimes, it is because we have nothing to care about. For example, elderly lady in retirement home who has all her needs met, would get really pissed if her coupon is not accepted at super market because that is all she got.

Sometimes, we care about useless issues because real issues are too hard to deal with. For example, unemployed person may go back to school for their 3rd degree just because they are unable to get a job.

The basic idea is everyone cares about something but is it the right thing. His philosophy is very similar to Stoicism or even Buddhism philosophy.

The book is written well and easy to read. If anything negative, I would say that he is a bit verbose. Some of stories in it dragged on a bit too long. For example, when he was in his principle’s office, it was clear about what was going to happen but he dragged on that scene a bit too much.

Overall, I highly recommend this book especially if you are interested in some sort of self-help book.

The War of Art

I wasn’t sure what to expect when I picked up “The War of Art” by Steven Pressfield. It shows up on Hacker’s News and other entrepreneurs’ forums regularly as a recommended reading. Steven Pressfield is a novelist but this book is popular reading for anyone who is pursuing a goal.

The author’s main point is that the most important and the hardest thing is doing. Weather that be sitting down at desk to write a novel or software. Once you are at your desk, or at your office, the hard part is done. This can apply to anything; fitness, painting, photography, etc.

Things that make you the most nervous about doing; are probably the most important things. If these were not important to you, then you would not feel resistance when attempting these things.

One last piece of advice that I really liked was from Bhagwagita. It says that one has no right to their fruit of labor, only their labor. Basically, one should work hard without any expectations of reward. If they are lucky, their work will bring them all kind of rewards such money, fame, respect. But if they don’t get anything in return for their work, then so be it. They should do work for work’s sake and nothing else.

 

How to Fail at almost Everything & Still Win Big

How to Fail at almost Everything but still Win Big by Scott Adams (affiliate link) comes up on Hackers’ News a lot. Finally, I had a chance to read it.

This is a little different kind of book compared to my regular reads about ultra-successful business titans. I had no idea who Scott Adams was until I heard about this book. He created Dilbert comic. He gave very down to earth perspective on how he achieved success in this book.

Basically, he started various ventures throughout his life including restaurants, websites, etc. Eventually, he started getting traction on his Dilbert comics, so that became his number one focus which led to even more success. He developed passion for comics & art as his comic got more popular and earned him financial success.

The main takeaways for me are try try again, you will fail at most things, passion grows as project grows.

 

Magento – Get All Products with Categories in a Flat View

SELECT 
    w1.website_id,
    w1.name as website_name,
    s1.store_id,
    s1.name as store_name,
    p1.entity_id as product_id,
    p1.sku,
    pname.value as product_name,
    url.value as url_path,
    small_image.value as small_image,
    msrp.value as msrp_price,
    price.value as price,
    p1.created_at as product_created_at,
    p1.updated_at as product_updated_at,
    visibility.value as visibility,
    pstatus.value as status,
    case
        when
            (pstatus.value = 1
                and visibility.value > 1)
        then
            1
        else 0
    end as enable_flag,
    c1.entity_id as category_id,
    cname.value as category_name,
    c1.parent_id,
    c1.created_at as category_created_at,
    c1.updated_at as category_updated_at
FROM
    catalog_product_entity p1
        inner join
    eav_attribute p_attr ON p1.entity_type_id = p_attr.entity_type_id
        and p_attr.attribute_code = 'name'
        inner join
    catalog_product_entity_varchar pname ON pname.entity_id = p1.entity_id
        and pname.attribute_id = p_attr.attribute_id
        inner join
    eav_attribute p_attr2 ON p1.entity_type_id = p_attr2.entity_type_id
        and p_attr2.attribute_code = 'url_path'
        inner join
    catalog_product_entity_varchar url ON url.entity_id = p1.entity_id
        and url.attribute_id = p_attr2.attribute_id
        and pname.store_id = url.store_id
        inner join
    eav_attribute p_attr3 ON p1.entity_type_id = p_attr3.entity_type_id
        and p_attr3.attribute_code = 'small_image'
        inner join
    catalog_product_entity_varchar small_image ON small_image.entity_id = p1.entity_id
        and small_image.attribute_id = p_attr3.attribute_id
        and pname.store_id = small_image.store_id
        inner join
    eav_attribute p_attr4 ON p1.entity_type_id = p_attr4.entity_type_id
        and p_attr4.attribute_code = 'msrp'
        inner join
    catalog_product_entity_decimal msrp ON msrp.entity_id = p1.entity_id
        and msrp.attribute_id = p_attr4.attribute_id
        and pname.store_id = msrp.store_id
        inner join
    eav_attribute p_attr5 ON p1.entity_type_id = p_attr5.entity_type_id
        and p_attr5.attribute_code = 'price'
        inner join
    catalog_product_entity_decimal price ON price.entity_id = p1.entity_id
        and price.attribute_id = p_attr5.attribute_id
        and pname.store_id = price.store_id
        inner join
    eav_attribute p_attr6 ON p1.entity_type_id = p_attr6.entity_type_id
        and p_attr6.attribute_code = 'visibility'
        inner join
    catalog_product_entity_int visibility ON visibility.entity_id = p1.entity_id
        and visibility.attribute_id = p_attr6.attribute_id
        and pname.store_id = visibility.store_id
        inner join
    eav_attribute p_attr7 ON p1.entity_type_id = p_attr7.entity_type_id
        and p_attr7.attribute_code = 'status'
        inner join
    catalog_product_entity_int pstatus ON pstatus.entity_id = p1.entity_id
        and pstatus.attribute_id = p_attr7.attribute_id
        and pname.store_id = pstatus.store_id
        inner join
    catalog_category_product ccp ON ccp.product_id = p1.entity_id
        inner join
    catalog_category_entity c1 ON c1.entity_id = ccp.category_id
        inner join
    eav_attribute c_attr ON c1.entity_type_id = c_attr.entity_type_id
        and c_attr.attribute_code = 'name'
        inner join
    catalog_category_entity_varchar cname ON cname.entity_id = c1.entity_id
        and cname.attribute_id = c_attr.attribute_id
        and pname.store_id = cname.store_id
        inner join
    catalog_category_product_index store1 ON store1.product_id = p1.entity_id
        and store1.category_id = c1.entity_id
        inner join
    core_store s1 ON store1.store_id = s1.store_id
        inner join
    core_website w1 ON s1.website_id = w1.website_id