Posts marked with "Posts" in posts

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.... [READ MORE]

Newton Color Disc in jQuery

Newton Color Disc is used to find the color got by the combination of multiple colors. The color is not actually formed, but the eye identifies the combination as another color due to persistence of vision. Normally, Newton’s Color disk is made by marking sectors filled with color on a circular shaped disc. When this disc is rotated at high speed, we see the circle as another color. This principle led to the method of creating different colors by the combination of some primary colors at different percentage compositions.... [READ MORE]

Replace Strings in Files With PHP & Python

There are softwares already that helps to replace a string in a file. Suppose, if you’re making a program that requires saving some data in to a file. By “adding”, the program is actually replacing a word. Let’s see how it’s done in PHP & Python. This is the file where we are going to replace the word : thisWord I got thisWord for making it thatWord replace thisWord already my friend.... [READ MORE]

Folder Recursion in PHP & Python

A folder has files and sometimes sub directories. If we use the normal function for obtaining contents of a folder, we won’t get the details of the files in the sub directories. In this case, we have to look over into the sub folders and into other sub folders within this sub folder. This looking up of files deep down is called Recursive Folder Searching. By doing this, we can search for a file or do various actions with each files thus recursed.... [READ MORE]

Word Palindrome Check in PHP & Python

Palindromes are unique words that are read the same forward and backward. We can identify them using out eyes and brain. How about we identify using a simple program in PHP & Python ? PHP <?php $word = strtolower("Malayalam"); $splitted = str_split($word); $reversedWord = ""; $length = strlen($word); for($i = 0; $i < $length; $i++) $reversedWord .= $splitted[$length - $i - 1]; echo $word == $reversedWord ? "It's a palindrome !... [READ MORE]

Executing Terminal Commands in Python & PHP

Python & PHP are great languages and there are many similarities between them. In this short post, you will learn how to execute terminal commands in PHP & Python. PHP As I said before many times in other posts, there areexec andsystem command to execute commands : exec("firefox ‘http://subinsb.com’"); Or in the other way : system("firefox ‘http://subinsb.com’"); Python In Python, there is no exec or system function. But there is a system function in the os nodule.... [READ MORE]

Infinite loop in PHP & Python

Infinite loops are loops that doesn’t have a defined ending. It will continue to run until the program it’s running in is terminated. Normally an infinite loop is created using while loop and is used for continuity of the same program. In this short tutorial, you will learn how to make an infinite loop in both PHP & Python. PHP There is no need of defining any variables. while(1){ print "... [READ MORE]

Configuring SSH to Enter a Password Automatically

As you know, when you SSH into a system, it will ask for the password which you have to enter everytime. But in cases where you’re SSHing in a script or in a loop, its a really time consuming and boring thing to enter password everytime. So, in this case you have to configure SSH to use a password to enter when asked. But, there is no default option in the ssh command to set this due to security reasons I think.... [READ MORE]

Blog Changes

It’s been some time since I made some changes to the blog apart from new posts. It took me this much time because of school, of course. Here are the main changes that I hope to add to the blog : HTTPS No Ads Short Posts HTTPS There’s nothing like feeling secure in Internet. So, I have decided to add HTTPS support to the site. It’s made possible free of cost, because CloudFlare actually gives HTTPS feature with certificate for absolutely free and it doesn’t require for your server to have a certificate or SSL support.... [READ MORE]

Blocking Brute Force in PHP Website

Brute Force is a time consuming cracking process to log in to a user’s account of a web site. It’s not common and requires very high resources including the most important factor : TIME. What’s Brute Force Suppose, your email website have an account of username “abel”. His big enemy who is a nerd, wants to send rubbish stuff to Abel’s friends to make his friends angry. Your site is heavily protected except for Brute Force and the enemy is willing to give as much time to log in to Abel’s account.... [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