Tuesday, August 13, 2013

Why Single Sign On is good

I've written countless login mechanisms. To be honest I'm sick of them. But there's a better reason to go with SSO only in my next app. User friendliness.

SSO is user friendly

SSO mechanisms are quite slick. Instead of sending users through yet another boring signup form, sending out verification emails and forcing eye cancer upon them with an unreadable captcha, they just click a button, authorise an app and off they go.

The key lays in their existing accounts with major services like Google, Facebook or Twitter. Those services are doing a fantastic job in verifying signups. So people went through all that already. Their profiles are verified and trustworthy.

Clicking a button to make a service accessible is therefore a huge improvement for many users. Besides, have you ever filled out a lengthy signup form on a mobile phone? SSO buttons eliminate any need for that at all, resulting in more signups.

SSO makes development easier

SSO is confusing at first. There are many things involved in the process. I've once written the process in PHP as a Typo3 plugin. It was hell back then and I never really understood what happened there.

I'm still not much better off when it comes to the understanding of all the things involved in the process. However, times have changed and it's much easier to do.

I've looked into passport.js, a node.js library. It supports many different SSO mechanisms, partially through additional node modules. Whats even more interesting however is it's integration into the express framework.

That integration is so huge to me that I abandoned my first CouchApp only prototype in favour of node.js with express.

Again, getting started is not exactly easy. Luckily I found this video which walked me through a basic Facebook setup. If you're looking to get started with passport.js, I suggest you check it out.

Friday, August 9, 2013

Fixing Coda 2 Connection issues

I often rely on a satellite internet connection. Those connections make life with Coda difficult. Often files aren't transferred over SFTP. The timeout is epic and it makes life really difficult.

To get around this problem I gave up on Coda's embedded SFTP client. Instead I've mounted the remote server through SSHFS. So far I didn't run into the same problems and files are transferred reliably.

SSHFS can be installed on pretty much any UNIX OS. I personally use it within a Linux VM since the local project files are in there as well. However there's no need for that. You can install SSHFS on your Mac as well.

Binary versions are available from the osxfuse project. To be honest I didn't try them but that may be the way to go if you don't want to install a portage on your Mac.

I on the other hand couldn't live without MacPorts. If you have it installed, just install the

sshfs
port. Once installed you can easily mount your remote website using a command like this:

sshfs username@remote.tld:/var/www/ /Users/arthur/mymountpoint/

To optimise the process I suggest you're using SSH keys instead of passwords. That way it's not only more secure but also much more comfortable. Hint: those keys work with Coda as well.

Thursday, August 8, 2013

Limit Apple Mail to 80 Chars

Using Apple Mail I occasionally receive complaints, mainly from Linux users, that I should limit the length of a line to 80 characters. The only problem, Apple Mail doesn't support this!

It's no problem doing this in pretty much any other email client. So switching from Apple Mail to something like Thunderbird or Opera Mail may be an option. But I actually like Apple Mail so, that's not really an idea I'd like to go with.

Luckily I found this thread on the Apple Support forum that explains how to use Automator to partially get around this problem.

The answer by "Scott Atchley" really works quite well. What he does there is simply to create a new Service in Automator. It takes selected text from the Mail application, sends it through the "fmt" command and replaces the original.

I've created the workflow and put it on my Google Drive for you to download.

Or if you'd like to create it yourself, here's a screenshot of how this simple service looks on my Mac:

Once created and put into the

~/Library/Services/
directory it shows up in your keyboard shortcut menu. Create a shortcut of your liking.

Once the shortcut is set, restart Apple Mail and try it out. Select the text you'd like to transform and hit your shortcut.

Even so this solution works it's but a dirty hack. Apple should really add that feature to Apple Mail. I really hope that they get over this "consumer" idiocy and once again respect their pro users, many of which are veterans using macs since the early 90s or even earlier.

Monday, August 5, 2013

Getting rid of VirtualBox Windows

I often use VirtualBox VMs to run a development environment within. These are usually some very basic command line operated *NIX systems. Since I interact with them through SSH via a host only network connection I don't really need the Window that pops up when starting a VM. It's actually quite annoying.

Luckily there's a simple solution. Instead of starting a VM using the graphical VirtualBox Manager, you can start it using the following command

VBoxManage startvm "VM name" --type headless

In headless mode the useless "dead" windows aren't created any more which really is quite a blessing. To stop a VM either shut it down through SSH or use the following command

VBoxManage stopvm "VM name"

To see a list of your VMs run the following command.

VBoxManage list vms