Author: Daniel

  • What’s The Worst Gonna Happen?

    Most times life wouldn’t go as expected. Some would move on. However, most would feel disturbed and shattered.

    During those times, we seek support from friends and family. You should feel fortunate when you have someone to lean on. Despite friends and family, the unexpected events may bother you in ways you cannot imagine. I’ve been there many times.

    When I feel shattered, when I feel weakness, I ask myself, “what’s the worst gonna happen?” Most times the answer to this question would be “I may lose the money”, or “I may lose the job”, or “I may lose a possession”.

    Once you know the worst thing that might happen, you will find courage to overcome your difficulty.

    Whether you lose or win doesn’t matter. You will eventually grow to greater heights with time.

    I wish your hardship fades away. Let the Almighty help you find the courage within. Remember, you will win and you will never back down.

    Today, I’m grateful to all my mentors who inspired and portrayed a life of contentedness.

  • New To Permaculture Farming? Start By Doing This…

    If you recently purchased a land or exploring Permaculture in your existing farmland, it is important to track your farm’s yields with time. The better your soil fertility the better your farm’s yields shall be. But, “how do we determine the fertility of the soil?”, might you ask.

    Well, before you begin cultivation, get your soil and water tested. The test report will help you learn whether your soil is acidic or alkaline in nature. You will also get to know the list of all minerals that your soil lacks and your soil is rich in.

    “How will this data help”, might you ask.

    Let’s say your soil is acidic and you are planning to use an organic input to feed your soil. You can avoid or dilute all organic inputs that are acidic in nature before you feed your soil. This way, you can keep your soil pH in check.

    If you’re in India, you can google “KVK {Your district’s name} soil testing” to get your soil and water tested. For example, my distrcit is Salem and I would look for “KVK salem soil testing”. While at the time of writing this post, the cost of testing is INR 100 /- per sample.

    Today, I’m grateful to the Almighty for blessing me with a contended life.

  • Trench, Berm, Swale, Channel — What The Heck?

    If you’re new to permaculture design, you may feel intrigued hearing the terms like trench, berm, swale, channel, etc. My aim in this post is to help you learn the differences amongst these jargons.

    Trench

    A trench is a pit in the ground. A trench is dug to harvest rain water.

    Ditch

    A ditch is very similar to the trench but differs in a way that the ditch is usually used to move water from one place to the other, usually run away water from the road.

    Berm

    A berm is a mound usually put up on a contour to contain water. Berms are usually planted with grass or other vegetation to prevent soil erosion.

    Swale

    A swale is a combination of a trench (the pit) and a berm (the mound). A swale must be located on the contour line for maximum efficiency. When in case of a swale, downhill plantation reduces erosion. Swale helps to recharge the ground water by letting the water seep through the ground.

    Channel

    Channel, unlike swale, would be located slightly off the contour. The main purpose of a channel is not just catch water but to help the water flow from one place to the other. This differs from ditch by slowing the flow of water. A channel is put to its best use when used to irrigate drier areas.

    Today, I’m grateful to the Almighty for leading me in my life.

  • WordPress: The server cannot process the image — How To Fix?

    WordPress: The server cannot process the image — How To Fix?

    The server cannot process the image. This can happen if the server is busy or does not have enough resources to complete the task. Uploading a smaller image may help. Suggested maximum size is 2560 pixels.

    The above seen error swept a couple of hours out of my day. At the end, I’ve figured out what went wrong and I’m about to share how I fixed it.

    Solution

    1. Find out which php.ini is loaded by running the following command.
    php -i | grep 'php.ini'
    # Result
    
    Configuration File (php.ini) Path: /etc/php/7.x/cli
    1. Bump up the upload_max_filesize value. In my case, I bumped to 8M. I had to make this change in the /etc/php/7.4/fpm/php.ini file.
    ; Maximum allowed size for uploaded files.
    ; http://php.net/upload-max-filesize
    upload_max_filesize = 8M
    1. Restart PHP FPM service by running the following command.
    sudo systemctl restart php7.4-fpm.service

    By now the maximum upload file size displayed in the WordPress dashboad must have been set to the value you set in the php.ini file.

    Behind The Scenes

    If you’re interested in knowing what I tried before I arrived at the above solution then keep reading.

    1. Since the issue is obvious and related to file uploads, I tried to increase the memory limit using `wp-config.php`. But this did not solve the problem.
    define('WP_MEMORY_LIMIT', '256M');
    define('WP_MAX_MEMORY_LIMIT', '512M');
    1. Next I tried changing the upload_max_filesize value in php.ini file. I’m running a LEMP stack. However, changing the php.ini file did not solve the problem.

    The loaded php.ini can be found by running the following command.

    php -i | grep 'php.ini'
    # Result
    
    Loaded Configuration File: /etc/php/7.4/cli/php.ini

    I restarted the PHP service for the changes in php.ini file to take place using the following command.

    sudo systemctl reload php7.4
    1. I disabled gd PHP module and installed imagemagick PHP module. However, this did not solve the problem.

    You can run the following command to list all the installed PHP modules.

    php -m

    Today, I’m grateful to my two beautiful dogs who keep me sane by offering love licks when I’m busting through the roof.

  • How To Use Date Query With WP CLI?

    If you’re reading this post, I’m sure you don’t need an introduction on WP CLI.

    Inclined to use some stats in my monthly review post, I wanted to find out the total number of spam comments my blog received for the month of April.

    Thinking that WP CLI would make my task easier, I started looking at the documentation to find out the appropriate syntax to be used with the wp comment list command.

    To my surprise I found out that date query isn’t possible with WP CLI. I realized that I could leverage RESTful WP CLI and apply the date query.

    RESTful WP CLI query looks like the following.

    wp rest comment list

    Using the help command, I figured out the options to be passed.

    wp help rest comment list

    In order to get the list of spam comments for the month of April, I arrived at the following command.

    wp rest comment list --after='2022-03-31T23:59:59' --before='2022-05-01T00:00:00' --status='spam'

    Problems

    However, there were a couple of problems.

    • Authorization: In order to use the status option, authorization is must. Otherwise only the default value approve will be taken in to account.
    • Readability: The output contains all the comment table fields cluttering the entire console.
    • Getting the total count: A tabular display of data doesn’t output the total number of records.

    Authorization

    I solved the authorization problem using the user option in the command like shown below.

    wp rest comment list --after='2022-04-27T23:59:59' --before='2022-05-01T00:00:00' --status='spam' --user='admin'

    Readability

    I solved the readability problem using the field option in the command like shown below.

    wp rest comment list --after='2022-04-27T23:59:59' --before='2022-05-01T00:00:00' --status='spam' --user='admin' --field='id'

    Total Count

    You can obtain the count by using the --format=headers option.

    wp rest comment list --after='2022-04-27T23:59:59' --before='2022-05-01T00:00:00' --status='spam' --user='admin' --field='id' --format='headers'

    References

  • Unforeseen Bite

    I’ve been reading a lot on Canine psychology and body language since four years. The acquired knowledge helps me bond with any dog. I don’t approach dogs that are not comfortable with my interactions. Dogs communicate all the time using body language.

    Rain or shine, I walk my dogs every day. My eldest dog will turn four this December. We hardly missed a walk during these four years.

    I sometimes pet, talk to a few strays during our walks. I was walking one of my dogs like every other day. A stray came out of no where and bit my leg from behind.

    For a moment, I wanted to hurt that dog in return. But the knowledge I acquired helped me make the right decision. Dog’s don’t escalate to biting unless provoked. The dog appeared to disabled with a broken leg. She would’ve bit me out of pain or could even be because of rabies.

    I shooed the dog away and noticed that I was bleeding. I rushed to the hospital and got my first anti-rabies and TT shots.

    The bite doesn’t affect my love for dogs. However, I would be more cautious with the one that bit me.

    I wish I had a good knowledge on snakes as well. I happened to kill one that visited my house a few months ago.

    Today, I’m grateful to the Internet, a vast library, that made me a better person.

  • Delete All Git Stashes

    You can quickly clear your git stashes at once, by running the following command.

    git stash clear

  • Monthly Review: March 2021

    Like most people, I make great plans every new year. However, I lose track of my goals and live an ordinary life every year. I don’t want to let go of another year making meaningless choices. Hence, I wanted to reflect on my progress every month. These monthly reviews keep me accountable.

    Server Administration

    Unfortunately my cloud hosting server crashed this year. This unfortunate event led to a series of events that I’m proud of. You wouldn’t be reading this post otherwise.

    1. Moved to Linode cloud hosting.
    2. Setup backups that are saved on to a different server.
    3. Moved all my domains to Google domains.
    4. I shall soon retire my daniel@danieldeepak.com inbox.

    Pet Project

    I’ve been running Tap That Brain for a couple of years now. This month I decided to steer the course of the project radically. I made my mind to not indulge in in-person training sessions.

    Rather, I wanted to offer online dog training courses. Also, I’ve been wanting to run and manage a members-only forum / platform to discuss anything and everything dog training and dog parenting.

    1. Setup a members-only forum using Vanilla.
    2. Implemented single sign-on for Vanilla using WordPress log-in credentials.
    3. Began writing my first online course.
    4. Had setup newsletter to send out dog training tips for dog parents.

    Blogging

    1. Published 11 posts in my personal blog.
    2. Published 9 posts in Tap That Brain blog.

    Productivity

    Starting March, I’ve been following the deep work philosophy. Using deep work, I was able to get things done faster and better. I’ve been consistently clocking three deep work blocks every work day. Each work block would range between 45 minutes to 90 minutes depending on my energy level that day.

    Family

    Out of the blue, we visited Velankanni. The struggle in finding a stay will make the trip memorable forever.

  • Ubuntu Videos: No PGS Subtitle Decoder

    To get PGS subtitle decoder support, install the following packages.

    https://askubuntu.com/a/1142375/593022