Finding out the version of redhat or centOS you’re running is easy, you simple cat out the release version file standard on any red hat
Recursively Loop Over a Directory using RecursiveDirectoryIterator
You can use PHP’s built in directory iterator (in php 5 or 7) to loop over a directory and perform operations on the files easily.
How to Check Ubuntu Kernel Version with uname
The uname shell command will print out in any Debian or RedHat variant like Ubuntu and Centos Linux much of the main system information, here
How to Test a Date for Validity
Needed a function to test if a date was valid in PHP. This function does that but it also requires an expected date format. Example
You have a 23.34% Chance of Guessing a Four Digit Pin Combination
According to Datagenetics 10.71% of 4 digit passcodes are 1234. Data Genetics did some number crunching on ATM pin data, not sure how they got
How to View Processes and Their Respective Ports on Linux and OSX
If you want to see what processes are listening on what ports these you can use the linux command lsof and netstat. Below are a
How to Insert on Duplicate Key Update (an upsert)
This example of a upsert, an on duplicate key insert statement in MySQL. What it does is if the table zipcode_population has a unique index
How to Watch For a Process to End on Ubuntu Linux
I wanted to send myself a text when a long running process was done so I needed a command that would watch for a process
Function to Remove Dollar Signs and Commas From a Number
I needed a function to turn a string value dollar with commas into a decimal I could insert into MySQL. This function below will take
How to Concat a Bunch of Files Together
Here are 2 different shell commands using cat. These examples would allow you to stack files into a new file concatenating them together. Useful for