Category : productivity

How to fake wget on Mac OS X

I was brought up using wget to download files from the command line, and cannot seem to train myself to switch to curl, with is the default on OS X. Rather than find and install the former, I simply added the following alias to my .bash_profile:

alias wget="curl -O"

This is a simple solution that meets my needs and saves me some occasional keystrokes and frustration. It only works for simple downloads, but if I need to do something fancy I’m going to end up reading a man page anyway, and I’m just as happy to read the curl manpage in that case.

Run a WebDAV server on your Mac to sync VoodooPad (for Free)

I’ve recently been using VoodooPad as a note taking and organization tool. I’m enjoying using it and find that the combination of Wiki-like organization, editing and linking of content combined with the responsiveness of a desktop application works very well for me.

As a user of both desktop and laptop computers, I quickly ran into the need to synchronize my two VoodooPad instances. Since VP stores all your notes in a single file (actually an OS X package) my first thought was to drop it in my DropBox folder and be done with it. This could work fine but you’ve got to be extremely careful to not change your document in multiple places—the DropBox mechanism has no idea how to synchronize changes within the documents.

Fortunately VP has built in support for synchronizing with a WebDAV server. VP’s developer directs folks to MobileMe as a readily available WebDAV server, but I don’t have an account there and don’t have much interest in subscribing. That left me with the option of setting up my own WebDAV server. The documentation points users to a great article by Manas Tungare which describes how to set up WebDAV on Mac OS X for use with another program, OmniFocus.

This article gave me everything I needed to quickly get a WebDAV server set up on my system. What follows here is my remix of Manas’ article, with a few tweaks that better accommodate my preferences and VPs capabilities, especially in the security arena.

Setting up WebDAV on Mac OS X for use with VoodooPad

Step 1: Enable Web Sharing in OS X

WebDAV is a protocol for storing documents to a Web server, so we’ll need to get one of those set up. Fortunately Mac OS X has the Apache Web Server built-in. Just go to System Preferences > Sharing and check the box labeled Web Sharing.

Web Sharing Control Panel

Step 2: Enable WebDAV support in Apache

Edit the file /etc/apache2/httpd.conf, (remember to use sudo to edit it) and locate this line:

LoadModule dav_module libexec/apache2/mod_dav.so

Make sure it is not commented out (there should be no “#” at the beginning of the line.)

Next, locate this line (towards the bottom of the file):

Include /private/etc/apache2/extra/httpd-dav.conf

Again, make sure it is not commented out. It is disabled by default, so you need to remove the “#” from this line.

Finally, because we will use digest authentication here, go back up to the LoadModule section of the file and make sure that auth_digest_module is being loaded. You are looking for the following line, and want to make sure it is not commented out.

LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so

The stock Snow Leopard config file has it enabled, so chances are you won’t need to make any changes.

Step 3: Configure WebDAV

Next, edit the file /etc/apache2/extra/httpd-dav.conf. Add a section in it to create your new WebDAV share. Here’s what the new section should look like. As a security precaution, you should also go ahead and delete the /usr/uploads share that is set by default.

Alias /webdav "/Library/WebServer/WebDAV"
Dav On
 
<Directory "/Library/WebServer/WebDAV">
   Order Allow,Deny
   Allow from all
 
   AuthType Digest
   AuthName WebDAV-Realm
   AuthUserFile "/usr/var/webdav.passwd"
</Directory>

With the first line you’re telling Apache what URL to expose your WebDAV directory on. For example, if you are accessing the server via localhost, the above configuration would make your WebDAV URL equal to:

http://localhost/webdav/

With the Directory block you are actually configuring WebDAV access to the particular file location.

Line 9 is where this code block starts to differ from the configuration used by Manas. Unlike OmniFocus, VoodooPad works just fine with the more secure Digest authentication scheme, thus ensuring that your password isn’t sent over the wire in clear text.

Here we also, on line 13, tell Apache to only allow access by authenticated users. (The Manas configuration allowed read access by unauthenticated guest users.)

Step 4: Create the necessary directories.

sudo mkdir -p /Library/WebServer/WebDAV
sudo mkdir -p /usr/var

Step 5: Create user accounts and passwords

Now we use the htdigest tool to create your password file.

sudo htdigest -c /usr/var/webdav.passwd WebDAV-Realm "[username]"
New password:
Re-type new password:
Adding password for user [username]

Note that the “-c” specifies to create a new file. If you want to add additional users, get rid of the “-c” after the first time you issue htdigest.

Step 6: Setup permissions correctly.

sudo chown -R www:www /Library/WebServer/WebDAV
sudo chown -R www:www /usr/var
sudo chgrp www /usr/var/webdav.passwd

Step 7: Restart Apache gracefully.

sudo apachectl graceful

Step 8: Test WebDav

One convenient way to test your configuration is to attempt to mount your new WebDAV resource via Finder. To do this, open Finder and select Go > Connect to Server (⌘ K). Type your WebDAV URL, or http://localhost/webdav/ if you are on the server locally. Note that the trailing slash (“/”) is important, and you will not be able to connect without it.

You will be prompted by Finder to type in your username and password, and you need to be careful to enter these exactly as specified for the htdigest command.

Upon success, you will have mounted your WebDAV folder within Finder, and you should be able to copy a file to the folder.


Setting up VoodooPad using your new WebDAV server

For my needs, I’m planning to do all of my syncing on my local network. If you want to expose your WebDAV folder on the Internet, however, you will likely need additional configuration, such as setting up a dynamic DNS service, like DynDNS, and setting up your router/firewall to pass http traffic to your server.

Once any networking issues are resolved, configuring VoodooPad to use your new WebDAV server is pretty straightforward. On your primary machine, open the VP document that you want to sync, and then pull up the synchronization dialog from File > Synchronization Setup, enter your WebDAV URL, username and password. Your document is now being synchronized with the WebDAV server.

VoodooPad Configuration

Since sync in VP is set up on a document by document basis, on your second machine you will need to create and save a new document. (I gave it the same name on both machines.) Then, when you set up sync for the second document, use the “Pair with document” option on the sync dialog to identify the corresponding document on your WebDAV server.

I was a bit worried that it might cause problems to sync the new document with the sample text to the real document in WebDAV but it all worked out just fine.

one thing I like about my Dell XPS M1330: dual external monitors!

In my last post I talked about how to maximize screen area on widescreen systems by optimizing the placement of your Windows taskbar and your Firefox configuration. I was driven to that point in part by spending just a few days working from my home office, where I’ve got a single 20” widescreen monitor.

I don’t worry about vertical screen real estate too much when I’m working from the office because I’ve got quite a bit of it to work with. No, I don’t have a mongo 30” widescreen Cinema Display. I don’t even have a 24-incher. In fact, I think my current setup, which consists of dual 20” panels, works better than either of these.

CIMG0747

The monitors are Dell 2007FPs. Each is running at 1600×1200, yielding a total of 3.84 million pixels, compared to 2.3 million for a 24” widescreen and 4.1 million for a 30” panel. Not bad considering the cost is roughly 75% more than the 24” and significantly less than half the cost of the 30”.

CIMG0756Part of what makes this work so nicely is my Dell XPS M1330’s ability to drive two independent external monitors. I’m sure it’s not the only laptop that can do so nowadays, but it’s the first I’ve owned. The Dell has both a VGA port and an HDMI port and, unlike some other machines that only let you use one at a time, you can use both on the M.

That’s not to say that the machine is perfect – for example, a docking station would be nice to help manage all those connections. Backlit keyboard would be sweet, too. Don’t get me started.

But it is nice to have the dual external monitor support. Thanks, Dell!

more efficient screen usage for widescreen systems

Generally speaking, I’m a big fan of wide aspect ratio screens. For my work system, a laptop, a big issue is airplane use, and while a widescreen system does not make working on a plane comfortable, it’s a way better experience than trying to work on a 4:3 system. For my home system, a desktop, the widescreen is great for entertainment purposes, e.g. movies and TV.

imageI do find, however, that the use of screen real estate on a widescreen monitor is very inefficient for many – if not most – tasks. At home, I probably spend 90% or more of my computer time doing things like Web browsing, working with documents and hacking on pet projects, for which the traditional aspect ratio makes much more sense. The balance is a bit different at work, mostly because I spend a heck of a lot of time in PowerPoint and Excel.

With all the time I’ve spent working/playing from home over the past few days, I finally got fed up with the lack of vertical screen space on my widescreen systems and started looking for ways to ease the pain. Here’s what I came up with:

1. Dock the Vista Taskbar along the right or left of the screen:

The taskbar in Windows systems dates back to Windows 95 and a time when 4:3 aspect ratio screens prevailed. In a widescreen environment, the 35 vertical pixels used by the task bar is a big deal.

To get this space back, I moved my taskbar to the right hand side of the screen by simply dragging it over. This makes a big difference, but takes some getting used to. I keep dragging  my mouse down to the bottom of the screen looking for the bar.

Speaking of, setting the taskbar to auto-hide itself down at the bottom of the screen is another option you can consider, but I prefer to have my dock showing all the time, and don’t like the way that windows need to move/resize themselves when the dock pops up. I don’t really miss the space along the side of the screen anyway.

2. Move your Firefox tabs to the side of the screen:

imageI spend lots of my computer time in Firefox, and tend to have massive numbers of tabs open at any given time, so in my hunt for vertical pixels it made sense to look at Firefox after moving the taskbar. The first thing I did was move my tabs over to the right hand side of the screen.

There are several add-ins that will get you set up with vertical tabs in Firefox, including Tree Style Tab, Tab Mix Plus and Widefox. I’ve been using Tree Style Tab and so far so good. It also has the nice feature of organizing your tabs into a tree such that tabs that are opened from other tabs appear are nested under their parent. Neat feature for a tab-whore like myself.

I’ve used TMP in the past and while it is very feature rich, I’ve always found it to destabilize Firefox a bit and to be a bit resource intensive.

3. Hide the Firefox menu, status bar and any unnecessary toolbars:

More Firefox extensions to the rescue. Hide Menubar takes care of the menu: hiding it and then automatically popping it up when you press the Alt key. autoHideStatusBar does what its name says for the status bar at the bottom of the FF window: it hides it and automatically pops it up when you bring the mouse down to the bottom of the screen or when you hover over a link. Finally, I’m also trying out Hide Caption, which removes the “title bar” from all Firefox Windows.

Together the three of these maximize the space available for viewing web pages with very little loss of functionality or productivity. All three are working beautifully in Firefox 3.1 Beta 2, so far at least, in spite of the fact that a couple are listed as “Experimental” on the Mozilla.org site.

I also turned off the RoboForm toolbar which I use all the time and the Web Developer Toolbar, which I use less frequently. Fortunately, RoboForm has lots of keyboard shortcuts for me to remember, so I’m sure I’ll be able to get by without it. And I will just turn on WDT when I need it.

In the end, I estimate that I’ve saved about 150-200 vertical pixels while Web browsing, which is nearly 20% of the height of my 1680×1050 desktop monitor!!! This means I’m able to see more on each page, scroll less, and generally get more done faster.

efficient use of widescreen screen real estate by moving and hiding horizontal bars