Day 3: Day with Documentations

Today I Deep Dive into the Engineering Basics Course’s Module and learnt something new and some interesting facts about the things I knew before, in the Engineering Basics Course.

Command Line Interfaces (CLI)

There is a misconception that CLI are used only by the system/network engineers . Well guess what?! that’s not true. CLI and the most powerful tool and can be used by anyone to speedup there day-to-day tasks.

There is a clear difference on why one should use the CLI. It has its own advantages. Not only it is faster and saves memory but we can also combine multiple unrelated processes together. There is a great example on combining/connecting multiple process using Unix Pipeline in this link.

WP-CLI for WordPress

WP-CLI basically allows developer to control wordpress directly through the CLI and the best part is you can do much more than what you can do through the admin GUI.

One of such example is it allows deleting multiple transient value. A transient value can be anything an object, an array or a string. more info here.

Also to start with WP_CLI, commands can be added from the piece of code below. Link to explore more.

WP_CLI::add_command( 'command sub_command', function( $args, $assoc_args ) {
    WP_CLI::success( $args[0] . ' ' . $assoc_args['append'] );
} );

CRON JOBS (schedule my time plz 🥹)

We know that PHP is a single thread language, so to overcome this issue one can create CRON JOBS to schedule/trigger the smaller tasks.

Also execution of each cron starts new PHP process. So to track the progress and completion of the prev. process we need some kind of db system. WordPress stores those on database and not on the File System.

To do this Inter Process Communications there are multiple approaches one can take. File, Socket, Message queue, etc. here is the link to read more.

Process Management

In this we simply understand the concepts and approaches Linux follows to avoid any future issues.

I revised concepts of process management includes like Handling Deadlocks, scheduling, processing and more. Gone through some basic terminologies like address space, physical address and page table.

Also, do you know when the Process Control Block (PCB) creates? It creates with the when the process is created. Inside that we have a concept of Memory mapping and Program counter.

Then comes Context Switching, a mechanism that is used to switch process according to needs, priority or due to other factor. They can be expensive as if they use COLD cache which basically means no pre-cache data in there. So starting as a fresh process.

Process Life cycle is pretty simple there are 5 states involve in total.

  1. New
  2. Ready
  3. Running
  4. Waiting
  5. Terminated

also CPU can only access them when they are in a Ready or Running State.

processlifecycle

There are still few things left to cover in this module.

Setting Up the system

Alongside the LMS learning, I have downloaded some softwares that are required for this course like VS code, Oh My Zsh  and LocalWP. Initial Setup is done but additional addOns like MailHog is still need to be configured. Basically MailHog is a email-testing tool and can be helpful at development stage.

That’s it. See you tomorrow.

“Good Work. Good People.”

Leave a Reply

Your email address will not be published. Required fields are marked *