Have you ever in a situation where you have multiple backend servers and your cronjob is scheduled in one server and it didn’t run when that server went down OR you have a Docker Swam based cluster where you have several worker nodes and you do not want the cronjob to execute more than once…Continue reading Cronjobs in distributed environments – Cronlock using NFS/External mount
Author: Vivek
One-off cronjob container on Docker Swarm
Docker containers are good for running small tasks due to the size and memory requirement for running in a server. It makes docker a perfect candidate for running short-lived and one-off jobs. Throwing Docker Swarm into the picture, we get a cluster where we can start the docker service and let docker select the suitable…Continue reading One-off cronjob container on Docker Swarm
Add/Edit DNS zone records on AWS Route53
Route53 is AWS’s DNS service. Last year I worked on a building a custom auto scaling solution on AWS using AWS AutoScale for EC2 servers. In this, I had a custom boot script that executes every time a new server is added to the cluster. And the script also generates a unique and sequential hostname…Continue reading Add/Edit DNS zone records on AWS Route53
Install AWS Cli on Ubuntu
A quickest way to install AWS Cli
Graylog Standalone on Ubuntu Installation
Graylog is a log aggregation tool. Installing and setting up graylog is pretty straightforward. Here is a simple guide to install graylog on an ubuntu server. This setup is recommended for non-production or low traffic environments where you don’t need any redundancy. For a production level setup, it is recommended to at least have two…Continue reading Graylog Standalone on Ubuntu Installation
Docker Engine – Install a fixed version on Ubuntu
Containerization is everywhere. Docker is the name that comes to our mind when we talk about containers. Is the latest version of the docker the greatest? I’ve been using docker containers, especially docker swarm mode, for over a couple of years now and I’d say no! Docker is still being actively developed. With that being…Continue reading Docker Engine – Install a fixed version on Ubuntu
Monitor Apache using monit
Monit is a small Open Source utility for managing and monitoring Unix systems. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. Installing monit on CentOS 7 yum install epel-release -y yum install monit -y Once installed, save the following in /etc/monit.d/apache check process httpd with pidfile /var/run/httpd/httpd.pid group…Continue reading Monitor Apache using monit
Hashicorp Vault Systemd Startup Script
From Hashicorp Vault project documentation Starting the Server vault server -config=example.hcl With the configuration in place, starting the server is simple, as shown below. Modify the -config flag to point to the proper path where you saved the configuration above. Vault outputs some information about its configuration, and then blocks. This process should be run…Continue reading Hashicorp Vault Systemd Startup Script
How to validate a public key?
So how do you validate a public key programmatically? I’ve had this question when I had to implement a feature in one of our application. It is possible using the ssh-keygen utility. ssh-keygen -lf publickey.pub Here, -l Show fingerprint of key file. -f filename Filename of the key file. The hack is to check the…Continue reading How to validate a public key?
Fix WordPress Files & Folders Permission Massively On cPanel Server
chdir(“/var/cpanel/users”); $users = glob(‘*’); foreach($users as $user) { if(is_file(“/home/$user/public_html/wp-config.php”)) { echo “Performing on /home/$user/public_html\n”; system(“find /home/$user/public_html/ -type d -exec chmod 755 {} \; “); system(“find /home/$user/public_html/ -type f -exec chmod 644 {} \; “); } } Save the file as fix.php on /root Then execute it /usr/local/cpanel/3rdparty/bin/php /root/fix.php