Posts

The journey of this blog

Image
I have always loved to read and write although I don't consider myself a writer nor claiming any closer to be a writer.

Since I remember I have always read outside the school curriculum (this was a bit weird where I grew up). When I was about 16 years old I wrote a book called "fire hut" which basically myself and other me living in a house which has 7 floors, three underground and four above ground and this house shape is like a triangle rather than the typical house which normally square or rectangle. I haven't finished this book, I shall do it one day.

In 2006 when I had my own laptop, I used to blog more often about everythings, especially technology. I changed blog domain a few times and I also changed the blog platform a few times but it's been quite while I have mehdidana.com and stuck with blogger.

Since the start, I have many up and down in writing posts, some years I wrote only one post some years I had few posts but something I am certain is that I was…

Ego is the enemy

Image
I just finished listening to a book called "Ego Is The Enemy" by Ryan Holiday, such a fantastic book. I can relate to many stories he talked about it even I had similar cases in my personal life. That is the power of a book to wake you up and teach you something you didn't know before or you were not aware of it.

Many years ago (around 2011) when social networking websites/apps were quite new and not everyone knew about it, I went to visit my cousin in another town and this time he had a new roommate, for sake of identity, let's call him Ryan.

I sat in the living room while waiting for my cousin to bring me some tea from the kitchen, Ryan entered the room.

Me: Hi, I'm Mehdi.
Ryan: Hi Mehdi, I'm Ryan, nice to meet you.

We continued typical greeting conversations then while we were talking he seems paid less attention to our conversation. since this is considered to be odd to talk to someone while you play with your handset/phone, I asked him:

Me: Are you OK?
R…

The best way to predict the future is to create it

Image
I am sure everyone knows the comfort of being on autopilot, less decision to make, apparently it's more reliable and with less potential mistakes as someone else tested and worked for them therefore it should be safe. but it is true?

But life is not that simple, although the easy way(for now) is to avoid thinking about it. To me at this points of the time (this may not be true in the future) life is a book which you need to write it so you write as you wish. You can write a sad story and make the main character a victim or write a happy story be a strong characters.


The best way to predict the future is to create it Abraham Lincoln or Peter Drucker or Alan Kay (don't matter who said it)

In summer 2016 I had an interview with a startup so few days before the interview date I was preparing myself for the interview and I came across this quote and made a note of it. When I entered the interview room, obviously I looked around the room and as my surprise I saw this frame hanging o…

I solved GCHQ puzzle and this is how I did it

Image
Today, I was reading the BBC news and I stumbled upon this GCHQ puzzle:
Take the digits 1,2,3 up to 9 in numerical order and put either a plus sign or a minus sign or neither between the digits to make a sum that adds up to 100. 

For example, one way of achieving this is: 1 + 2 + 34 - 5 + 67 - 8 + 9 = 100, which uses six plusses and minuses. What is the fewest number of plusses and minuses you need to do this?

I love to challenge myself with these kind of puzzles, so I solved this and here is how:

We have 9 numbers [1 to 9] and also we have three possible separators [+, - and nothing] which to fill the gap between numbers we have 8 combinations of separators, e.g. we have 1+2+3+4+5+6+7-89 which in this case we have six times plus, one minus and one time nothing.
So, I need to find all possibilities of combination which total is: 6561

Then, hook the possible combinations into numbers and check the total, easy enough. Now print the solution.

I have written this algorithm in PHP but easil…

Why Prestashop needs improvement for large application?

Image
I have worked with Prestashop 1.6 long enough to know inside/outside of the application and even I developed few modules myself, all is simple and great but in small scale. My application is big, I am talking about millions rows in database. Two databases weight almost 18G (see the picture).

One day at 2AM I received a notification that my website/application is down. I looked at the server the application seems OK but the databases gone crazy big, (see the picture) it has gone from 18G to over 90G less than 6 hours. 
Since there was almost none free space left on the server, all server running really slow even I could not restart NGINX. All was frozen. All my websites/applications run on dedicated server on UKFast, so none of websites would work because all is glued together. 
There are many issues here, e.g. the server infrastructure is wrong (I know that already), there should be monitoring service in place which there was no such thing (I know that too) etc. but why this happened,…

Why I don't have social media account?

Image
Just to be clear, I do not have any social media accounts except LinkedIn. No Facebook, Twitter, Instagram etc. 
I used to use some of them but I dropped them all before 2013 and now I am clean for over 4 years. I kept LinkedIn because I use for business contact only.
Today, I came cross this video and found quite interesting as I agree with what he says. 

I always said, the social media website/app specially Facebook and Instagram are just a game. It's funny how some users write the fake status which they don't believe it themselves but other believe it and vice versa. 
If you are making money or adding value to your life by using these apps, then use it otherwise don't kid yourself and just get rid of them, simply. I know it's hard in the beginning but trust me, it worth it, you are not alone. 


The living treasure 1

Image
A water bearer had two large pots, each hung on each end of a pole which he carried across his neck. One of the pots had a crack in it, and while the other pot was perfect and always delivered a full portion of water at the end of the long walk from the stream to the master’s house, the cracked pot arrived only half full.

For a full two years this went on daily, with the bearer delivering only one and a half pots full of water in his master’s house. Of course, the perfect pot was proud of its accomplishments.
But the poor cracked pot was ashamed of its own imperfection, and miserable that it was able to accomplish only half of what it had been made to do. After two years of what it perceived to be a bitter failure, it spoke to the water bearer one day by the stream.
“I am ashamed of myself, and I want to apologize to you.”
“Why?” asked the bearer. “What are you ashamed of?”
“I have been able, for these past two years, to deliver only half my load because this crack in my side causes …