Running RSYNC on a non-standard port

When it comes to using and managing Linux/Unix based systems RSYNC has consistently proven itself a lifesaver for me.  It is by far the easiest, safest, and most reliable way to copy, sync, and backup files.  I’ve even started using it on Windows machines with Cygwin when I need a good way to transfer large amounts of data between drives.  Now when using RSYNC to backup computers across networks I often come across situations where SSH is running on a non-standard port, something other than Port 22, and I need to figure out a way to let RSYNC know what port to run on.

 

Now when you’re just logging in with SSH it is as easy as using:

ssh -p 2222 matthew@192.168.1.10

instead of:

ssh matthew@192.168.1.10

and with SCP all you need to use is:

scp -P 2222 matthew@192.168.1.10:/remoteFiles /home/matthew/localFolder/

instead of:

scp matthew@192.168.1.10:/remoteFiles /home/matthew/localFolder/

When you are using RSYNC though things are a bit different. You need to use the -e parameter like this:

rsync -avz -e "ssh -p 2222" matthew@192.168.1.10:/remoteFiles /home/matthew/localFolder/

Just like that you can run RSYNC on whatever port you need to get the job done. If you’ve never heard of RSYNC or aren’t using it and do any type of work involving file transfers/backups I highly recommend you check it out!

Use Custom Footer Across Multiple Genesis Themes in WordPress MultiSite

I’ve recently helped launch a number of projects that use WordPress MultiSite heavily, including MennoSites.ca and OurTownSite.ca. This post outlines how to quickly and easily setup a simple WordPress plugin to let you add the same custom footer to every Genesis Theme in your WordPress MultiSite install.

I’ve used a number of Theme suppliers working with WordPress over the years. Lately I’ve begun using Themes based on the Genesis Framework almost exclusively. When I started working with Genesis I took a look around to see what was the best way to change the Theme footer and include my own content.
I found this code snippet on the StudioPress site that does exactly what I wanted.

I found this code snippet on the StudioPress site that does exactly what I wanted.

/** Customize the credits */
add_filter('genesis_footer_creds_text', 'custom_footer_creds_text');
function custom_footer_creds_text($creds) {
    $creds = 'Copyright &copy; &middot; <a href="http://mydomain.com">My Custom Link</a> &middot; Built on the Genesis Framework';
    return $creds;
}

If you copy and paste this code into your Child Themes function file, you can quickly and easily modify the Themes footer.

I wanted to make a few changes to customize the footer for MennoSites.ca. I wanted to display a copyright notice for the current website, a link to the main MennoSites.ca site and a link to the WordPress Administration area for the current site. I used the PHP date function to display the current year for the copyright notice. Than I used the WordPress site_url() function and the WordPress variable $blog_title together create a link to with the name of the current site and its address for the copyright notice. After that I simply hard-coded a link to MennoSites. Finally I used the WordPress site_url() function one last time to create a link to the current sites WordPress Administration Section.
You can see the code snippet I’m using below.

/** Customize the credits */
add_filter('genesis_footer_creds_text', 'custom_footer_creds_text');
function custom_footer_creds_text($creds) {
    $blog_title = get_bloginfo();
    $creds = 'Copyright © '.date(Y).' &middot; <a href="'.site_url().'">'.$blog_title.'</a> &middot; Part of the <a href="http://mennosites.ca" title="MennoSites.ca Network">MennoSites.ca Network</a> &middot; <a href="'.site_url().'/wp-admin/" title="Website Admin">Website Admin</a>';
    return $creds;
}

This snippet is in use on MennoSites.ca and you can actually see it being used at the bottom of this page. Using date(Y),.site_url,$blog_title means that our copyright information is always up to date, and that this snippet will work on any WordPress Site using a Genesis Theme without any other modifications. The snippet will always display the correct links for whatever site it is added too.

On MennoSites.ca we have dozens of Genesis Themes available, instead of adding this snippet to the functions.php file of every theme I wanted to have one location where I could add this snippet and modify it in the future. Using the extensible power of WordPress I created a simple plugin to do exactly that.

To do the same thing, just create a file called easy-genesis-footer.php and open it with your favourite editor. Now add the following code to your file.

<?php
/* Plugin Name: MennoSites.ca Easy Genesis Footer Plugin
URI: http://mennosites.ca
Description: Manage The Footer For Your Genesis Themes All In One Place.
Version: 1.0
Author: Matthew Siemens
Author URI: http://matthewsiemens.com
License: GPL2 */
?>

Now just add the code snippet from above so that your file looks like this.

<?php
Plugin Name: MennoSites.ca Easy Genesis Footer
Plugin URI: http://mennosites.ca
Description: Manage The Footer For Your Genesis Themes All In One Place.
Version: 1.0
Author: Matthew Siemens
Author URI: http://matthewsiemens.com
License: GPL2
*/

/** Customize the credits */
add_filter('genesis_footer_creds_text', 'custom_footer_creds_text');
function custom_footer_creds_text($creds) {
    $blog_title = get_bloginfo();
    $creds = 'Copyright © '.date(Y).' &middot; <a href="'.site_url().'">'.$blog_title.'</a> &middot; Part of the <a href="http://mennosites.ca" title="MennoSites.ca Network">MennoSites.ca Network</a> &middot; <a href="'.site_url().'/wp-admin/" title="Website Admin">Website Admin</a>';
    return $creds;
}
?>

Just remove the link to MennoSites.ca and replace it with a link to your own website. On your web host create a folder called mu-plugins inside wp-content if one doesn’t already exist and upload the file you created to it. This will force the plugin to be enabled across your WordPress MultiSite network, and will update and display your new footer automatically. Please only use this plugin if you are only using Genesis Themes on your MultiSite setup, or you might run into some issues.

I hope this information was helpful, I know it’s saved me from modifying dozens of functions.php files every time I want to make a change to the footer.

Upcoming Projects [OurTownSite.ca]

Hi everyone,

I’m very excited about the next few months. A friend of mine Nathan Funk, and myself have been hard at work on what we hope will be a big hit with local municipal governments. OurTownSite.ca is a CMS based on wordpress with tons of premium themes, and plugins, that has been specially design to provide the best possible web hosting/management package for municipal governments. We did in-depth research before we began working on the project and noticed that there was a very noticeable difference in quality of municipal websites in the Saskatchewan area. There are some very nice websites, with plenty of current content and lots of nice features. Unfortunately there are also plenty of sites that are years out of date with their content, and layout. I had previously worked with the Town of Waldheim and the RM of Laird #404, on their websites and believed that the work I’d done for them could be greatly improved with a unified system that allowed us to build and implement plugins and features for not just one website but for an entire network all at the same time. This wills speed up development of new features as well as simplify maintenance and backup of these sites, with the added bonus of making it cheaper on a per site basis for the client. A few months later OurTownSite.ca is ready to go and we’ll begin marketing the product starting in January 2012. We’re very positive about the project and can’t wait to begin developing and adding even more great features and services to an already great product.