You can increase the size of the root EBS volume, but how to make CentOS reflect that change? SSH into the CentOS instance and run the following: $ sudo yum install cloud-utils-growpart $ sudo growpart /dev/nvme0n1 1 $ sudo reboot… Read More
How to mount a LUKS encrypted drive on Ubuntu running as a Guest OS of VirtualBox on Mac?
Insert the encrypted device in your Mac. It will tell you it can’t use it and would invite you to initialize it. Just click “Ignore”. Run the disk utility to identify what disk is your encrypted device (probably it will… Read More
A useful ps command
$ sudo ps -eH -o user,pid,ppid,state,pcpu,pmem,vsize,start_time,time,nlwp,cmd
How to install the latest version of AWS command line tool on Ubuntu?
Follow the steps: $ sudo apt update $ sudo apt install python python-pip $ sudo pip install awscli This will install a reasonably recent version of awscli, at least more recent than installing directly with `$ sudo apt install awscli`.… Read More
How to create a Let’s Encrypt SSL certificate using DNS challenge?
First of all, register the domain name if not done already. Then run the steps: $ sudo certbot -d YOUR.DOMAIN.COM –manual –preferred-challenges dns certonly When prompted, create the required TXT record with your DNS provider and press enter in certbot.
How to install and configure OpenVPN on Amazon Linux?
Important note: What I wrote here will not work on Amazon Linux 2; only on Amazon Linux. There are some rare tutorials on the net, like this outdated one. Save yourself some headaches and use the following script to easily… Read More
How to convert Maildir to mbox?
Make sure you have the procmail package installed, and then run the following: $ for i in MAILDIR/cur/*; do formail -I "Status: RO" < "$i" >> MBOX; done I work as a freelancer, so if you don’t want to do… Read More
How to properly use certbot with Nginx on Ubuntu?
Install and configure Nginx: $ sudo apt update $ sudo apt install nginx $ sudo rm /etc/nginx/sites-enabled/default $ sudo vi /etc/nginx/sites-available/MYSITE # See below $ sudo ln -s /etc/nginx/sites-available/MYSITE /etc/nginx/sites-enabled $ sudo systemctl restart nginx The /etc/nginx/sites-available/MYSITE config file should… Read More
How to do a basic install of Prometheus on Ubuntu?
Machine requirement I will assume your machine is Ubuntu >= 16.04. Please make sure only ports 80 and 443 are open. I assume there are two DNS entries to your machine, such as prometheus.blablabla.com and grafana.blablabla.com (replace as appropriate throughout… Read More
How to programmatically know your external IP address?
You are probably used to type “what is my ip” in google to know this, but how can you do that in a shell script? Here it is: $ curl ifconfig.co Simple! I work as a freelancer, so if you… Read More