Ten years

Ten years ago my life was so much more different in almost every way. And the time now is a good mark to sit back and see what have happend.

In September 2004:
  • I met the girl who i married later on.
  • I moved from Copenhagen to Horsens.
  • I worked as a mailman.
  • I had never worked for myself.
  • I was racing my bicycle a lot.
  • I wasn't on Facebook.

Ten years after I can sit back and see that i'm so blessed for my life right now, and mainly because a lot have happend.

Since September 2004:
  • I have completed my first marathon (3:29:15).
  • I have been working as a fulltime webdeveloper.
  • I was married for 7 years with a diagnosed bipolar.
  • I moved back to Copenhagen.
  • I have been a parttime "dad".
  • I got divorced.
  • I have been in therapy on/off for almost 1.5 year (and blessed about the journey).
  • I quit my job a week ago.

Right now I'm back starting at ground-zero, from October I don't have a job, and don't have a place to live, the thought is great, i really love the idea about not knowing what to future brings and where I end up.

I really don't know what I could write in September 2024, but i'm pretty sure my life from now on is going to be so much more different from what I have had until now, and i know for certain that i could start the list with something like:

September 2024:
  • I have had my own company.
  • I moved to ...
  • I have ...

Git tip of the day

When working in git repositories, you (read: I) often want to go back to the repository top level directory, and used to do something like

cd ../../../../..

But found out that you with git rev-parse can add the parameter --show-cdup which tells you the path to the top level directory of the repository relative to the current directory.

git rev-parse --show-cdup

With git version 1.7.0+ you can use --show-toplevel which shows the absolute path to the top level directory of the repository.

git rev-parse --show-toplevel

So in my shell (bash or zsh) i have made an alias to easy cd into this directory, so edit and add this line to your .zshrc .bashrc or whatever

alias gitroot='cd $(git rev-parse --show-toplevel)'

And restart your shell, and cd into a git repository, and do a gitroot BOOM back to top level directory.

Configure postfix to deliver all mails locally

On my computer a lot of local web development is going on, and every one of those sites have access to send mails. Sometimes these mails is configured to be sent to an external valid customer email account. The external customer may not be very happy about getting hundreds of testing emails, so in this post i will tell you how to configure postfix to deliver all mail sent to an internal account.

It's quite simple to configure postfix to deliver all mails sent, locally.

First of all start by editing /etc/postfix/main.cf

sudo vim /etc/postfix/main.cf

Go to the very bottom of the file and add the following line

canonical_maps = regexp:/etc/postfix/canonical-redirect

Save and exit the file.

Create the following file /etc/postfix/canonical-redirect

sudo vim /etc/postfix/canonical-redirect

And paste the following line and replace YOUR_USER with your system username.

/^.*$/ YOUR_USER

Save and exit the file. Now you just need to restart postfix, and everything works.

sudo postfix reload

To check the mails delivered locally you can use shell command mail or check these links (1, 2)