How to set the hostname on CentOS and Fedora

CentOS 7 has a nice command called hostnamectl. With it we can display the current hostname, and set any of the three types of hostname: static hostname (something like example.com) transient hostname (anything you like, assigned when using DHCP) pretty hostname (something like Jay’s MacBook Pro) By default, a CentOS installation comes back with localhost.localdomain … Read more

How to avoid hyphenations in TwentyFifteen by Automattic

By default, TwentyFifteen will hyphenate text on posts and pages. This works well for most, but some find this feature annoying. It’s easy to override with a small CSS tweak – let me show you how. Here’s what a post might look like by default: Notice the hyphenations in lines 3 and 4. Now add … Read more

How to use the new Apple System Font SAN FRANCISCO on your website

Apple have a new System Font in El Capitan and all of their other products starting 2015: it’s called San Francisco. It’s very similar to their previous font Helvetica Neue, but apparently San Francisco is better for your eyes (not to mention the fact that Helvetica Neue isn’t owned by Apple, and obviously we can’t … Read more

OS X Server vs. Parallels Desktop – Overhead Differences

Screen Shot 2015-11-04 at 10.28.17

Ever wondered if there’s a difference in overhead and memory usage when you’re using a VM instead of OS X directly? Here’s a comparison for website hosting.

The above graph shows the difference of hosting one of my websites for the last few days on OS X Server (in blue) that I got from Hostgator (using their HostGator Thanksgiving Deal 2016 coupon), and in a CentOS VM under Parallels Desktop 10 on the same hardware (in red).

The traffic logs show that the amount of requests and visitors has remained the same, so we can deduce that the load put on either OS X and the VM is the same. There is a little more overhead when using the VM, but not as much as I had feared: the requests have to be forwarded to another software layer after all, and that takes some CPU power.

Let’s have a look at memory next:

Read more

How to install MySQL on Mac OS X El Capitan

MySQL 2015

There are several ways to install MySQL on your Mac, for example:

  • compile from source
  • use the Homebrew package manager (http://brew.sh)
  • use a nifty script courtesy of Mac Mini Vault (http://git.io/eUx7rg)
  • or use the dedicated MySQL installer package (recommended)

I recommend the dedicated installer because it’s the only package that will also add a convenient Preference Pane for starting and stopping the service.

In this article I’ll focus on the latter, and I’ll also talk you through how to add MySQL to the PATH variable and how to secure MySQL to keep the evildoers away from your server.

These instructions will work on Yosemite and El Capitan (I’ve tested it on both systems – in fact that’s part of why I’m writing this, so that I can remember for next time).

 

Screen Shot 2015-11-02 at 10.40.12

Read more

How to disable SSH access from everywhere except for certain IPs in CentOS 7

Here’s how to do it: firewall-cmd –zone=internal –add-service=ssh –permanent firewall-cmd –zone=internal –add-source=1.2.3.4/32 –permanent firewall-cmd –zone=internal –add-source=5.6.7.8/32 –permanent firewall-cmd –zone=public –remove-service=ssh –permanent firewall-cmd –reload This declares an internal zone with two IPs (add as many or as few as you like) and subsequently removes the SSH service from the public zone altogether. As a result, any … Read more