NewsGator, FeedDemon and NetNewsWire RSS Feed Readers

There are a ton a excellent desktop and web based RSS feed readers available to choose from. My favorites by far are FeedDemon for Windows and NetNewsWire for Mac.
The last few years I’ve been using both with NewsGator Online to read and sync my news feeds daily. I’ve found this to [...]

Using the ternary operator in PHP

The ternary operator is an excellent and often underutilized way to quickly evaluate a variable in place of an if/else statement. The syntax is clean and can greatly simplify code.

( expr1 ) ? ( expr2 ) : ( expr3 )

Take the following code for example where we determine how to greet a user.

<?php
[...]

Using Rsync over SSH

Prerequisites

First make sure that you are able to login to the remote host using ssh key authentication.

Basic Syntax

To sync files from a local directory to a remote directory use the following syntax:

rsync {options} -e ssh {source} {dest}

Example

Here is an example that exclude all .psd and .fla files:

rsync –exclude *.psd \
[...]

Using tar and gzip to Compress Files and Directories

Create and Compress and Archive
Archive a group of files:

tar -czvf archive.tar.gz file1 file2 file3

Archive an entire directory:

tar -czvf archive.tar.gz directory/

Extract a Compressed Archive

tar -xzvf archive.tar.gz

List the Contents of a Compressed Archive

tar -tzvf archive.tar.gz

Common tar Switches

-c create a new archive
-x extract files from an archive
-t list the contents of an archive
-z filter the archive through gzip
-v [...]

SSH Login Using Public Key Authentication

Step 1: Generate Keypair on Localmachine

ssh-keygen -t dsa

When prompted for a passphrase you can leave it empty to enable logging in without a password (please note that there are potential security issues with doing this).

After confirming your passphrase at the second prompt you’ll find two new files (the keypair) in your ~/.ssh directory. The [...]