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 install an old version of PHP using geerlingguy.php on Ubuntu target
Your playbook should look like so: — – hosts: XYZ become: yes pre_tasks: – name: Add repository for old PHP apt_repository: repo: ppa:ondrej/php update_cache: yes state: present roles: – role: geerlingguy.apache … – role: geerlingguy.php php_webserver_daemon: apache2 php_default_version_debian: "7.1" php_version:… Read More
How to install and kick off minikube on Ubuntu?
Install kubectl: $ sudo apt update $ sudo apt install apt-transport-https $ curl -sSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add – $ echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list $ sudo apt update $ sudo apt install kubectl… 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
How to install Docker on Ubuntu
Follow the steps to install Docker Community Edition: $ sudo apt install curl software-properties-common $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add – $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" $ sudo apt update $ sudo apt install… Read More
How to enable and analyse the slow query log on MySQL?
Set the following variables in your MySQL config file: slow_query_log = 1 (means true) long_query_time = 0 (means 0 seconds) log_queries_not_using_indexes = 1 (means true) log_output = FILE (default is TABLE) Setting long_query_time to 0 will instruct MySQL to log… Read More
How to do a basic install of an ELK stack on Ubuntu for log stashing?
Use a machine with at least 4GiB of RAM. This guide will install ElasticSearch, Logstash and Kibana all on the same machine, so this is suited only for a small-scale setup. Install and configure ElasticSearch $ sudo apt install apt-transport-https… Read More
How to install the dns-route53 plugin for certbot on Ubuntu?
There are no instruction on how to install the dns route53 plugin for certbot. Here is how to do it for Ubuntu. To install certbot: $ sudo apt update $ sudo apt install software-properties-common $ sudo apt-add-repository ppa:certbot/certbot $ sudo… Read More
How to convert a string to int in Jinja2?
Simple: MYSTRING | int I work as a freelancer, so if you don’t want to do that kind of things yourself or don’t have the time, just drop me a line to hire me.