Integrate the outlook calendar into your orgmode agenda

I am using Outlook 365 at my company. All meetings are organized over outlook, but I could not see them in my orgmode agenda, which lead to problems in my daily planning, because I often forgot to plan for those meetings in my daily planning, which is done in orgmode.

I have known ews-orgmode for a while and used it in the past with a different Exchange Server. But it was always a bit of a problem, because it was written in python with some modules, that are not easy to set up on windows (in particular lxml). Getting it to work often took several hours.

So today I tried to solve this issue. I started by creating a fork for ews-orgmode here to be able to do some modifications. To make the setup of python painless, I created a Dockerfile for the script. This makes it easy to run it on any platform without having to setup or configure python. I also added a sample entry in the config.cfg.sample for Office365.

The process is now pretty simple (I tested this on my mac):

  • Install docker and git
  • clone the repository
git clone https://github.com/abellmann/ews-orgmode.git
  • Copy the config.cfg.sample to config.cfg and do the configuration for my user based on the sample for Office365
  • create and run the docker image as described in the Readme of the project..
docker build --tag ews-orgmode .
docker run ews-orgmode
  • Create a little script, that copies the result to my agenda directory ( on ubuntu/macos)
#!/bin/bash
/usr/local/bin/docker run ews-orgmode > /Users/andreas.bellmann/TODO/wiki/outlook.org
  • Create a cronjob, that runs this script hourly
crontab -l
0 * * * * /Users/andreas.bellmann/bin/ews-orgmode.sh

Getting started with Nikola on spacemacs

Today I started my blogging journey with the Nikola static blog engine. Here is my experience so far.

I found this blog engine by following Mike Zamansky's Youtube channel on Emacs, where he published an emacs tutorial on blogging with Nikola (using emacs orgmode as markup language).

Since I have been using Spacemacs now for a while and have always been looking for an easy way to use orgmode to write a blog, this just seemed like the perfect way to get started.

Installing Nikola and deploying it on github was a breeze. I just had to follow the very simple installation guide for Nikola(for MacOs in my case). I also added the orgmode plugin.

To generate a blog post I am using yasnippet based on the sample provided by Mike and created a snippet, that looks something like this (in ~/.emacs.d/snippets/org-mode/post)

# -*- mode: snippet -*-
# name: a new blog post
# key: post
# --
#+BEGIN_COMMENT
.. title: ${1: `(capitalize (replace-regexp-in-string "-\\|_" " " (file-name-base)))`}
.. slug: `(file-name-base)`
.. date: `(format-time-string "%Y-%m-%d %H:%M:%S UTC+01:00" (current-time))`
.. tags: $2
.. category:
.. link:
.. description:
.. type: text
#+END_COMMENT

Here is a guide on using yasnippet in spacemacs. And here is the documentation on writing yasnippets.

I also added prodigy to spacemacs. This can be done by adding the "python" and "prodigy" layers to spacemacs.

The configuration of the prodigy service for nikola can then be done in the user-config section of .spacemacs as follows

(prodigy-define-service
  :name "nikola"
  :command "nikola"
  :args '("auto")
  :cwd "~/projects/abellmann.github.io"
  :tags '(blog nikola)
  :stop-signal 'sigint
  :kill-process-buffer-on-stop t
  )

To run the nikola service in spacemacs, the correct python virtual environment must be active. This can be done by calling M-x pyenv-activate and then selecting the venv directory prepared for nikola or by activation python-mode, followed by SPC m V a

The nikola service can be run with SPC a S and then s on the "nikola" service to start the server. You can then open http:localhost:8000 in your browser and the browser page gets refreshed with the new content every time you save your file, which makes checking the result pretty easy.

To stop the nikola server, just hit S on the nikola service.