Author Archives: Silver Moon

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

Write a simple PHP Hit Counter Script

By | October 29, 2011

In this tutorial, I am going to show you a simple way to write a Hit Counter script in PHP to save and display the number of visits to your website. We will basically store and increment the hits in a file, that can be used to display the total hit count as well. The… Read More »

How to Code a TCP Connect Port Scanner in PHP

By | August 11, 2020

A port scanner is a program designed to probe a server or host for open ports. Looking at open ports, one can tell what services might be running on the remote server. We earlier made a TCP Connect port scanner in C here – https://www.binarytides.com/tcp-connect-port-scanner-code-c-winsock/ and here – https://www.binarytides.com/tcp-connect-port-scanner-c-code-linux-sockets/ Now we shall try making the… Read More »

PHP strtotime in 64 bit environment

By | October 23, 2011

The strtotime function is used to convert a date in various formats to a timestamp. However its behaviour is different based on architecture it is running on, whether 32bit or 64bit. Lets take a few examples : In 64 bit environment desktop:~$ php -a Interactive shell php > echo strtotime("0000-00-00 00:00:00"); -62170005200 php > echo… Read More »

Get domain whois information with telnet

By | May 2, 2013

Whois is often used to find out the details of the owners or the registrants of a domain name. The details includes name, address, telephone number etc. Whenever a domain is registered by a user, the user has to fill out own details at the domain registrar. These details are fed into the whois system,… Read More »

PHP benefits of storing session data in database

By | October 21, 2011

PHP’s session_start method stores the session data in files by default. These files are stored in the tmp directory of the OS and are cleared at intervals by the garbage collector. Alternatively the session data can be stored in database as well. Storing session data in database has certain advantages : 1. Limit the number… Read More »

Get smooth and beautiful fonts on Ubuntu

By | May 9, 2020

To get beautiful and smooth fonts on Ubuntu : 1. Install ttf-mscorefonts-installer from synaptic This will provide the fonts like microsoft arial , tahoma , verdana , courier etc. 2. Get the xml file by Obi Bok from https://wiki.ubuntu.com/Fonts The above xml file provides special finetuned settings for antialiasing and hinting parameters for various fonts… Read More »