Posts marked with "Script" in tags

Check if Bash Script is ran by Root User

Root users have the privilege to do administrative stuff in Linux and if you’re creating a Bash script to install something or change something in the system, you need root. So, checking whether the script was ran by root is very important.

if [ "$EUID" -ne 0 ]
   then echo "Please run as root"
   exit
fi

There is no else condition. You can add the code which will does stuff in root after the above. If root didn’t ran the script, then the script will terminate itself without continuing after “Please run as root” message is displayed.

... [READ MORE]

Create HTML Chess Game With jQuery

We all love to play Chess, the most fascinating game that absolutely needs good thinking powers. You know that, comparing a human to a computer logically and arithmetically, computer has the superior power. So, certainly if you play a chess game with computer as opponent, a 90% chance is for the computer to be the winner. But, it is not sure.

It was actually in C language by Oscar Toledo Gutiérrez, who created chess game program in less than 2 KB. Since, it’s C, compiling is necessary. But, who have time for that. Let’s make it in the web.

... [READ MORE]

E-Mail Verification Script In PHP Using Mailgun API

As years goes, so does the increase in SPAM on the web. Most users sign up on services with a fake E-Mail. They might even use other’s E-Mail for signing up. This is a big problem, because when you send an email to the signed up user, it goes to the wrong guy. So, you should verify user’s email before signing them up. You might think that it would cost database memory. Don’t worry, because my script won’t require storage of verification codes on database.

... [READ MORE]

Follow/Subscribe

Telegram 

Mastodon  Twitter

GitHub GitLab

Subdomains

Demos  Lab

Past

This blog was once on WordPress. Now a static site. See source code on

GitLab