Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 11:31 am on December 2, 2015 Permalink | Reply
    Tags:   

    Categories: Mac OS X ( 26 )

    How to disable System Integrity Protection on OS X El Capitan 

    System Integrity Protection was introduced in El Capitan to add another layer of security to OS X. The system prevents the root user from doing things that are potentially harmful. Apple did this because any app at any time may ask for the administrator password and execute commands with elevated permissions, which is a big security risk on single user systems.

    There are downsides to yet another layer of security, and much like Gate Keeper, System Integrity Protection brings us one step closer to a completely locked off system like iOS. I guess that’s the long term plan.

    Until then, and if you need it, you can disable System Integrity Protection. Here’s how to do it:

    • boot into the Recovery Partition (hold down CMD + R during boot)
    • this takes a little longer than usual
    • when the system is back, select Utilities – Terminal
    • now type “csrutil disable”
    • close Terminal and restart the system

    You can check at any time if this feature is on or off by typing

    csrutil status
    
    System Integrity Protection status: disabled.
    

    Enable it again during a Recovery session by typing “csrutil enable” and El Capitan is secured again.

    To see what else this command has to offer, type csrutil without parameters:

    csrutil
    
    usage: csrutil <command>
    Modify the System Integrity Protection configuration. All configuration changes apply to the entire machine.
    Available commands:
    
        clear
            Clear the existing configuration. Only available in Recovery OS.
        disable
            Disable the protection on the machine. Only available in Recovery OS.
        enable
            Enable the protection on the machine. Only available in Recovery OS.
        status
            Display the current configuration.
    
        netboot
            add <address>
                Insert a new IPv4 address in the list of allowed NetBoot sources.
            list
                Print the list of allowed NetBoot sources.
            remove <address>
                Remove an IPv4 address from the list of allowed NetBoot sources.
    
     
  • Jay Versluis 11:03 am on November 24, 2015 Permalink | Reply
    Tags:   

    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 ( 132 )

    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: http://wpgr.org/2013/03/02/rendering-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 2:21 pm on November 19, 2015 Permalink | Reply
    Tags:   

    Categories: Plugins, WordPress ( 19 )

    Zen Dash – Version 1.5 released 

    banner-1544x500

    I’ve just released an update to my Zen Dash plugin. Besides adding funky zen-bamboo artwork to the WordPress.org 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 WordPress.org 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
    Tags:   

    Categories: Linux, Mac OS X ( 76 )

    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:

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

    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
    
    your-username-here
    

    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:

    last
    
    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        10.0.1.43        Tue Feb 10 16:33 - 16:44  (00:10)    
    root     pts/0        10.0.1.52        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        10.0.1.52        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
    Tags:   

    Categories: Mac OS X ( 26 )

    How to burn an ISO image with OS X El Capitan 

    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…
    Verifying
    .........................................................................
    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 

    wizard

    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!

     
    • John McCulloch 7:59 pm on February 2, 2016 Permalink | Reply

      Mr. Versluis,

      Thank you for creating the child theme wizard. I watched your video and read the documentation associated with it, but I still don’t understand what the Child Theme URL field is referring to. Could you please explain further? Thank you,warm regards,

      John M.

      • Jay Versluis 2:56 am on February 6, 2016 Permalink | Reply

        Hi John, the URL field is a metadata field. If you take a look at your installed themes, you’ll find that the ones made by WordPress link to automattic.com – that’s the URL you put in there, one that links to your theme (say a Github page, or where or where others can download your theme). Needless to say it’s optional.

    • dutchguru 6:03 pm on March 21, 2016 Permalink | Reply

      Hello mr Jay Versluis,

      The plugin made a subdir, copied the style.css and a start for the function.php. So far so good.
      [A] I have lot of CSS made for shadow buttons and so on. But were not executed. Made the extensions by hand in the ‘normal’ style.css and it’s working. ( but I have still a few websites to go.

      [B] I made an enhancement to the footer.php, can I arrange this by coping the footer.php to the Child-directory ?

      • Jay Versluis 10:33 pm on March 21, 2016 Permalink | Reply

        Hi there! As for A, I have no idea. Anything in the child theme’s style.css should be pulled in. If it doesn’t work, I don’t know why. And B, yes indeed – you’re absolutely right: copy the footer.php (or any other amended file) into the child theme’s directory, and WordPress will load that instead of the original. As a rule of thumb, if a file is present in the child theme, it will be loaded instead of the original.

        • dutchguru 6:25 am on March 22, 2016 Permalink | Reply

          Hello, thanks for your answer.
          Regarding [B]
          if the theme author made also an enhancement in the footer.php, I’missing by copying the full file.
          What if I take this footer.php, just only my lines ….. or will it be completely overwritten ?

          • Jay Versluis 7:15 am on March 22, 2016 Permalink

            You’ll have to copy the entire file over, WordPress will replace it completely. Partial amendments only work with style.css, all other files will be overwritten completely by the child theme.

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

    Categories: WordPress ( 132 )

    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:

    Link-Target

    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 ( 76 )

    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 http://www.spamhaus.org/lookup/

    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: http://www.abuseat.org/lookup.cgi

    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: https://help.yahoo.com/kb/postmaster/SLN5070.html

    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 …)

     
    • N1njawtf 2:50 pm on March 20, 2016 Permalink | Reply

      Cool! thanks alot! I guess this solved my blacklisting problem.

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

    Categories: Linux ( 76 )

    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 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 – 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 set-hostname example.com --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 set-hostname 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 set-hostame "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: example.com
       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!

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel