Hey Linode!

After getting my VPS shut down for a second time by Digital Ocean (which apparently was issuing DOS network packets – no further explanation from DO), I decided to give Linode another whirl.

And here we are.

Running Ubuntu 16.04 LTS and it’s a smooth as butta.

Software for now:

  • nginx 1.10
  • PHP 7.0.8
  • MySQL 5.7.15

Will also probably get Node v6 running up there soon too.

Linux – Blocking bad IPs

This is more an informational post for myself, but here’s some nifty commands that help debug what’s going wrong on a server when things aren’t going right.

netstat -t
netstat -tn

These are good for watching WHO is hitting your server and what their IP is. netstat -tn shows the unresolved address, so you should get the IP’s of possible spammers

Once you’ve got the IP(s) you can block them with iptables like so:

iptables -I INPUT -s <IP ADDRESS> -j DROP

Another good tool for watching network traffic is iftop. You’ll need to install this one via Yum or Apt though:

 iftop -N -i eth0


And for overall machine health, nothing beats good old htop! Ahh, CPU usage back to normal.


WordPress and Drupal Deployment – the Dev, Stage, Production conundrum

One of the issues us as developers face daily is the concept of deployment. Especially with a CMS. Here’s an overview of some of the tools and approaches out there.

Deployment (or environment syncing of dev > stage > production)  of a CMS/Website has the following components:

  1. Deploying code
  2. Deploying a database
  3. Running post deploy scripts.

Typically deployment is one way, from development to stage to production, although all the below can be performed in the opposite direction.

The following are some of the common methods of deployment:

Via (S)FTP or file syntonization – Old school

The old school method of deployment is by using scripts or manual process is to mirror dev, stage and production environments. Steps in this process involve manually exporting a database script and deploying that database to the staging or production environment. For files, they are copied directly to the staging/ production environment. Major drawbacks of this method are deployment tracking is lost and there is no easy rollback.

git deployment

A newer and currently popular method for deploying website/CMS files is by using git. With a git deployment strategy, a git remote target is setup (either staging or production) and a git push is run whenever these environments need to be updated. This however only updates CMS files, and not a database. Post deploy hooks can be called on the target server to mimic database changes and run other commands via shell commands (run unit tests or clear caches). The added benefit of this approach is that deployments are tracked in git and can be rolled back easily.

Script based approach

Similar to a git deployment, a script based approach can be used for deployment to staging and production sites. This approach relies more heavily on POSIX shell commands (like rysnc, grep and diff). This requires more up front work for deployment, but is much more customizable and ultimately  powerful. A combination of a script based approach and git deployment are common in the WordPress and Drupal worlds for deployment.

Continuous integration

A more robust build system can also be implemented. In a CI type environment, a combination of unit tests, code review, VCS and deployment can all be rolled into one. More robust and powerful than a script based approach, a CI deployment plan is almost bulletproof as most (Travis CI, Jenkins) mandate testing of code before passing a build. This approach requires the setup of a dedicated CI server that has hooks into the VCS (git, svn etc.) and still requires the integration of shell scripts to fully take advantage of.


More than scripts but less that full-fledged CI systems are some tools that can be used to deploy and sync WordPress and Drupal sites.


Capistrano is a Ruby based tool that became popular with the Ruby on Rails crowd as a way to deploy code. Similar to a git deployment process, Capistrano allows for command line deploys and post deploy hooks but allows for a robust roll-back feature. Capistrano is configured via config files and has a requirement that both host and target are running Ruby.



Drush is the Drupal-shell that allows for running command line scripts specifically on a Drupal codebase. Many things like installing modules, setting up sites and themes, basic database versioning to basic deployment via rsync, can be accomplished by Drush.



Another tool similar to Drush is wp-cli. A super powerful command line tool for managing WordPress, wp-cli does for WordPress what Drush does for Drupal. Custom commands can also be written to hook into custom code, themes and plugins. Cool.