How to display wired clients on an Apple AirPort Time Capsule
Version 6.x of Apple’s AirPort Utility displays all your wireless client’s IP addresses, but it doesn’t show you wired devices. The old version 5.6 did, but without a hack it no longer runs on Mountain Lion. There is however a simple way to display all clients using the command line tool arp. Open up a Terminal Window (Applications – Utilities – Terminal) and type the following: arp -a ? (10.0.1.1) at 88:1f:a1:2c:87:37 on en1 ifscope [ethernet] ? (10.0.1.2) at bc:52:b7:1a:f2:9 on en1 ifscope [ethernet] ?...
read moreWordPress Multisite: a Brief Guided Tour
Installing WordPress Multisite isn’t the hard part – it’s getting your head around how to use it, especially if you’ve mostly been using single installs. In this quick tour I want to give you some pointers on how to use your new installation, and how it differs from single WordPress installations. New Role: The Super Admin On a single installation, the Administrator was the “master of your domain”. In a Multisite installation however he no longer has the powers that he once had. Instead, the Super Admin is...
read moreHow to setup WordPress as a Multisite Network (formerly known as WPMU)
Installing WordPress Multisite can give your site the benefit of being part of a network. I use this feature to spawn multiple installations that live on the same domain. It makes my life so much easier to update several WordPress instances at once. It’s also a great way of being logged into several individual sites at the same time. WordPress Multisite isn’t for everybody, and not every hosting company will allow you to install or use it. It will however work with most hosting packages that support a standard WordPress...
read moreHow to create a Cron Job in WordPress: Teach your plugin to do something automatically
Creating a recurring automatic function in WordPress used to be one of the most difficult things for me to understand. Several articles out there explain how to do it, yet I always forgot the concepts when the next cron job job came along. Right now it’s in my head, and that’s the time when I like to write things down for “next time”. I hope these notes will help you in your own development. Setting up a Cron Job in WordPress involves the following items: a scheduled event, i.e. something that WordPress will execute...
read moreHow to send an email in PHP
Many complex things are extremely simple in PHP – sending mail is one of them. Here’s how: // components for our email $recepients = 'you@somewhere.com'; $subject = 'Hello from PHP'; $message = 'This is a test mail.'; // let's send it $success = mail($recepients, $subject, $message); if ($success) { echo 'Mail added to outbox'; } else { echo 'That did not work so well'; } The mail function will add the message to the out queue, so the test will not show if the message has...
read moreHow to test if a Shell Command can be executed in PHP
Before we execute a shell command from PHP it’s a good idea to test if the server will respond to it. We can do this by making use of the empty() function. The following example consists of a helper function you can call before executing the command in question. Then we call it with the shell command we intend to use, before executing the command for real. We’re using ‘uname -a’ here as an example that will generate output and takes a parameter: // helper function function checkShellCommand($command) { $returnValue =...
read moreHow to test if your server is running Windows from PHP
If we’re executing shell commands via PHP we need to know if the server is running Windows or Linux. Thanks to a magic constant in PHP we can find out like this: echo PHP_OS; This will give us a single value like Linux Darwin Windows WINNT With that info at hand, we can write a function that delivers a boolean result (courtesy of the PHP manual): if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { echo 'This server is running Windows!'; } else { echo 'This server is NOT running Windows!'; } This takes the...
read moreHow to install Mac OS X onto an external hard drive
How to install Mac OS X onto an external drive http://support.apple.com/kb/ht5911 http://support.apple.com/kb/ph11273 http://www.hongkiat.com/blog/clean-install-mountain-lion/
read moreHow to tweak style code blocks in WP Code Highlight
I love the WP Code Highlight plugin by BoLiQuan. It brings well deserved colour to code blocks wrapped in PRE tags. I use them a lot, but until I discovered this plugin they all looked grey and bland. Since last year I was using them on my iOS Dev Diary and thought since both sites are now running the same layout I’d integrate code highlighting here to (new for 2014). Out of the box however it didn’t look as nice as I wanted it to: I’m using it with P2 (or P2 Categories actually) so it needed some pazzazz. Here’s what...
read moreHow to share your posts on Google Plus publicly via JetPack
I’ve decided to start using Google Plus more in 2014. Thanks to JetPack 2.7 it’s a breeze to publish my posts on Google Plus without having to share them manually. What I’ve noticed though was that by default all my posts were appearing as “privately shared” only. As I’d like the widest audience possible I would really like them to be shared publicly. I can do this when I manually post to Google Plus (for example via a Share button, or via the Google Plus app). Help is of course at hand – it’s...
read more