A collection of articles by Benjamin Cane



Easy Container Cleanup in Cron + Docker Environments

Published on: 2018-01-30 | 6 min read

Let's explore two flags that make it easier to run Dockerized Cron jobs, as well as how we would traditionally create and clean up a Docker container.


Using the Add-Host Flag for DNS Mapping within Docker Containers

Published on: 2017-12-18 | 6 min read

Let's explore a single Docker run command option, specifically, the add-host flag, which allows us to change DNS within a container.


Adjusting Linux Kernel Parameters with Docker Compose

Published on: 2017-12-14 | 6 min read

In today's article, we will explore how to adjust Linux Kernel Parameters, an often overlooked but "useful when you need it" feature of Docker Compose.


Using Docker Commit to Create and Change an Image

Published on: 2017-11-22 | 5 min read

In today's article, I'm going to show you another way to create and change a Docker image. We will do this using the Docker Commit command.


3 Different Ways to Provide Docker Build Context

Published on: 2017-09-21 | 6 min read

In this article, we are specifically going to focus on different ways to provide the Docker Build command a source or context to build from.

Eliminate the Database for Higher Availability

Published on: 2017-07-24 | 12 min read

Read about a design strategy unique to platforms that require both high scalability and high availability. A design strategy that involves reducing and removing the need for databases.


Using Docker Push to Publish Images to Docker Hub

Published on: 2017-07-19 | 5 min read

Let's use this feature while learning the `docker push` command and using it to upload our Docker container image to Docker Hub.


Understanding Dockers CMD and ENTRYPOINT Instructions

Published on: 2017-06-21 | 6 min read

On the surface, Docker's `CMD` and `ENTRYPOINT` instructions appear to perform the same function. But once you dig, they perform completely different tasks.


Leveraging the dockerignore File to Create Smaller Images

Published on: 2017-05-18 | 7 min read

There are several techniques for keeping images small. In today's article, we will explore an often-ignored technique, using the dockerignore file.

Using stunnel and TinyProxy to obfuscate HTTP traffic

Published on: 2017-04-15 | 9 min read

Using stunnel to create an SSL tunnel to a TinyProxy HTTP proxy


Using Docker Behind a Proxy

Published on: 2017-03-28 | 7 min read

Routing internet traffic through a proxy often neglects command line tools such as Docker. Here's how to use Docker without direct internet access.


Improving Linux System Performance with I/O Scheduler Tuning

Published on: 2017-02-08 | 9 min read

Let's adjust a Linux I/O scheduler to get the best performance out of a Linux system. We'll measure the impact of those changes with `pgbench`.


Tuning PostgreSQL with pgbench

Published on: 2017-01-05 | 10 min read

To answer the challenges of tuning a database, let's explore `pgbench`, a benchmarking tool used to measure performance of a PostgreSQL instance.


Getting Every Microsecond Out of uWSGI

Published on: 2016-12-07 | 12 min read

Going further down the stack in our performance-tuning series, let's explore tuning a Python application running via uWSGI.


Performance Tuning HAProxy

Published on: 2016-11-15 | 11 min read

Let's explore some performance-tuning concepts and walk through some tuning options for HAProxy, installing and configuring HAProxy as a load balancer.


Pregenerating Static Web Pages for Better Performance

Published on: 2016-10-06 | 10 min read

Let's increase our web application's performance by pregenerating the results of our "dynamic" pages and saving those results into a file cache.


Tuning NGINX for Better Performance

Published on: 2016-09-20 | 10 min read

Here's how to tune an out-of-the-box instance of NGINX to get more out of an already high-performance web server with a few common NGINX tuning parameters.


Running Services within a Docker Swarm

Published on: 2016-08-16 | 11 min read

Docker Engine v1.12 included a few changes to the capabilities of Docker Swarm. Let's explore how to deploy a service using Docker's Swarm Mode.

Using salt-ssh to install Salt

Published on: 2016-07-19 | 9 min read

Using SaltStack's ability to run agentless over SSH to install the salt-minion agent


Using Honcho to Create a Multi-Process Docker Container

Published on: 2016-07-06 | 8 min read

Let's use Honcho to create a custom multi-process Docker container. This container will host a Redis service that supports TLS connections.


Ensuring Containers Are Always Running with Docker's Restart Policy

Published on: 2016-05-31 | 9 min read

In today's article we will discuss how to use Docker's restart policy to automatically restart containers and avoid those late-night notifications.

Creating a swap file for tiny cloud servers

Published on: 2016-05-18 | 5 min read

What is swap, and how to use a swap file to add memory to low memory cloud servers


Getting started with Kubernetes

Published on: 2016-04-27 | 10 min read

Let's learn about Kubernetes by deploying a simple web application across a multinode Kubernetes cluster.

Create self-managing servers with Masterless Saltstack Minions

Published on: 2016-03-22 | 13 min read

Using Saltstack's Masterless Minion architecture to create self-managing infrastructure

Using Travis CI to test Docker builds

Published on: 2016-01-11 | 9 min read

Walk-through on getting started with Travis CI and how to use Travis CI to test Docker builds

Getting started with Docker by Dockerizing this Blog

Published on: 2015-12-01 | 15 min read

This article covers the basic concepts of Docker and how to Dockerize an application by creating a custom Dockerfile

Preventing duplicate cron job executions

Published on: 2015-09-22 | 9 min read

This article will show both BASH code and utilities that can be used to prevent a cron job from having multiple running instances

Building Self-Healing Applications with Saltstack

Published on: 2014-12-30 | 7 min read

This article will explore creating an application that detects errors and corrects them by integrating Saltstack's API

A Quick and Practical Reference for tcpdump

Published on: 2014-10-13 | 19 min read

This article is a quick and practical reference for tcpdump, it covers the basics and dives a little bit into advanced usage. This article should cover everything a systems or network administrator needs to get started and troubleshoot issues quickly

Understanding Exit Codes and how to use them in bash scripts

Published on: 2014-09-02 | 4 min read

When writing a script that calls other commands, how do you know if they were successful or not? The answer is exit codes, exit codes are important and this article describes how to use them in your scripts and understand them in general.

Removing packages and configurations with apt-get

Published on: 2014-08-18 | 5 min read

Removing an installed package with apt-get isn't as straight forward as you would think. This article walks you through removing a package the right way to allow for re-installation later and how to fix when an install will not deploy configuration files.

Using salt-api to integrate SaltStack with other services

Published on: 2014-07-17 | 5 min read

This article will walk you through using salt-api as an entry point for other services to call SaltStack to initiate actions within your infrastructure.

8 Tips for creating better bash scripts

Published on: 2014-06-06 | 8 min read

This article covers some simple bash scripting best practices that can be used to improve the quality of your shell scripts.

Using Saltstack to update all hosts, but not at the same time

Published on: 2014-05-19 | 12 min read

This article describes several methods of updating salt minions and how to roll out those updates at different times to avoid taking down all hosts at the same time.

Using sysdig to Troubleshoot like a boss

Published on: 2014-04-18 | 6 min read

An introduction to sysdig, a new tool for advanced system troubleshooting.

Understanding the kill command, and how to terminate processes in Linux

Published on: 2014-04-01 | 5 min read

This article covers the Linux kill command and how it sends signals to terminate processes. Also why you should avoid using kill -9.

Getting around the Linux directory structure with the cd command

Published on: 2014-03-05 | 3 min read

An overview of the Linux directory structure and how to move around it with the cd command.

Sending redis traffic through an SSL tunnel with stunnel

Published on: 2014-02-18 | 6 min read

This article covers how to secure and encrypt redis traffic by using stunnel. Redis does not by default support SSL encryption, by using stunnel you can forward all redis traffic through a specified SSL tunnel.

Converting files from Windows format to Unix format with dos2unix

Published on: 2014-02-11 | 3 min read

This article explains what end of line characters are and how to use dos2unix to convert files that contain Windows EOL characters to a Unix format.

SaltStack: Getting redundancy and scalability with multiple master servers

Published on: 2014-02-04 | 7 min read

A how to article on setting up multiple saltstack master servers for redundancy and scalability. With SaltStack you can easily setup 2 or more master servers in a round robin configuration to provide high availability and scalability to your infrastructure automation tools.

8 examples of Bash if statements to get you started

Published on: 2014-01-27 | 5 min read

This article shows examples of how to use BASH if statements in scripts and command line. This is a good starter tutorial for those who haven't quite mastered BASH yet.

Using rsync to synchronize a local and remote directory

Published on: 2014-01-07 | 4 min read

An introduction to rsync and instructions on how to setup an automated rsync copy between two hosts

Yum Plugins: Verifying packages and configurations with Yum Verify

Published on: 2013-12-23 | 2 min read

An introduction to Yum Plugins and Yum Verify

Installing Redis and setting up Master - Slave Replication

Published on: 2013-11-12 | 3 min read

A guide on how to install Redis and setup Master - Slave replication between two or more Redis instances

Managing DNS locally with /etc/hosts

Published on: 2013-10-29 | 3 min read

An article that explains what the heck the /etc/hosts file is and how you can use it to manage DNS locally

5 Bash for loop examples to make command line tasks more efficient

Published on: 2013-10-21 | 4 min read

Examples of bash for loops that can make any shell users life easier

Install RackTables and start tracking your IP address inventory

Published on: 2013-10-14 | 4 min read

RackTables is an interesting IT inventory tracking system that can be used to track IP addresses as well as the hardware they are attached to.

Symlinks vs Hardlinks and how to create them

Published on: 2013-10-10 | 4 min read

An article that explains the differences between symlinks and hardlinks and how to create them

Changing the default nice value for a user or group

Published on: 2013-09-30 | 1 min read

How to make a niceness value default for any user or group using /etc/security/limits.conf

Remote Command Execution with SaltStack

Published on: 2013-09-23 | 4 min read

A guide on using the Remote Command Execution abilities of SaltStack

Understanding a little more about /etc/profile and /etc/bashrc

Published on: 2013-09-16 | 2 min read

What is the /etc/profile and /etc/bashrc files? What do they do? Read more to find out.

Setting process CPU priority with nice and renice

Published on: 2013-09-09 | 3 min read

How to set a CPU priority (niceness) value with the nice and renice commands

Getting started with SaltStack by example: Automatically Installing nginx

Published on: 2013-09-03 | 8 min read

A walkthrough on installing and setting up SaltStack using nginx as an example usecase

Finding the OS version & Distribution in Linux

Published on: 2013-08-28 | 0 min read

A simple trick on finding out the OS version and Distribution of a Linux system you have command line access to

Reading files in reverse with tac

Published on: 2013-08-26 | 1 min read

A cool trick that shows how to read files in reverse with the tac command

Grepping a file without using cat, and other grep tricks

Published on: 2013-08-19 | 2 min read

A lot of sysadmins don't realize you can use grep without cat, this article should settle that. It also shows some other grep tricks.

SSH: Disable Host Checking for Scripts & Automation

Published on: 2013-07-22 | 1 min read

How to disable SSH host checking for both scripts and lazy users

Adding and Modifying Users and Groups in Linux

Published on: 2013-06-24 | 3 min read

An indepth guide on how to create and modify users and some simple tips that make user administration less of a nightmare

mkisofs: Repackaging a Linux Install ISO

Published on: 2013-06-12 | 0 min read

Repackaging a Linux installation DVD using mkisofs

ssh-keygen: Creating SSH Private/Public Keys

Published on: 2013-06-10 | 1 min read

A how to on generating SSH Private and Public keys and using them for passphrase less logins

EMC PowerPath: superblock could not be read

Published on: 2013-06-05 | 1 min read

How to get around a simple setup issue where fsck tries to check a SAN disk before EMC PowerPath starts

Packing and Unpacking files with GNU Tar

Published on: 2013-05-23 | 5 min read

Simple guide on using a basic Unix and Linux tool GNU tar

Securely backing up your files with rdiff-backup and sudo

Published on: 2013-05-20 | 9 min read

A guide on setting up rdiff-backup and using sudo to run rdiff-backup without running it as the root user

Removing Files and Directories with rm and rmdir

Published on: 2013-05-13 | 2 min read

A simple guide on using rm and rmdir some of the basic Shell commands in Linux and Unix environments

Adding and Troubleshooting Static Routes on Red Hat based Linux Distributions

Published on: 2013-05-12 | 4 min read

Walkthrough on what Static Routes are and how to add them on Red Hat based Linux Distributions

Websphere MQ Cheat Sheet for System Administrators

Published on: 2013-04-22 | 2 min read

A simple cheat sheet that shows commands every sysadmin managing WebSphere MQ could use

Creating a local Yum Repository

Published on: 2013-04-15 | 2 min read

A walkthrough on creating your own local Yum Repository and keeping it synchronized automatically

How to force GPFS (or other tools) to connect via an alternate ssh port

Published on: 2013-03-19 | 2 min read

A simple solution to force SSH clients to default to a port other than 22

10 nmap Commands Every Sysadmin Should Know

Published on: 2013-02-25 | 5 min read

A cheat sheet list of 10 nmap commands that are extremely useful for every Systems or Network Administrator

Mitigating DoS Attacks with a null (or Blackhole) Route on Linux

Published on: 2013-01-14 | 2 min read

A guide on how to lessen the damage of a DoS attack by using a null route in Linux

Installing MySQL on Ubuntu/Debian

Published on: 2012-12-05 | 1 min read

How to install MySQL on Ubuntu or Debian based Linux Systems using apt-get

NFS: Setting up a basic NFS file system share

Published on: 2012-11-23 | 4 min read

Cheat Sheet: Cutting Text with cut

Published on: 2012-10-22 | 1 min read

iptables: Linux firewall rules for a basic Web Server

Published on: 2012-09-17 | 12 min read

A walkthrough on setting up a basic Linux Firewall for Webservers with FTP, SSH, MySQL and DNS services

Cheat Sheet: Crontab by Example

Published on: 2012-09-03 | 3 min read

Advanced Linux System Statistics and Diagnostics with SystemTap

Published on: 2012-08-20 | 4 min read

xargs: Build and Execute Commands with Arguments from Standard Input

Published on: 2012-08-13 | 5 min read

Troubleshooting High I/O Wait in Linux

Published on: 2012-08-06 | 5 min read

A walkthrough on how to find processes that are causing high I/O Wait on Linux Systems

Cheat Sheet: 21 useful find commands

Published on: 2012-07-22 | 1 min read

tc: Adding simulated network latency to your Linux server

Published on: 2012-07-16 | 1 min read

Sar & Sysstat: Linux Performance Statistics with Ease

Published on: 2012-07-08 | 6 min read

Tutorial on installing the sysstat package and using sar to identify performance statistics

When Zombies Invade Linux: What are Zombie Processes and What to do about them

Published on: 2012-07-02 | 3 min read

ACL: Using Access Control Lists on Linux

Published on: 2012-05-27 | 7 min read

A tutorial showing how to enable Linux Access Control Lists as well as how to use ACL's to go beyond basic permissions

Stat: Detailed information about a file

Published on: 2012-05-24 | 1 min read

Unix Shell: The Art of I/O Redirection

Published on: 2012-04-16 | 3 min read

Sysadmin Tools: Managing Linux from a Windows Desktop

Published on: 2012-04-01 | 3 min read

Linux Troubleshooting with strace

Published on: 2012-03-24 | 3 min read

Sudoedit: Securely allow users to edit files

Published on: 2012-02-26 | 2 min read

Why you should avoid running applications as root

Published on: 2012-02-20 | 1 min read

Cheat Sheet: systemctl vs chkconfig

Published on: 2012-01-19 | 0 min read

A simple cheat sheet that shows how to perform the same task with both systemctl and chkconfig

When it's Ok and Not Ok to use rc.local

Published on: 2011-12-30 | 2 min read

An article that discusses when it is appropriate and when it is not appropriate to use the rc.local file. A file that has been depreciated in some Linux distributions.

MySQL: tee saving your output to a file

Published on: 2011-12-26 | 0 min read

Learn to use the MySQL tee command to save the MySQL CLI output to a file and to your tty

Creating a new filesystem with fdisk, lvm, and mkfs

Published on: 2011-12-19 | 3 min read

Simple walkthrough on how to create a new Linux filesystem using LVM, fdisk and mkfs

Creating a read-only backup user for mysqldump

Published on: 2011-12-12 | 1 min read

How to create a read-only user that can be used for MySQL backups with mysqldump

How to check if a cron job ran

Published on: 2011-11-02 | 2 min read

This article shows a simple method to validate whether or not a cronjob ran on both Red Hat/Fedora based and Debian based Linux Systems

dscacheutil: Clearing DNS cache on OSX

Published on: 2011-10-25 | 0 min read

mysql: Creating a db and user

Published on: 2011-10-19 | 1 min read

How to setup a basic mysql database and database user with privileges to only the newly created database

gzip: Restoring original filename

Published on: 2011-10-14 | 1 min read

VirtualBox: Mom please stop getting spyware (Cheap VDI)

Published on: 2011-10-12 | 4 min read

bind: Checking a zone record for errors

Published on: 2011-10-06 | 0 min read

kill: Creating a core dump

Published on: 2011-09-22 | 1 min read

bash: Field Separator Variable

Published on: 2011-09-20 | 0 min read

mysql: Backup your user privileges

Published on: 2011-09-15 | 0 min read

How to backup your mysql privileges to a CSV file

find: Print type of file, inode #, filename and link destination

Published on: 2011-09-13 | 0 min read

mount: Disabling execution of scripts

Published on: 2011-09-08 | 0 min read

fsck: Force a filesystem check on next reboot

Published on: 2011-09-06 | 0 min read

grep: Counting Results

Published on: 2011-09-01 | 0 min read

Top: Show CPU Usage on all cores

Published on: 2011-08-28 | 0 min read

time: Tracking execution time

Published on: 2011-08-27 | 0 min read

dpkg: Listing installed packages

Published on: 2011-08-27 | 0 min read

Debian Packages: Installing

Published on: 2011-08-24 | 0 min read

apt: Searching for packages

Published on: 2011-08-24 | 0 min read

Websphere MQ: saveqmgr

Published on: 2011-08-21 | 0 min read

Sudo: Running as a specific user

Published on: 2011-08-20 | 0 min read

Find broken Links

Published on: 2011-08-19 | 0 min read

find: Remove files modified more than 31 days ago

Published on: 2011-08-18 | 0 min read

Sudo: List available commands

Published on: 2011-08-17 | 0 min read

ulimit: Checking the user limits of running processes

Published on: 2011-08-16 | 0 min read

Find: Print Size, Modify Date, Type, and Filename

Published on: 2011-08-15 | 0 min read

Find the biggest directories with du

Published on: 2011-08-14 | 0 min read

pstree: Associating Child Processes

Published on: 2011-08-13 | 0 min read

sar: System statistics

Published on: 2011-08-12 | 1 min read

yes: Repeated Text

Published on: 2011-08-11 | 0 min read

runlevel: Check your current runlevel. Then change it

Published on: 2011-08-10 | 0 min read

ssh: X11 Forwarding

Published on: 2011-08-09 | 0 min read

showmount: See available NFS Shares

Published on: 2011-08-08 | 0 min read

Counting with sort and uniq

Published on: 2011-08-06 | 0 min read

Filename manipulation with sed, awk and cut

Published on: 2011-08-05 | 1 min read

Bash: Repeated tasks with seq and for loops

Published on: 2011-08-04 | 1 min read

Yum: Search and Install

Published on: 2011-08-03 | 0 min read

Finding what installed a binary with YUM and RPM

Published on: 2011-08-03 | 0 min read

SMF: Enable apache [Solaris]

Published on: 2011-08-01 | 0 min read

tar: Exclude directories/files

Published on: 2011-07-26 | 0 min read

Checking your running kernel version

Published on: 2011-07-23 | 0 min read

Truncating a large log file

Published on: 2011-07-22 | 1 min read

rpm: Finding dependencies

Published on: 2011-07-22 | 0 min read

Quickly creating a CSV file

Published on: 2011-07-19 | 0 min read

sudoers: Syntax Checking

Published on: 2011-07-16 | 0 min read

Tar: Don't touch existing files

Published on: 2011-07-14 | 0 min read

Find files created today

Published on: 2011-07-14 | 0 min read

Create/Extract a tar file using contents of a file

Published on: 2011-07-14 | 0 min read

Argument list too long

Published on: 2011-07-13 | 1 min read

Editing big files on systems with little memory

Published on: 2011-07-09 | 0 min read

usermod: Appending to Additional Groups

Published on: 2011-07-08 | 1 min read

oom-killer: If you see this you should reboot

Published on: 2011-07-07 | 1 min read

mdadm: Manually fail a drive

Published on: 2011-07-06 | 2 min read

Do Symlinks use up Inodes?

Published on: 2011-07-01 | 0 min read


Published on: 2011-07-01 | 0 min read

The safest way to deploy a crontab

Published on: 2011-06-28 | 2 min read

sfdisk Goodies

Published on: 2011-06-25 | 0 min read

setfacl: Invalid argument near character

Published on: 2011-06-25 | 0 min read

Checking the number of LWP (threads) in Linux

Published on: 2011-06-25 | 1 min read