UNIX / Linux: awk Add Two Numbers

To add two numbers in Unix or Linux using awk, you can use the following command: awk ‘BEGIN {print [number1] + [number2]}’ Replace [number1] and [number2] with the two numbers you want to add. For example, to add the numbers 10 and 20, you would use the following command: awk ‘BEGIN {print 10 + 20}’ … Read more

nginx: Install GeoIP Module For Country / City Level Geo Targeting

To install the GeoIP module for country or city level geo-targeting in Nginx, you can follow these steps: Install the GeoIP library: You can install the library using your operating system’s package manager. For example, on Ubuntu, you can use the following command: sudo apt-get install libgeoip-dev Download the GeoIP database: You can download the … Read more

Lighttpd Deny Access To Folders / Directories

To deny access to certain folders or directories in Lighttpd, you can use the URL access control feature in Lighttpd. This can be done by using the url.access-deny configuration directive in your Lighttpd configuration file. Here is an example configuration that denies access to the /secret directory: $HTTP[“url”] =~ “^/secret/” { url.access-deny = ( “” … Read more

macOS X Mount NFS Share / Set an NFS Client

To mount an NFS (Network File System) share on a macOS X system, you can use the mount command. Here’s an example: mount -t nfs -o resvport <NFS-server-name>:<remote-directory> <local-mount-point> In this command, <NFS-server-name> is the name or IP address of the NFS server, <remote-directory> is the path to the directory you want to mount, and … Read more

mysqldump: Got error: 1044: Access denied for user ‘root’@’localhost’ to database ‘information_schema’ when using LOCK TABLES

The error message “Got error: 1044: Access denied for user ‘root’@’localhost’ to database ‘information_schema’” indicates that the user ‘root’ does not have the necessary privileges to access the database ‘information_schema’ when using the LOCK TABLES option with mysqldump. To resolve this issue, you can either: Grant the necessary privileges to the user ‘root’ by executing … Read more