Problem with Offlineimap and postsynchook

After using different methods to get email, I decided to go back to using Offlineimap.

I updated the configuration file I was using before and ran it. It "worked". It would sync all the email account but the postsynchook wasn't running.

In the old .offlineimaprc file, the "postsynchook =" was the last line in the file.

i.e.: [Account XXX]

[Repository XXXLocal]

[Repository XXXRemote]

postsynchook = xxxxxx

In order to get it to run, I had to move it up to just below the [Account XXX] section:

[Account XXX]

postsynchook = xxxxxx

[Repository XXXLocal]

[Repository XXXRemote]

Note: There are multiple accounts in the offlineimaprc file but only put one postsynchook command after the Account section of the last account so the indexer only gets executed once per sync.

Switching from virtualenvwrapper to pew

Wanted to try something new so I switched from using virtualenvwrapper to Python Env Wrapper, aka pew for my Python virtual environments.

The cleanup.

(This is an ArchLinux system.)

Remove the python entry from the .zpreztorc file (which setup the WORKON_HOME env variable).

Then, remove virtualenvwrapper from the system:

yaourt -Rns python-virtualenvwrapper

then rebooted to MAKE SURE the environment came up clean.

The install and setup.

Installed pew:

yaourt -S python-pew

Since I am using Nikola to create this website, I:

pew new valencering

This created the new virtualenv, launched a new sub-shell and added the text "valencering" to the left side of the prompt but it didn't set the project directory.

So I cd'd to the working directory and ran:

pip install --upgrade "Nikola[extras]"

and then ran nikola build.

And it worked.

I exited the sub-shell and the prompt changed back to "normal" and nikola was no longer a valid command.

I then ran

pew workon valencering

It set the virtualenv but didn't take me to the code. So again, I cd'd there manually.

With the virtualenv activated and in the "home" directory I ran:

pew setproject

Now, no matter where I am, if I run:

pew workon valencering

it will take me to the code and set the virtualenv just like virtualenvwrapper would do.

Additional Information.

Looking at the Command Reference, I could have done all this in one command:

cd to the working directory

pew new -a $PWD valencering

One other difference is that the default location for the virtual environments is now at ~/.local/share/virtualenvs, whereas before, both oh-my-zsh and prezto set it at ~/.virtualenvs but it could be overridden with environment settings.

Virtualenv fix - dyld: Library not loaded:

When a virtualenv is activated and it displays an error message similar to:

dyld: Library not loaded: @executable_path/../.Python

There is more information at and at stackoverflow.


The symbolic links to the Python executable are broken.


Pretend the virtualenv is located at ~/.virtualenv/myapp.

Go to the virtualenv directory, delete the links, re-link Python:


cd .virtualenv/

find myapp/ -type l -delete

virtualenv myapp

Go to the directory of myapp and activate the virtualenv and it should work.

Clone a python virtualenv

Working offline (no internet), create a new virtualenv based on an existing virtualenv:

mkvirtualenv (and virtualenv) are installed

pip install virtualenv-clone

Then, to create a new virtualenv:

virtualenv-clone /path/old-virtualenv /path/new-virtualenv

Use workon to activate the new virtualenv
Create a directory for the new project and cd into that directory.


Setup Cordova and Android for App development

A quick checklist to setup Cordova (PhoneGap) and Android to create Mobile Apps on a MacBook Pro running Mavericks.

Read more…

Exclude your main IP address from Google Analytics

The Manual Way

Go to a website like What's my IP to get your current IP address.

Log on to the Google Analytics site.

Click on the "Admin" button and then click on "All Filters" in the left sidebar.

Click on "Add a new Filter" and create a new filter.


Input the IP address you got from What's My IP Address and save the filter.

Setup new MacBook Pro running Mavericks

This is a "checklist" for setting up a MacBook Pro running Mavericks.

Start: Completely clean MBP with Mavericks installed.

Goal: Have a nice system that will be used for mostly development but some entertainment using mostly FOSS software.

Read more…

Oh-My-ZSH and Python Virtualenv

OMZ has both a virtualenv and a virtualenvwrapper plugin.

In the past, the .virtualenvs directory was located at $HOME/python/.virtualenvs and the instructions for installing virtualenvwrapper required the addition of some exports to the .bashrc file.

The plugins take care of the exports but the default location for virtual environments is now at $HOME/.virtualenvs.

Oh-My-ZSH, gitconfig and using vi as editor

One more "converting to zsh" issue:

When commiting a change using the "gc" command, git would report this error:

error: There was a problem with the editor 'vi'.

Change the editor = vi to editor = vim line in .gitconfig.

There was probably either an alias or a symbolic link to make "vi" = "vim" but that doesn't exist anymore.

Running TMUX and Oh-My-ZSH together

Recently switched over to running ZSH on a MacBook Pro and also installed Oh-My-ZSH.

Added the tmux plugin to .zshrc and it worked.

Tried to use the same .tmux.conf file from "Bash land" and the keys worked correctly but the shell changed back to Bash.

Had to make one change to the tmux.conf file:


``set-option -g default-command "reattach-to-user-namespace -l bash"


``set-option -g default-command "reattach-to-user-namespace -l $SHELL -l"

This allows the OMZ script to run properly and now displays the correct prompt.