I decided to upgrade my web server containers to PHP 7 but ran into a problem with WordPress, all articles had no text. The problem seemed to be within the plugin CodeColorer since disabling it resolved the problem

PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /var/www/wp-content/plugins/codecolorer/codecolorer-core.php on line 50

In wp-content/plugins/codecolorer/codecolorer-core.php locate this code block:

  /** Search content for code tags and replace it */
  function BeforeHighlightCodeBlock($content) {
    $content = preg_replace('#(\s*)\[cc([^\s\]_]*(?:_[^\s\]]*)?)([^\]]*)\](.*?)\[/cc\2\](\s*)#sie', '$this->PerformHighlightCodeBlock(\'\\4\', \'\\3\', $content, \'\\2\', \'\\1\', \'\\5\');', $content);
    $content = preg_replace('#(\s*)\<code(.*?)\>(.*?)\</code\>(\s*)#sie', '$this->PerformHighlightCodeBlock(\'\\3\', \'\\2\', $content, \'\', \'\\1\', \'\\4\');', $content);

    return $content;
  }

and replace it with this

  /** Search content for code tags and replace it */
  function BeforeHighlightCodeBlock($content) {
    $content = preg_replace_callback('#(\s*)\[cc([^\s\]_]*(?:_[^\s\]]*)?)([^\]]*)\](.*?)\[/cc\2\](\s*)#si', function($matches){
      return $this->PerformHighlightCodeBlock($matches[4], $matches[3], $matches[2], $matches[1], $matches[5]);
    }, $content);
    $content = preg_replace_callback('#(\s*)\<code(.*?)\>(.*?)\</code\>(\s*)#si', function($matches){
      return $this->PerformHighlightCodeBlock($matches[3], $matches[2], '', $matches[1], $matches[4]);
    }, $content);

    return $content;
  }

It would of course make sense to find a replacement for CodeColorer since it does not seem to be maintained but that would probably also mean having to edit all old articles.

My collection – Enjoy.

(This is the same folder I use for randomized backgrounds on my computers)

Nowhere.dk (the entire domain) was offline today from 09:47 to 10:46 UTC follwing a major outage at Cloudflare.com.

Points to Cloudflare.com for releasing a full incident report.

First post in a long time – Don’t worry, I haven’t been abducted by aliens from Omicron Persei 8

So today, Felicia Day launched her new personal show called the The Flog. Since I enjoyed this first episode immensely I decided it was time to extend my use of Youtube and subscribe to the channel (user?) Geek & Sundry.

To the *sshats at Google: Why, oh why, do you punish me for using Google Apps?

What’s the problem, you ask? Well, the problem wasn’t like it used to be (where I simply couldn’t log on to Youtube, unlike other services it didn’t give me the opportunity to switch to my non-apps Google account. So I had to log out from Apps account. Log in to my Google account, do whatever on Youtube and the log back into my Apps account – After logging of the Google Account, otherwise Google services would choose that as default).

One does not simply log in to Youtube

No, I was presented with a message telling, Youtube access hadn’t been enabled by my administrator. Easy peasy. I would just go to the domain control panel in Google Apps and enable. Right?

Wrong.

After remembering where the services are (that’s “Organization & Users” -> “Services” for future reference) I couldn’t find any Youtube. Turns out, I’m in the wrong country.

This is the fix:

  • On the Dashboard, select “Try Google Apps for Business Free”
  • On the next page, select “Country/Region: United States” and click “Begin Free Trial”
  • Now, a checkout window appear. Simply close it
  • Go to “Organization & Users” -> “Services” in your Apps control panel
  • Enable Youtube services
  • Wait five minutes
  • Log on to Youtube using your Google Apps account

In the end, it all worked out. And who can stay mad after watching @feliciaday in “The Flog”; @wilw and @grantimihara battle for (Small) World domination in “Table Top” – And last but least, a new video from @TheGuild called “I’m The One That’s Cool”. Oh, and this tweet.

Nowhere.dk has been moved to nginx (with php5-fpm) and most things seem to be working.

There is one problem though.

It seem that some of the older articles are indexed as /articles/-title-/index.php (which is sort of wrong) and accessing that type of URI results in a blank page.

The problem seem to be that I’ve configured nginx to serve file in this order:

location / {
                        try_files $uri $uri/ @rewrites;
}

In theory it should then be a matter of defining the right rewrite

location @rewrites {
       rewrite ^/articles/(.*)/index.php$ /articles/$1 permanent;
       rewrite ^ /index.php last;
}

but – There’s also a location definition for all php “files” (locations ending in .php, not files mind you) and I believe that the .php locations are handed over to php5-fpm withouth nginx actually testing to see if it’s there.

Perhaps I can solve this – but it is a minor problem.

The performance of the site should have increased considerably – but since it meant disabling WordPress HTTPS you will probably see a warning about all elements of the page not being secured; I am working on that.

It might seem as if Nowhere.dk has been out of commission for a while. That is not the case – but a firewall configuration error (on my part) accidently blocked port 80; an error I did not see since I always use SSL.

Sorry,
Allan

xkcd.com/838/

A Christmas Cacophony – Epilogue

Too manee shinees fur my brain to handul!

Have yourselves a merry little Christmas – Have you ever thought about what Santa REALLY does while you’re asleep?

While my site might not be as important or visited as Google or Facebook, I decided to switch it to SSL.

Some pages will show an “error” in the browser because not all content is encrypted (external images); I hope I’ll get that fixed some day.

But I haven’t really had anything to write about. I assure you, if anything pops up, I will make a real blog post :)

My Twitter account is updated somewhat regularly and I post less important stuff (mostly links to stuff) on Tumblr.