Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 10:01 am on April 13, 2015 Permalink | Reply  
    Categories: Announcements, Linux ( 7 )

    LAMP Stack for Humans – now available on Amazon 

    Lampstack-SoftcoverMy book LAMP Stack for Humans is now available on Amazon. It this 284 page guide I’ll walk you through the process of turning an old laptop into an always-on server. You can use it to run web applications in the comfort of your own home or office – no “cloud” required.

    Together we will configure the entire server: you will learn how to install CentOS, Apache, PHP and MySQL (or MariaDB) and WordPress. I will show you how you can reach your server from other computers on the network and how to create regular backups.

    Perfect for the Linux newbie and those who want to get started with web applications without spending money “in the cloud” (in my opinion THE WORST expression for describing remote computers).

    If you’re an avid reader of this site and have always wished that some instructions would be presented in a more cohesive form rather than in snippets, then LAMP Stack for Humans is perfect for you.


    Grab your free sample today, or read the entire book for free via Kindle Unlimited!


    • Falkon 2:28 am on October 21, 2015 Permalink | Reply

      Hi Jay
      I have a question regarding WP adding a Landing page for an existing site, meaning to add a new page which only displays a big logo in the start and be able to make that logo a roleover logo, and then the click would navigate a user to the main ( index page) if you will. i am new to WP and PHP wise I am still learning so I would not know how to add an extra page as the index page and the first index page turns say into a home.html. How would you do that? I trying to learn PHP and WP to what I work with in HTML & CSS and front end designs.
      Beforehand allow me to thank you for you time, help and assistance,

      Best Regards

      • Jay Versluis 2:55 pm on October 21, 2015 Permalink | Reply

        Hi Falkon, that’s a VERY off-topic question for this post…

        WordPress does have a way to display a static page as front page, instead of the default blog posts. You can change it like this:

        • for the blog, create a new page with a title (no content is necessary)
        • head over to Settings – Reading
        • under Front Page Displays, select your pages
        • hit Save and refresh the front page

        As for the roll-over image: insert an image into your static front page, then link that image to wherever you want (you can do that with Add Media from the page creation dialogue).

        Hope this helps!

  • Jay Versluis 11:03 am on November 24, 2015 Permalink | Reply

    Categories: Themes, WordPress ( 25 )

    How to turn plain URLs into clickable links in WordPress 

    The marvellous P2 Theme has an interesting feature: write out a plain link, and it magically becomes clickable without explicitly adding the a href tag.

    This may not be a big deal if you’re writing posts in the visual WordPress editor rather than HTML, but for those of us who like to write in HTML, it’s just one less thing to worry about.

    I was investigating this feature recently, and it turns out WordPress has a built-in function that can do this: they call it make_clickable(), and it works with URIs, FTP, Email addresses and anything starting with www. The function is really easy to use too: it only takes one parameter (a string), and returns the clickable HTML code.

    $clickableText = make_clickable($plainText);

    Let’s see how to use it in context, using the TwentyThirteen theme.

    (More …)

  • Jay Versluis 9:58 am on November 21, 2015 Permalink | Reply
    Tags: ,   

    Categories: WordPress ( 131 )

    How to display Jetpack stats per post in WordPress 

    Some websites employ this or similar technologies to show how many views a single post has had. I was wondering how they did that without starting to count stats that have already been counted for several years, either by Google or by Jetpack.

    Yesterday I came across this post by Topher about how to render Jetpack Stats:

    I decided to test this in TwentyThirteen, and it works a treat – here’s how to do it. The principle will of course work with any theme.

    (More …)

    • Jay Versluis 11:41 am on November 23, 2015 Permalink | Reply

      Notice that if you have over 500 posts, or your website has been around for longer than 3 years, Jetpack has a LOT of stats to fetch. If you experience a 500 Server Error, this is an indication of a Jetpack timeout – in which case, the above approach is probably not for you.

      Just thought I’d let you know.

  • Jay Versluis 2:21 pm on November 19, 2015 Permalink | Reply

    Categories: Plugins, WordPress ( 19 )

    Zen Dash – Version 1.5 released 


    I’ve just released an update to my Zen Dash plugin. Besides adding funky zen-bamboo artwork to the page, I’ve made the following minor amendments:

    • the option to hide the Jetpack menu now only shows up when Jetpack is activated, otherwise it’s hidden
    • I’ve verified compatibility with the immanent release of WordPress 4.4
    • added funky zen-artwork (see above, courtesy of GraphicStock)

    I’ve you’re one of the 70+ active lucky users, you can upgrade the plugin from within WordPress as usual, or you can download a copy from GitHub or the plugin repository:

    Questions, suggestions, translations and pull requests are always welcome!

    What is Zen Dash again?

    Zen Dash is a magical plugin that lets you get rid of the myriad of options in the WordPress admin area. I’ve created it because sometimes less is indeed more, and new users can get overwhelmed by the sheer volume of menu items, dashboard widgets and upgrade notifications.

    While it is possible to let casual users have privileges less than administrators (and therefore see less items), I found this ineffective. With Zen Dash you simply flick a switch and make things disappear that you don’t want to see everyday. You can just as easily bring them back if you need them.

    You can read more about Zen Dash in my release post, which even includes a video on how to use the plugin.

  • Jay Versluis 12:14 pm on November 19, 2015 Permalink | Reply

    Categories: Linux, Mac OS X ( 75 )

    How to see which users are logged in on OS X and Linux 

    There are two funky commands that can help us see who’s currently logged in, and what operations were performed last. Those two commands are who and last.

    Let me show you how to use them.

    The who command

    Type who at the command prompt and you’ll see a list of currently logged-in users:

    versluis tty1         2015-11-19 11:21 (:0)
    root     pts/0        2015-11-19 11:46 (

    This system has two users logged in: versluis, via TTY, and root via PTS. We also get to see which IP addresses these users are logged in from (:0 is localhost).

    On this note, TTY is the local text based terminal at the machine, while PTS is a pseudo-terminal. This is most likely an SSH session or similar, anything that’s happening remotely.

    who can also show us who we are, in case you’re ever logged in on a system and don’t know which user you are:

    who am i

    You can also concatenate who am i into whoami.

    The last command

    The last command can take a moment to execute and will show a list similar to this:

    versluis tty1         :0               Tue Feb 10 18:54 - down  (4+13:11)   
    reboot   system boot  2.6.32-504.8.1.e Tue Feb 10 18:51 - 08:05 (4+13:14)   
    root     pts/1        Tue Feb 10 16:33 - 16:44  (00:10)    
    root     pts/0        Tue Feb 10 11:36 - down   (07:13)    
    versluis pts/0        :0.0             Tue Feb 10 11:35 - 11:35  (00:00)    
    versluis tty1         :0               Tue Feb 10 11:29 - down   (07:20)    
    reboot   system boot  2.6.32-504.8.1.e Tue Feb 10 11:27 - 18:50  (07:22)    
    root     tty1                          Tue Feb 10 11:16 - down   (00:09)    
    reboot   system boot  2.6.32-504.8.1.e Tue Feb 10 11:15 - 11:25  (00:10)    
    reboot   system boot  2.6.32-504.8.1.e Tue Feb 10 10:59 - 11:25  (00:26)    
    root     tty1                          Tue Feb 10 10:29 - down   (00:28)    
    reboot   system boot  2.6.32-504.el6.i Tue Feb 10 10:28 - 10:58  (00:29)    
    wtmp begins Tue Feb 10 10:28:53 2015

    You can see who has logged in to the system recently, from which IP address, and when each session started and finished. You can also see when the system was last restarted (and in Linux, which Kernel was used to do so).

    The last line (on Linux, beginning with wtmp) shows since when the command was able to display results. last and who both read a file called wtmp (in /var/log/wtmp), which logs all login attempts over time.

    last accepts several filtering options too. For example, to query when a particular user has logged on and off, type last followed by the username:

    last versluis
    versluis tty1         :0               Thu Nov 19 11:21   still logged in   
    versluis tty1         :0               Tue Nov 17 12:44 - 22:32  (09:48)    
    versluis tty1         :0               Tue Nov 17 11:13 - down   (01:29)    
    versluis tty1         :0               Sat Oct 31 23:35 - crash (16+12:37)  
    versluis tty1         :0               Sun Aug  9 09:09 - down  (83+14:24)  
    versluis tty1         :0               Tue Jun 30 18:03 - down  (39+15:04)  
    versluis pts/0        Thu Feb 19 14:41 - 18:34  (03:52)

    Or if you’re only interested in restarts:

    last reboot
    reboot   system boot  2.6.32-573.8.1.e Thu Nov 19 11:20 - 12:02  (00:41)    
    reboot   system boot  2.6.32-573.8.1.e Tue Nov 17 12:43 - 12:02 (1+23:18)   
    reboot   system boot  2.6.32-573.7.1.e Tue Nov 17 11:12 - 12:42  (01:29)    
    reboot   system boot  2.6.32-573.7.1.e Sat Oct 31 23:34 - 12:42 (16+14:07)  
    reboot   system boot  2.6.32-573.1.1.e Sun Aug  9 09:08 - 23:33 (83+14:24)  
    reboot   system boot  2.6.32-504.23.4. Tue Jun 30 18:02 - 09:07 (39+15:05)  
    reboot   system boot  2.6.32-504.8.1.e Sun Feb 15 11:30 - 09:07 (174+20:37) 

    On OS X the output is somewhat more limited due to the absence of kernels, but it works just the same. For more information on each command, checkout the man pages with man last and man who.

  • Jay Versluis 6:06 pm on November 16, 2015 Permalink | Reply

    Categories: Mac OS X ( 22 )

    How to burn an ISO image with OS X El Capitan 


    Sometimes it’s important that things change for no apparent reason. You know, the way they move things around in supermarkets just to drive you crazy.

    If you’ve tried burning an ISO image to disk in El Capitan recently, you know what I’m talking about:

    because the option to burn an ISO has been removed from Disk Utility.

    Yeah, I get it: plastic disks are out, no one should be using them anymore, there are no more Macs with SuperDrives in production as of 2016, so it’s time to remove this option from the built-in utility that had it for the last ten years. Think different. It keeps you sharp.

    Lucky for us plastic spinners, there are two (not so obvious) solutions: the command line and the good old Finder that can still burn disks for us. Here’s how to do it.

    Using Finder

    Apparently Finder always had the option to burn a disk image. I never knew that! All we have to do is:

    • insert a new blank disk
    • navigate to our ISO image
    • select it (single-click)
    • head over to File – Burn Disk Image “xxx” to Disk

    Screen Shot 2015-11-16 at 18.00.40

    Using the Command Line

    It’s for hackers really, but it’s very simple:

    • insert a blank disk
    • open Utilities – Terminal
    • navigate to the folder that holds your ISO image
    • issue the following command:
    hdiutil burn /path/to/your/image.iso
    Preparing data for burn
    Opening session
    Opening track
    Writing track
    Closing track
    Closing session
    Finishing burn
    Verifying burn…
    Burn completed successfully
    hdiutil: burn: completed

    El Capitan. There’s just more to love with every click.

  • Jay Versluis 1:15 pm on November 12, 2015 Permalink | Reply
    Tags: ,   

    Categories: Plugins, WordPress ( 19 )

    Child Theme Wizard – Version 1.1 released 


    I’ve released a new version of my popular Child Theme Wizard plugin today. Everything remains the same, except for one thing: the parent theme is no longer loaded via CSS, it’s now being loaded via PHP. Let me explain why.

    When I wrote this little tool in 2014, the best practice to create a child theme was to load the parent’s style sheet via CSS. This was done with an @import statement, like this:

    @import url("parent-theme/style.css");

    While this approach works just fine, this is no longer regarded as the best approach to the puzzle. That’s because the parent theme’s full path is hard coded into your child theme, and should the parent theme ever change it’s folder name, your child theme would stop working.

    There’s a better way to get the same thing done by loading the parent style sheet via PHP in the functions.php file. Here’s how it’s done:

    function theme_enqueue_styles() {
        $parent_style = 'parent-style';
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style )
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

    So that’s what the update does: switch from the older way of loading the parent theme to the new one. There. Keeping up with the times and all :-)

    Download Child Theme Wizard

    You can download the plugin from the official WordPress Plugin repository, or take a look at the source code on GitHub. Enjoy!

  • Jay Versluis 12:28 pm on November 10, 2015 Permalink | Reply

    Categories: WordPress ( 131 )

    How to open WordPress Custom Menu links in a new tab 

    My wife is currently attending a blogging course at The Daily Post’s Blogging University.

    One thing that was bugging her (and me) was that Custom Links in the WordPress Menu do not open in new browser tabs. The default behaviour is to open links in the same tab, which is useful for internal site navigation.

    I explained to her that in plain HTML, we would just use a target such as “_blank” in our link tag, but I didn’t see how to apply my old fashioned knowledge to something so sophisticated and elegant as the WordPress Menu Manager.

    Thanks to the wonderful Kathryn Presner, my wife just told me the solution to this puzzle: enable the link targets in your WordPress Screen Options!

    Screen Options is this little menu at the top left in the WordPress admin interface we often forget to look at. Its content changes dynamically for every part of WordPress, and it includes a wonderful help system too – in case we ever get stuck.

    So how do we do this new tab thing?

    Head over to Appearance – Menus and select Screen Options at the top right. It will open a menu similar to this:


    See the tick box that reads Link Target? Click it and close the menu again.

    Now open one of your links (or create a new one) and find another magic tick box labelled Open link in a new window/tab.

    Screen Shot 2015-11-10 at 12.04.21

    Tick it and save your menu. Head over to the front page and see your link open in a new tab from now on. #result

    Thanks to Julia and Kathryn for bringing this to my attention 😉

  • Jay Versluis 3:31 pm on November 9, 2015 Permalink | Reply
    Tags: , Spam   

    Categories: Linux ( 75 )

    How to remove an IP from the CBL (Composite Blocking List) 

    Today I was introduced to something called the CBL, or the Composite Blocking List. This is one of several Spamhaus projects that’s there to make sure IP’s are blacklisted when they’re sending spam.

    You can check if your IP’s are OK at

    The CBL is a separate website in which you can also lookup IPs. Spamhaus will tell you if that’s the case and direct you to the CBL here:

    Even though my IP was otherwise fine, it was listed in the CBL, and Yahoo kindly made me aware of this as part of an error message I’ve received when trying to send an email. If ever there is an email problem in CentOS, the first place to look is /var/log/maillog. Here’s Yahoo’s very helpful explanation:

    Turns out that the hostname was not setup yet, so the box would respond as localhost.localdomain. That’s a big fat no-no as far as the CBL people are concerned. Here’s CBL’s explanation:

    This IP address is HELO’ing as “localhost.localdomain” which violates the relevant standards (specifically: RFC5321).

    The CBL does not list for RFC violations per-se. This _particular_ behaviour, however, correlates strongly to spambot infections. In other words, out of thousands upon thousands of IP addresses HELO’ing this way, all but a handful are infected and spewing junk. Even if it isn’t an infection, it’s a misconfiguration that should be fixed, because many spam filtering mechanisms operate with the same rules, and it’s best to fix it regardless of whether the CBL notices it or not.

    (More …)

  • Jay Versluis 1:06 pm on November 9, 2015 Permalink | Reply

    Categories: Linux ( 75 )

    How to set the hostname on CentOS 7 

    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
    • 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 – but that’s not meaningful if you see lots of localhosts on the same network.

    If the IP of the box does not change, we can set the static hostname like this:

    hostnamectl sethostname --static

    No feedback means good news. Likewise, we can set a hostname if were using DHCP to get an IP address, even though it may change every time we connect. To make sure we retain the same name no matter what IP we get, let’s set the transient hostname like so:

    hostnamectl sethostname myserver --transient

    Note that we can’t use spaces or special characters with static or transient hostnames as far as I know.

    Lucky for us there’s also the pretty hostname, which does support special characters. It doesn’t usually appear anywhere on the command line, but GUIs like to display the pretty name of a machine when available:

    hostnamectl sethostame "Jay's MacBook Pro" --pretty

    There’s no need to restart anything, the changes are in effect as soon as we hit return after either command.

    To see the current hostnames, we can use the status switch:

    hostnamectl status
       Static hostname:
       Transient hostname: myserver
       Pretty hostname: Jay's MacBook Pro
             Icon name: computer-vm
               Chassis: vm
            Machine ID: 3d1ed70be1e940efaab8fb63b82822cc
               Boot ID: b95807c92b904fc192bd086b2596bea5
        Virtualization: kvm
      Operating System: CentOS Linux 7 (Core)
           CPE OS Name: cpe:/o:centos:centos:7
                Kernel: Linux 3.10.0-229.20.1.el7.x86_64
          Architecture: x86_64

    Thanks to Vivek Gite for this wonderful explanation!

  • Jay Versluis 12:08 pm on November 5, 2015 Permalink | Reply
    Tags: , ,   

    Categories: WordPress ( 131 )

    How to change fonts in TwentyFifteen by Automattic 

    TwentyFifteen uses the Noto Serif font. It looks swish and comes with an Apache license, and it can be pulled from Google Fonts too. It’s a fine font indeed – but individuals that we are, it may not be for everybody.

    It’s easy to change it to something else though, and in this article I’ll show you how.

    By default, TwentyFifteen and Noto Serif looks like this:

    Screen Shot 2015-11-05 at 11.58.15

    If we want to change this to something else, we must first import said font into our style sheet, and then declare it for a couple of classes. In this example I’m going to use Lato, another fabulous font that’s featured in the TwentyFourteen theme:

    /* import the new font */
    @import url(;
    /* change the font to something else */
    body, .entry-content, .page-title {
    	font-family: Lato, Georgia, "Times New Roman", Times, serif;

    Now TwentyFifteen will look like this:

    Screen Shot 2015-11-05 at 11.59.27

    If for some reason Lato cannot be downloaded, the browser will try to display text in the next font we declared (Georgia – and if that fails, it’ll try Times New Roman… you get the picture).

compose new post
next post/next comment
previous post/previous comment
show/hide comments
go to top
go to login
show/hide help
shift + esc