Extending VirtualBoxes Virtual hard Drive

I usually have one Windows available in hand in a VM. Knowing windows, it would eat all the hard drive you dedicate to it. So at the setup time I decided to give it a flexible size but maximum of 25GB, which seemed fair for Windows 7. But now that I have had it for a while it got quite big and when I wanted to install a new application, I was running out of space.

Extending an existing drive is not possible, but the whole process to achieve what’s needed is very very simple. All you need to is:

  1. Go to VM’s setting / storage and create a new bigger storage, which would be your only HDD
  2. clone the hard drive from the old one to the new one. Here is the VirtualBox’s command:
    $VBoxManage  clonehd /Path/to/old/Windows7.vdi  /path/to/new/Win7_30GB.vdi --existing
  3. Now remove the HDD from your existing VM. (VM/Setting/Storage)
  4. Add your new HDD to the VM.
  5. Boot the VM
  6. In the guest OS, go to “Control Panel/ Administrative Tools/ Computer Management/ Storage”   and you should be able to see the extra space as unallocated. Just extend the existing drive to the maximum to use it

Enjoy your extended HDD.

Why I believe “Coursera, blocking access from sanctioned countries” is bad? Really bad!

Today my country’s name was on home page of Hacker News. Wow! It feels great to see your country’s being mentioned. For a country that even on many websites’ forms it is not even listed to choose as your country. Has it ever happened to you to fill a form and choose your country as “Other…” in a list of over a 180 countries? It’s really painful, you feel like are not even being seen.

But today, “Iran” was on home page of Hacker news. It felt good on the first sight. But only on the first sight. It was the news that Coursera is blocking access for students from Iran, Cuba, Sudan and Syria. [link]

This is what they mention as the main reason:

Certain aspects of Coursera’s course offerings are considered services and are therefore subject to restrictions in sanctioned countries

I understand that is the US law and they want to be safe. But I always had the impression that Coursera has a very ambitious goal in its heart: “Best courses, for free, for everyone!”. Well the later is not applicable anymore. It won’t be for “everyone”.

I don’t support the Iranian government and their behaviours which are causing all these sanctions, but a sanction like this is terrible. Who is paying the price for such a sanction? Isn’t the purpose of all these sanctions to prevent the government from continuing their nuclear program? I think on the contrary, this one works completely in their favour:

Sanction on Education!

What could be possibly worse than this?

Sanction on food? It is very harsh, the poor would starve, but it’s possible to work around it.

Sanction on medication? Yes it is terrible and people are struggling with it by paying with their lives. But even that is not as horrible as “Sanction on Education”.

I believe if something is going to change in Iran, it will be through education, through a very slow process of an ancient nation educating itself to take better care of itself. To grow. To live and to live freely. To learn the democracy.

In a society which all the education is controlled by government, this will never happen. Government’s golden age relies on ignorance of people. They censor the books and the movies. They filter the internet. They decide what you can or can not read, watch or even think.
In such situation having access to education without any burden and with no charge, is like finding the Treasure box. Or maybe even more valuable.

One may think, what Coursera was offering couldn’t lead to any of these. I should oppose you.

If i learn about “Drugs and Brain”, I would never go close to the drugs, and will educate my acquaintances about it as well.
If I attend a course on “World music”, I might have few words to say, which could be interesting for some.
If i will be more informed about “How to change the world”, I might really do something that does.
and if I learn more about “Global Sustainable Energy”, I may eventually realize that my country doesn’t need nuclear energy, there are plenty of other resources.

Those are the baby steps that takes for change. Indeed, it is slow. But that’s the only way. No revolution has ever worked for the benefit of the revolutionaries. Change will never happen over night.

If there is a way to the future for Iran, it is through education, period.

And today Coursera just blocked access for Students in Cuba, Iran, Sudan, and Syria.

yum behind a proxy

If you happen to be behind a corporate proxy and need to get “yum” working you could easily set your proxy settings in the “yum.conf” file. The file is usually located here:


And all you need to do is to set the following variables:

# If your proxy server happen to need user/pass credentials for Authentication

“True North PHP” Talk + Slides

The first day of TrueNorthPHP 2013 is over and there were quite interesting talks to listen and amazing people to meet.

My talk was at 11:00 AM and it went well. It was an honor for me to speak at this conference.

In case you’re interested, you can take a look at the slides on slideshare.

I submited a Talk for Confoo

I submitted a talk for Confoo 2014. The title is:

SQL or NoSQL that’s the question

With the emerge of new NoSQL databases, it’s very important to understand their abilities and the use-cases for a scalable web application. Understanding what they provide and what sort of problems they can solve is vital to successful usage of NoSQL databases in the web architectures and infra structures.

The key is that Relational Databases are not dead and they won’t be. They have specific abilities which would facilitate implementing a lot of ideas in the data modelling.

By experience, we realized that using a Hybrid system is the best solution. While you benefit from bests of the both worlds, you can improve the quality of product and availability of service to the customers.

In this presentation, an example from game-industry would be provided. A UbiSoft, Montreal game which was fully based on Relational databases, has been restructured to a Hybrid system to benefit from both Relational database and a NoSQL database.

The major design decisions, and the benefits of each would be discussed in details to give audience a perspective of what could be achieved within a Hybrid system.

The process of migrating the previous architecture to the new one in a live system, without having any downtime would be explained as well, to show how approachable and easy is this new Hybrid design.

The new architecture has been beneficial for the community of players and also for the development team, which they will be explained.

The Hybrid system has been on Production since October.2012 with no downtime since.


ConFoo. February 26 - February 28, 2014 | Montreal, Canada

JavaScript Date Object Chrome vs. Firefox

There is a very tiny yet important difference between how Chrome and Firefox treats “Date” object, when you are creating one from a String:

new Date("1980-03-14T00:00:00.0000000");

The difference is that Firefox (tested on v23.0.1) considers the passed string is on the local timezone so the output is:

new Date("1980-03-14T00:00:00.0000000").toString();
"Fri Mar 14 1980 00:00:00 GMT-0400 (Eastern Standard Time)"

While Chrome, considers the passed string in UTC/GMT timezone and then converts it to a local timezone:

new Date("1980-03-14T00:00:00.0000000").toString();
"Thu Mar 13 1980 20:00:00 GMT-0400 (Eastern Daylight Time)"

As you can see, that would be a potential for some Front-End Date/Time processing.

If you are using the Date object just for showing, using the UTC format would be very useful and would avoid any discrepancies.

var my_time =  new Date("1980-03-14T00:00:00.0000000");

Leveling up

Kate Matsudaira is one of the very few technical people who shares very beneficial knowledge and experiences for leadership, leveling up and management.

Her talk at Velocity about Leveling Up for engineers, is a very useful guide line for all tech people to set a goal and road-map for themselves to improve and be better at their work.

Here is the video of the conference and below you can find my notes.

[The following notes are a summary of what is mentioned in the video and they are not mine]

Work is not just about contributions and features. It’s not about what you do, it’s how you do it.

Figure out what you want to be doing!
Where you’re at… what are your skills. Depth is not enough. You have to have breadth. Also Social skills and soft-skills.

  1. Identify success
  2. Be specific about it – The path
  3. Create if-then-else for all the obstacles.( if I couldn’t do it this weekend I will do it Sunday)
  4. Schedule the time with yourself. Every month. to look where you are at and what you are doing.

Game Play

# Hard work
# Become indispensible to the team. Become the person who is most important to the organization. If it’s not you, so how could you become the one.
It’s not enough to do what you are told to do. You have to look to other places to contribute. Fill the gaps. Do the right things. It’s also important to do the right things.
# It’s your job to manage your manager. Asking the right questions and giving them the right questions that they need to be successful.
# Does your manager knows what you are doing?

Assessing performance

It’s about trust. How much you manager trusts you? You have to build trust.

– Do the hard work first.
– Use your time effectively.
– Work hardest in the office



be precise with the questions: What was the one thing I could have done to make the project better.
Be open to feedback :

  1. Don’t be defensive
  2. Fight the urge to jump in and answer
  3. Ask for clarification – What would you have done differently?
  4. Listen for emotion
  5. Be thankful
  6. Change and adopt

Teaming Up

  • Who is the person you admire the most at your job?
  • What do they do and what do they do differently?

When people come to you, be open. Take the time to understand what they are saying.
Bring solutions to the table.
Empathy and attitude. You have the most control about how you feel about things.

Reverse – Take the time to put yourself in others shoes.
Long term – How you feel about the situation in a year from now. If you won’t care, there no reason to get upset
Chance for growth –


  • The tone and the words you use makes a difference.
  • Improve written messages.
  • Know your audience. VP of engineering, business person, or team-mates
  • Start the message with what’s important.
  • Be concise
  • “Let me know if you would like more info”.
  • Make it easy to understand for everyone.
  • Most successful people are the ones who are able to communicate with everyone and talk at a level that’s accessible for everyone.


Making people feel important:

  1. Be present (at conferences). If you’re in a meeting, engage and be in the meeting.
  2. Repeat what you heard. You make people feel heard and important.
  3. Ask questions.
  4. Don’t interrupt


If you are not doing a good job, people don’t want to work with you and they won’t respect you.
Influence : No one cares about how much you know, until the know how much you care.
Improve relationships :
1 – Make list of the most important people in your team
2 – Make a list of people who you have best relationships with
How can you improve your relationships ?
You are the average of your 5 closest friends. and if your 5 closest friends at work are not the most important people. Improve your relationships.

Do you know 3 things you could do, to make your life and career better?

You can’t become the person who you want to be by staying who you are.