Sunday, January 7, 2024

Setup MAMP (Mac Apache MySQL/MySQL DB PHP) on Mac OS Sonoma on Macbook (Silicon Chip)

Introduction

Apple MacBook has gained popularity among developers in recent past. Many young developers are switching to Mac from Windows and Linux Environment. This article is an guide for developers who recently switched from differnet environment (specially Linux) to help them set up local MAMP (MacOS Apache MySQL PHP/Perl/Python) Environment

Friday, January 5, 2024

Setup inbuilt Apache in MacOS Sonoma

Setting Up a Web Development Environment on Mac

Many developers use Macs for web development. I myself have seen several tutorials where the trainer used an Apple system for training, but when I bought a MacBook, I found it a bit difficult to set up the environment. I believe that many new developers face such issues, so I decided to write this tutorial to help them. I had been using Linux (mostly Ubuntu/Linux Mint) for quite some time prior to switching to Mac.


Set Up Web Server (Apache)

Apache is the most popular web server, and the good news is that macOS comes pre-installed with Apache and you just need to start the web services. Run the following command to start Apache:

sudo apachectl start

To test if Apache is working, just open your favorite web browser and type "localhost" on its address bar. If you see the page as follows, your web server is working perfectly.


For those who are familiar with Apache, I would like to inform you that Apache2 is installed at /etc/apache2 and the default document root is /Library/WebServer/Documents.

The document root is the location where you need to save all your files that you want to share through the web server. Please be noted that when you save any file at the default document root, you may need to give additional permissions so that they can be served through the web server. The easier method is to set up a folder in your home directory (i.e., /users/<yourUserName>). I have created a folder named "Web" for this purpose in my home directory.

So, if you want to change the default document root, you need to edit /etc/apache/httpd.conf (you will require to open Macintosh HD and navigate to the "etc" folder. If the folder is not visible, press Command + Shift + . (period) to display hidden files). Then open httpd.conf in your favorite text editor (many blogs recommend VI or nano, so if you are comfortable with these tools or like working with the terminal, that will also do).

Locate "DocumentRoot" (in my case, it was on line No. 255) and change the folder from /Library/WebServer/Documents to the directory you created in your home directory (in my case, it was /Users/isthakur/Web). 

Now you need to give permission to the Apache web server to access this folder, so run the following command on your home directory:

chmod +a "_www allow execute" ~

...followed by the command:

sudo apachectl restart

Create an HTML file named index.html in your selected folder and test by opening "localhost" in your favorite web browser. The output in my case is as follows:



We have successfully configured Apache on Mac. Wish you all the success!


Important Notes

The in-built Apache server works perfectly fine if you do not intend to use PHP. But if you plan to develop using PHP as a server-side language, you must know that macOS deprecated PHP and stopped supporting it implicitly since macOS Monterey. So if you are a PHP lover like me, you must stop the in-built Apache.

Note:

  • Show Hidden Files: Click the Finder icon in your dock to open Finder. Navigate to the folder where you want to find hidden files. Press Command + Shift + . (the period key). This will show hidden files in the folder.

  • Show Macintosh HD: It's really easy to show the hard drive on your Desktop Mac. Open the Finder and select the main Finder menu. Then, click Settings. Under the "General" tab, under the "Show these items on the Desktop" section, ensure "Hard disks" is selected.

Wednesday, August 30, 2023

Dear Sister, Thankyou for being in my life


 

Dear Sister,

As Rakshabandhan dawns upon us once again, my heart swells with a flood of memories, and I find myself traversing the corridors of time back to our cherished childhood. From the days of innocence when we shared our dreams under the same roof to the moments that have woven the tapestry of our lives, you have been a constant source of love, support, and unwavering companionship.

Do you remember those carefree summer afternoons when we used to chase butterflies in the garden? The laughter that echoed through the house as we concocted imaginative tales, and the secret hideouts we built together, they are all etched in my heart. Each thread of these memories forms a bond that time cannot fade.

From sharing our tiffin boxes at school to facing the world's challenges side by side, you've been more than a sister; you've been a confidante, a partner in crime, and my pillar of strength. Through all the ups and downs, your unwavering belief in me has lifted me up even in my darkest hours. Your unconditional love has been my guiding light.

As I stand at this juncture of life, I am filled with gratitude for every single precious moment we've shared. The late-night conversations, the giggles over silly jokes, and even the occasional squabbles have shaped our relationship into an unbreakable bond. Your presence has been a blessing, a constant reminder that no matter how rough the seas of life get, there's a safe harbor in your embrace.

On this Rakshabandhan, I want to express my heartfelt gratitude to you, dear sister. Thank you for being the most wonderful part of my life's journey. Thank you for believing in me when I had doubts, for cheering me on when I needed courage, and for holding my hand when I faltered. You are not just a sister, but a treasure I hold dearer than life itself.

As we tie another rakhi this year, let it symbolize the unbreakable bond that time and distance cannot diminish. Let it remind us of the love, care, and affection we've shared, and the promise to continue walking this beautiful journey hand in hand.

Happy Rakshabandhan, dear sister. May our bond continue to shine as a beacon of love and companionship.

With all my love,

Inder Singh Thakur

Monday, August 14, 2023

Irony of Indian Education System

The Irony of India's Education System

This article critically analyzes the Indian education system, arguing that despite its large and well-defined structure, it falls short in providing quality education that truly prepares students for the professional world. The author highlights several key flaws:

  • Rote Learning Over Understanding: The system rewards students who memorize facts over those who genuinely understand concepts, as exemplified by a scene from the movie "3 Idiots."

  • Outdated Curriculum: The syllabus is slow to be updated, resulting in students learning obsolete information that is no longer relevant in today's world.

  • Flawed Evaluation: The examination system primarily tests a student's ability to recall information rather than their analytical and problem-solving skills, leading to a generation of "qualified" but unemployed youth.

  • Call for Change: The author concludes that while systemic changes are needed, teachers and students can make a difference by prioritizing understanding and application of concepts over simple memorization.

भारतीय शिक्षा प्रणाली की विडंबना

भारत में प्राचीन काल में, छात्र गुरुकुलों में जाते थे जहां वे अपने शिक्षकों (गुरु) के साथ रहते थे और अध्ययन करते थे। शिक्षक उन्हें सबक देते हैं और काम का अभ्यास करते हैं। घर-काम की कोई अवधारणा नहीं थी। छात्रों को अपनी पाठ्य पुस्तकों में कुछ लिखने की आवश्यकता नहीं है, बल्कि उन्हें अवधारणा को समझना और याद रखना था। हम अपनी होली की किताबों और पवित्र साहित्य में अनगिनत संदर्भ पा सकते हैं, जो कहते हैं कि छात्र शिक्षा की अवधि के लिए शिक्षक के साथ रहे। समय बीतने के साथ, हमारी शिक्षा प्रणाली ने गुरुकुलों को विद्यालयों (स्कूल), महाविद्यालय (कॉलेज) और विश्वविद्यालय (विश्वविद्यालय) में परिवर्तित कर दिया।

Tuesday, July 18, 2023

The Dark Side of Kids Learning Tubes: Unveiling the Hidden Dangers

 Introduction


Welcome to our comprehensive guide that explores the dark side of kids' learning tubes. In this article, we will delve into the hidden dangers lurking behind these seemingly harmless educational tools. While they offer a plethora of benefits, it's crucial to be aware of the potential downsides. By understanding the risks, we can ensure a safer and more enriching learning experience for our children.

From Rallies to Results: The Rollercoaster Ride of Himachal Pradesh Election 2022

 

Introduction:

The political landscape of Himachal Pradesh was set ablaze with fervor and anticipation as the much-awaited Himachal Pradesh Election 2022 unfolded. From the adrenaline-fueled rallies to the nail-biting results, this rollercoaster ride of democracy captivated the attention of the entire nation. The election witnessed twists and turns, surprises and upsets, making it a thrilling journey for both politicians and voters alike. Let's embark on a retrospective journey, exploring the exhilarating rollercoaster ride of the Himachal Pradesh Election 2022.

Exercise Basic Programming Concepts