Articles about software development operations

In this page, you will find articles that are related to computer infrastructure operations that are performed in the course of software development.

Examples include how to setup the server infrastructure to run Python applications, WordPress applications and etc.

Home directory of the LocalSystem account in Windows Server 2012

Quite a few applications that I had encountered throughout my career provide the option to look for custom configurations inside the home directory of user accounts that had started them. One such example is the Git command, which looks for the private key to communicate with a GitHub repository inside a .ssh directory located inside the home directory of the user that runs it.

This post documents the home directory of the LocalSystem account in my Windows Server 2012.

Setting up a LEMP web server on Raspberry Pi 3 with an Ubuntu Server 15.10.3 image to host a WordPress website

I was trying to start a new WordPress site. Before hosting it on a Digital Ocean droplet, I decided to incubate the WordPress site on a Raspberry Pi 3 to clock some content. This post documents the steps that I took to set up a LEMP web server on Raspberry Pi 3 with an Ubuntu server 15.10.3 image to host a new WordPress site.

How I make my Jenkins Slave Windows Service recognize the global modules installed by npm

I was trying to setup a Jenkins Slave on a Windows machine which will get protractor to run a series of functional tests that the team had written to test our AngularJS application.

Idea was that whenever that there was a code change being committed to the master branch on our GitHub repository, the Jenkins Slave will be called upon to checkout the latest codes and get protractor to run the functional tests base from a configuration.js file in the codebase.

One of the hurdles that I encountered was that my Jenkins Slave Windows Service was not able to recognize the executables from Node.js modules that were installed by npm globally, which in this case was the protractor executable.

This post describes the steps that I took in order to make Jenkins Slave Windows Service recognize the global modules installed by npm.

How to look for unittest.TestCase subclasses defined in random Python scripts and run them in one shot

To ensure robustness of our Python application, members of the team had written unit test cases to assert that the various code units of the application are working as intended. Unit test cases that are meant to test the same program component are placed together as functions of the same class and contained in a Python script.

As the Python application grows, the number of test scripts grew as well. In an attempt to perform automated unit testing with Jenkins, the first thing that I did was to write a Python script that will look for all the test cases in the application directory and run them at one go.

This post describes the Python script in detail.

How I solved the database connection error from my WordPress installation which is hosted on the default PHP FPM server in Mac OS X EL Capitan

I was trying to setup a WordPress instance with the built-in PHP-FPM server on my Mac OS X el Capitan. After applying the relevant Nginx configurations for WordPress installations, I had been able to run the php codes from my WordPress instance.

However, when I tried to run the WordPress install script, my WordPress setup complained that it was unable to connect to the database server.

How to loop through lines of text in a text file from a shell script dynamically

There are times when we need to dynamically run shell commands based on the items listed in a text file.

The shell script that I ran in my bash shell does the following:
for each line separated by newline and not preceded by a ‘#’ character, print the line to console.

In order to build the shell script, I would need the following code pieces:

  • A way to remove/delete empty lines or leading and trailing whitespace in a text file
  • A way to loop through the text file, line by line
  • A way to check if the first character of the string

This post documents what I had ran in my bash shell (in Ubuntu 14.0.4) to loop through items separated by newlines in a text file.

Preventing image hotlinking with Nginx, with some style

Image hotlinking is a situation when your image appears on other website(s) but that image was actually being served by your web server. Image hotlinking is bad; your image gets stolen from your website and your server resources is being spent to serve them. If you happen to be running Nginx as your web server, this post describes how you can use Nginx to prevent image hotlinking with a smarter way that was suggested by Hongkiat.

How to manually add a public PGP key to Ubuntu’s Advanced Packaging Tool (APT)

I was trying to install docker on my Ubuntu server as an initial step to set up a continuous integration server for my Python project. As I was following through the guide provided by docker, I was not able to proceed with adding the public PGP key of docker’s apt repository at Ubuntu’s Advanced Packaging Tool (APT) key store automatically. This post describes what I did to manually add the public PGP key to the APT key store.