The Power of Small Wins

When you are not winning, you just have to get momentum back in small wins. – Sam Altman, CEO of OpenAI Sam Altman said that once in a lecture about Start-ups, I only discover how amazing the Small Wins are recently. A company called me yesterday, and said that they would love to arrange me a Python coding interview. Then they’ll give a comprehensive consideration from there. It’s an online coding interview that has no deadline, no human supervisor, only problem sets and an editor....

July 31, 2021

How do I ask questions

This is an ongoing article, If I don’t know the answer to a question, I will ask. To save time for both of us, I assure you that before consulting: I looked up resources like official documentation, Google, and Stack Overflow. I have given it thought. I spent at least 20 minutes on 1 and 2. When I ask: I understand that you know the solution or might know someone who does....

July 19, 2021

Who Ate My Cheese

I saw this code no long ago lock = threading.Lock() # some code if some_condition: with lock: if some_condition: # some code The same condition checked twice before and after the lock aquired and released. It took me a while to think through this, and you’ll probably see something simular if you do coding with threads. Let me explain why is it. Imagine in a world, there are only Tom and Jerry...

May 29, 2021

What is the WORKDIR keyword in the Dockerfile

The WORKDIR is directory where you’ll do your RUN command or CMD command. to find out, create the image with the simple Dockerfile below FROM nginx:latest WORKDIR /some/path/to/some/file/and/if/not/exists/it/will/create/it/ RUN touch create_a_file.md when you do docker container run -it mynginx bash youl’ll find yourself in the directory /some/path/to/some/file/and/if/not/exists/it/will/create/it. and if you do ls, you’ll find there’s a file called create_a_file.md in the directory. You can change the WORKDIR many times to preform different tasks in the Dockerfile....

February 8, 2021

Calculate Vector Normal to a Plane, Explain with Code

To find a normal to a plane, We need at least three points on the plane, or two vectors Here are the steps: if you have three points p1, p2, p3, you need to obtain two vectors from these points find the corss product from these two vectors Explain using code import numpy as np # numpy is a python package that allows you do matrix operation # we can use array([x, y, z]) to define some points p1 = np....

February 8, 2021

How to Install/Enable Openssh on Linux

Step 1: Install OpenSSH Server Software Package sudo yum –y install openssh-server openssh-clients Step 2: Starting SSH Service sudo systemctl start openssh-server Step 3: Check sshd status sudo systemctl status sshd To stop the service sudo systemctl stop sshd To enable OpenSSH service sudo systemctl enable sshd For Ubuntu First, update the system package sudo apt-get update Then, install the openssh server sudo apt-get install openssh-server To enable the service $\neq$ To start the service....

February 8, 2021