Unix / Linux: Print IO Statistics of Running dd Process

unix linux

Let’s say you have a dd process that is running. By default, dd will only print IO statistics once the job has been completed or if it is interrupted by a Ctrl-C (SIGINT) command. While the job is running, you will probably have no idea how much data has been copied, the current progress or the copying speed. But fret not, there is actually a way to get the IO statistics of a running dd process.

Unix / Linux: Sync Local Directories

unix linux

To sync files between two local directories on Unix or Linux, you can either choose to perform a soft link to the source directory or use rsync or lsyncd daemon.

MySQL: Export Each Database to Individual SQL File

database

MySQL backups are normally done using mysqldump – a MySQL database backup program. The problem is all the backups will be written to a single output SQL file. I prefer to dump each MySQL database to a separate SQL file.

Shell Script: Check If Weekday

shell script

There are two ways to perform a “is it a weekday” logic in shell scripts. One way is to use cron. The other is to get the day of week from the date command.

Unix / Linux: Generate MD5 Checksum

unix linux

The md5sum command can be used to generate MD5 checksums for a string or a file. This is installed by default on most Unix and Linux distributions.

Disable Nginx Version Number in HTTP Headers

security

By default, Nginx sends the version number in the HTTP response. Hackers can use this information to try and exploit any known vulnerabilities in Nginx, especially if you are running a version with known vulnerabilities. Security wise, it’s a good practice to not reveal versions numbers of the HTTP server.