Blog of Things

Category: How To’s (Page 1 of 2)

LEMP Stack Install using cloud-init

In this blog post, I will describe how to automate the installation of LEMP stack on Ubuntu server using cloud-init. cloud-init allows us to spin a server for testing/development. LEMP stack consists of four major software components.

  • Linux – The operating system on which the EMP is running.
  • NGINX – Another powerful web server, similar to Apache.
  • MariaDB – An open-source relational database management system.
  • PHP – Server-side scripting language used to process web pages.

You can further enhance the configuration by pulling code automatically from a Git repository and also configure the database automatically.

Further information about LEMP stack is available at

View Full Post

Modern Day Engineer’s Control Center

Network Engineers, System Administrators, and DevOps engineers have to use the various open source software to do their day to day jobs. This could be things like using Ansible for server or network configuration, it could be Terraform to deploy and maintain infrastructure, Git for version control, or CLIs provided by cloud infrastructure providers. Even with small teams, one of the challenges that I have seen is how to make sure that the systems can be easily setup on day 1.

I had touched base on cloud-init briefly in an earlier post, but that relied on downloading a bash script and executing it. This blog post covers details on the commonly used software and how to build a Linux based system automatically. It assumes that the system is being built on OpenStack or any other cloud provider infrastructure such as AWS, GCP, Azure, or Digital Ocean and uses Ubuntu 16.04 as the operating system.

View Full Post

Export logs from FortiGate to FTP server

This is a quick post on how to export logs from a FortiGate to FTP server. On FortiGates running FortiOS 5.6 and above, one can easily transfer all logs from memory to an FTP server.

View Full Post

FortiGate Virtual Machine Config Drive – Missing Pieces

With FortiOS version 5.4.1 and above, Fortinet added support for initial configuration of a FortiGate virtual machine by attaching a cloud-init config drive. When the FortiGate VM powers up for the first time, it will automatically read the data from the config drive and apply both license and configuration to the FortiGate. This is an excellent way to automate deployments of FortiGate virtual machines in production or lab environments. You can read more about the config drive support and how to use one at In this blog post, I will try to capture some of the missing pieces and also provide pointers on how to troubleshoot.

View Full Post

Installing VMware vSphere SDK for Perl v6.5 on Ubuntu 14.04

VMware has a guide available at, which if you follow carefully you will be able to successfully install the vSphere SDK for Perl without any issues. I, unfortunately, didn’t follow the guide properly and landed into some issues, which I have documented here. This blog post captures:

  1. How to install vSphere SDK for Perl on Ubuntu 14.04
  2. Issues encountered

View Full Post

FortiOS 5.4 automatically repeat commands using auto-script

FortiOS 5.4 introduced a long-awaited feature called auto-script. Head over to and then “5.4 What’s New” if you are interested in learning more. For those of us, who have worked on Cisco routers and used aliases or EEM feature, the auto-script feature is somewhere in between the two. It allows commands to be executed periodically or either once and I see this to be a great add to the feature set, especially when it comes to collecting lots of information quickly. This blog post captures:

  1. How to configure auto-script feature
  2. How to execute a script
  3. How to view the results.
  4. How to upload results to an FTP server
  5. Maximum limit
  6. Few features that I would like to see in future FortiOS releases

View Full Post

Using esxcli to add port groups and vlans in bulk


esxcli is a command line tool that can be used to manage VMware ESXi host. In my opinion it’s a good way to learn more about the inner workings of ESXi and can be used in scripts for automating tasks. In this blog post, I will show you how to use esxcli to add portgroups and vlans to vSwitch0 of an ESXi host.

View Full Post

Testing DSCP using ping tcpdump and tshark

Introduction and Setup

If you came here via a search engine, chances are that you looking for a quick and dirty way of testing DSCP on your network. Differentiated Services, described in RFC 2474 and RFC 2475 provide a way to mark, prioritize, police, etc IP flows based on various attributes. This allows network operators to maintain different levels of QoS on their networks.

This post captures details on how to generate traffic from a client with different DSCP fields set and verify that they are received on the server side.

View Full Post

bash function/alias for ssh connectivity

In the home or work lab, I often have to connect to various devices that are either temporary or don’t support SSH keys. In my home lab, I typically set all the lab equipment with a standard username and password, which allows me to connect to them quickly. As almost all devices these days support SSH, I setup a bash function that acts as an alias allowing me to quickly connect to a device using SSH either from my Mac or Linux desktop.

View Full Post

Copy SSH Key to Multiple Servers

This blog post captures details on how to copy SSH key to multiple servers. If you manage more than one Linux server and have been challenged with automating mundane tasks, using SSH keys to login to a server without having to enter your password can be extremely irritating. There are more than one way to automate login to a Linux server.

  1. Use a utility like sshpass where you can provide the password as an argument.
  2. Use public-private SSH key pair.
Steps Involved
  1. Creating SSH Keys
  2. Copy SSH Key to Servers

View Full Post

Page 1 of 2