macvim – Vim for the Mac

When using Mac OS X, I used to use the CLI vim by the excellent Homebrew package manager.

Now I’ve just stumbled over macvim, which is kind of a “deluxe vim” for Mac OS X, including adjusted key bindings for the Mac and a GUI menu, supporting Cocoa file dialogs, among others.

It’s highly recommended if you want to have the best of both the CLI and GUI editor worlds.

Download

Using IRC on the go

Running the console IRC client weechat (not to confuse with the wechat messenger) in a screen or tmux session on a Linux (or Mac OS X) server and accessing it trough mosh is a great way to use IRC on the go, i.e. with a unsteady Internet connection.

P.S. Thanks to Devaux and rmeyer for the hints

Zimbra ZCS: OpenDKIM not running

After upgrading Debian, OpenDKIM sometimes stops running or fails to properly restart. If you don’t actively monitor your ZCS server, the only way to detect this is either through a growing mail queue of unsent messages or through a note in the ZCS server admin panel.

Usually, manually restarting either OpenDKIM itself or the whole ZCS server once “fixes” the problem:

# service zimbra restart

or

# /etc/init.d/zimbra restart

In other cases, fixing the permissions may help:

# /opt/zimbra/libexec/zmfixperms -verbose -extended

(source)

Mac OS X: Reduce/increase workspace switching delay

Does dragging windows to the adjacent workspace in Mac OS X feel sluggish? Try lowering the according delay, e.g. to 0.1 seconds. For a persistent change, enter the following in a terminal:

defaults write com.apple.dock workspaces-edge-delay -float 0.1; killall Dock

If you’d like to have a longer delay, try setting a value of 1.0 or even 2.0.

System information on Mac OS X

Mac OS X comes with a pretty useful tool to list all the details about your system:

# system_profiler

E.g. to find out whether your RAM supports ECC:

# system_profiler|grep ECC
          ECC: Disabled

Or wether your SSD supports TRIM:

# system_profiler|grep TRIM
          TRIM Support: Yes

Some helpful Git resources

A friend recently told the following joke:

“The idea that git can be used offline is an illusion – you still need connectivity for googling which arguments to pass to what command.”

That’s an exaggeration, of course, but as always, there’s a grain of truth in it. So here we go:

Delete duplicate e-mail messages

If you need to delete duplicate e-mail messages on an IMAP server, take a look at this useful IMAP de-duplicator script:

IMAP de-duplicator – IMAPdedup

As IMAPdedup is a command line interface tool (a python script), it’s particularly useful for:

  • automated deletion of duplicates (as it can be called from other scripts)
  • extraordinarily big mailboxes or if you have many subfolders (as there’s no intervention by the user required)
  • if you have console/shell access to the IMAP server (as you can then run the script on the server itself, speeding the de-duplication process further up)

I also found that it deals relatively well with failures (e.g. when a folder is read-only and hence messages can’t be deleted): It simply reports them on the screen and carries on.

Here’s a quick’n’dirty bash script to de-dup the inbox and all subfolders of the specified account:

#!/bin/sh
# Delete all duplicate messages in all folders of said account.
# Note that we connect through SSL (-x) to the default port.

SERVER="my.server.com"
USER="mylogin"
PASS="mypass"

for folder in `imapdedup.py -s $SERVER -x -u $USER -w $PASS -l`;
do
 imapdedup.py -s $SERVER -x -u $USER -w $PASS $folder
done

If you only have to de-duplicate messages in a small folder, you could also use the following de-duplication add-on for Mozilla Thunderbird:

Remove Duplicate Messages Add-on for Thunderbird

Note however that the ‘Remove Duplicate Messages’ add-on is intended for interactive use only, not for batch processing. I also noticed that it fails at cleaning big mail folders (e.g. containing 50’000 messages).

 

How to compile Textual (open source IRC client) on Mac OS X

Textual is a heavily modified fork of LimeChat and looks and feels more native and light-weight than most other IRC clients for Mac OS X. Further, it doesn’t seem to have problems with window refreshing as observed with XChat Aqua/Azure (App Store link) and XChat for X11 (installed/compiled using ‘brew install xchat’).

Though Textual is also available in the App Store for 4.99 USD, I wanted to compile it from sources myself.

Here’s how to build Textual from sources (tested on Mac OS X Mountain Lion):

  1. Download and install Xcode 4 from the App Store.
  2. Download/checkout the latest Textual sources from https://github.com/Codeux/Textual
  3. Open the file Main Project (Textual).xcodeproj in Xcode.
  4. In Xcode’s Preferences -> Downloads -> Components, install the Command Line Tools.
  5. In the opened project in Xcode, disable code signing:
    For the target Textual, navigate to the tab Build Settings. In the “Code Signing” section, set “Don’t Code Sign” for “Debug” and “Release”.
  6. On the top left of the Xcode IDE window, select the scheme Textual (Standard Release) -> My Mac 64-bit
  7. Click on the “Run” button to start building the project
  8. The “Textual” app will be built in the subfolder “./Build Results/Release/” of your Textual source directory