Publishing from Obsidian to WordPress

I partially published this post from Obsidian using the WordPress plugin. It was actually easier to setup than I expected with the main hurdle being Basic Authentication. There are still a lot of missing things from the integration that require a fair amount of manual work.

Beware

If you’re site is not using TLS i.e it doesn’t start with https as follows https://[example.com] then using basic authentication is about as secure as Pampers Splashers, you might get away with using it for a while but eventually something really nasty is going to happen and you’ll wish you’d secured your application using TLS.

Problems

The steps where as follows.


1. Install the miniorange WordPress REST plugin and enable Basic Auth.
2. Install the Obsidian wordpress plugin and test the connection. 
3. Enable the wordpress icon on the left menu in Obsidian.
4. Write this post.

The only problem I had was the following error

{“status”:”error”,”error”:”MISSING_AUTHORIZATION_HEADER”,”code”:”401″,”error_description”:”Authorization header not received. Either authorization header was not sent or it was removed by your server due to security reasons.”}%

This was fixed by add the following snippet to my apache.conf

RewriteCond %{HTTP:Authorization} ^(.)
RewriteRule ^(.) – [E=HTTP_AUTHORIZATION:%1]
SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1

Conclusion

I think the WordPress obsidian plugin has a lot of potential but it needs a some polish. It could be good at pushing a body of text up quickly and convert it manually to a finished post but it’s still a fair amount of effort.

WordPress Authorization header not received

If you are getting this error when trying to get miniorange basic authentication to work.

Authorization header not received. Either authorization header was not sent or it was removed by your server due to security reasons.

Try using the following in your apache2.conf file. Note RewriteEngine On needs to be enabled before these settings.

RewriteCond %{HTTP:Authorization} ^(.) 
RewriteRule ^(.) - [E=HTTP_AUTHORIZATION:%1]
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

New Relic Guided installation

I just installed New Relic to play around with it a bit and I noticed that the default installer will try and install a bunch of crap that will, at least in my case fail. HAProxy and MySQL are two that fail miserably because in one case the HAProxy is not setup the way New Relic expects and MySQL us in a Docker container that New Relic is also not expected. In order to get around this you need to install specific parts of new relic. See docs here https://docs.newrelic.com/docs/infrastructure/host-integrations/installation/new-relic-guided-install-overview/

.inputrc stopped working

I’m trying to bite the bullet and move from bash to zsh in order to avoid further pain in the future as Apple are phasing out Bash on the mac.

A major feature that I use a lot on bash is search completion in .inputrc. Zsh broke this for me and using command line is like pulling teeth without it ie in bash you woul dadd the following to .inputrc

“\e[A”: history-search-backward
“\e[B”: history-search-forward
“\e[C”: forward-char
“\e[D”: backward-char

In zsh this not longer works as expected. To get normal behavior back I had to add the following to .zsh

bindkey “^R” history-incremental-search-backward
bindkey “\e[A” history-beginning-search-backward
bindkey “\e[B” history-beginning-search-forward

Vespa Search Engine

I just heard that Oath have released the Vespa Search Engine open source. When I was in Yahoo! it was used for everything. I predict that a company will exist in a few months selling it as a service.

I think Vespa was one of the best written pieces of infrastructure at Yahoo! that I worked on. It was well documented for an internal app and it was blazingly fast. The guys working on it were also super smart. It will be interesting to see where it goes but I think it will be a contender in the search space

Making Oil paint – Demo at Los Altos Art Club

I did a demo at Los Altos Art Club making oil paint. It was good fun and everyone there got to use the mull to see just how hard it can be to push it around on the glass slab. I was originally going to mull some watercolor as well but the cleanup of both would have taken the demo well past the hour so I decided to just do oil. I picked Burnt Umber since it makes lovely paint with linseed oil and nothing else.

Find powers of 3

I saw this question somewhere and thought I’d jot down an answer. I’m sure there’s a bit twiddling method to do this but I think this is about as fast as you’re going to get…

  int power_of_3(uint32_t n) {
    switch(n) {
      case 1: return 1;break;
      case 3: return 1;break;
      case 9: return 1;break;
      case 27: return 1;break;
      case 81: return 1;break;
      case 243: return 1;break;
      case 729: return 1;break;
      case 2187: return 1;break;
      case 6561: return 1;break;
      case 19683: return 1;break;
      case 59049: return 1;break;
      case 177147: return 1;break;
      case 531441: return 1;break;
      case 1594323: return 1;break;
      case 4782969: return 1;break;
      case 14348907: return 1;break;
      case 43046721: return 1;break;
      case 129140163: return 1;break;
      case 387420489: return 1;break;
      case 1162261467: return 1;break;
      case 3486784401: return 1;break;
    };  
    return 0;
  }

Self Portrait WIP

This is a self portrait that’s about half way complete. I did two of these side by side one of which I did while using the reference upside down to see what it would look like.