Blog

WordPress REST-API nonce-sense.

Working with the WordPress REST-API is HELL. There. I said it. It is powerful, it is secure, it is everything a developer needs, but for the love of [fill in your favorite deity here], WordPress, be consistent!

Using the REST-API requires authentication. Well, that’s not a problem. Just create a route to log-in and one to log-out. WordPress has functions to do that.

wp_signon()
and
wp_logout()

The first hurdle is getting the WordPress REST API to function. Oh, wait, you need a nonce ?! Well, thank you WordPress for this ‘security’-measure. For everything else in WordPress the authentication cookies you get when logging in to /wp-admin are enough, but for REST-API you need a nonce … the F why !?

Sorry, but this is just NONCE-SENSE! Pun intented. If only it were funny. Continue reading “WordPress REST-API nonce-sense.”

Google Tag Manager restart after AJaX page-reload

Quick Tip

So you have this very fast AJaX page loader (InstantClick) on your website, but you want to use Google Tag Manager and track your pageview with Analytics etc; here’s how you reset Tag Manager and re-load it after your AJaX page is loaded; Continue reading “Google Tag Manager restart after AJaX page-reload”

Spring cleaning :) SpaceChem solution archive migrated into WordPress blog

After careful (not) thought and with relative ease (again: not) I have migrated the SpaceChem solutions into this blog. As visitor, you should not notice other than a change of design (or rather: lack of design).

Does this change the solutions? NO :) They are still the same three-or-more-year-old solutions.

Nor does this migration give any guarantee on the functionality of the solutions after all this time.

It’s just something I had to do, getting rid of old, bad, ugly, baseline PHP code.

So you might think, “then why the hell are you bothering us with this?”. Well, good question. Got no answer. Consider this blog-post un-written :P

Enjoy your weekend all! (or your week, if you read this on a working-day, or your holidays, if the internet carrier pigeons have brought this message to you around a holiday, or maybe even your birthday! Is it your birthday today? It is? well happy birthday!)

Alright, enough babbling for today.

Laters.

BREAKING NEWS – WordPress 4.8.3 with WPML (sitepress multilingual cms) 3.8.0 and up cause Page Not Found

[UPDATE] WPML has released a new version with a permanent fix, download version 3.8.4 from wpml.org.

BREAKING NEWS … Literally!

If you experience inexplicable 404s on your WordPress site after you updated to version 4.8.3, and you are using WPML (sitepress multilingual cms) version 3.8.0 or higher, you will need a fix. (Duh!)

The cause is WPML not properly using WPDB->prepare(); [UPDATE] is too late with adding/removing the filters on the query. The priority is now fixed from 10 to -1.

Continue reading “BREAKING NEWS – WordPress 4.8.3 with WPML (sitepress multilingual cms) 3.8.0 and up cause Page Not Found”

macOS High Sierra, the magnificent update that killed the development environment.

[UPDATED sep 26]
[UPDATED again on oct 27th, see tags UPDATE2]

macOS High Sierra is awesome, but unfortunately, it killed my “old style” development environment. It was not just High Sierra; brew upgrade also had a big part in the failing of the development setup, if not ALL of it. I brew upgraded my set-up on Sierra (not High yet) and it got F’ed up as well. My guess; 95% Brew’s fault, 5% High Sierra (and only because High Sierra sort of forced me to brew upgrade)

If you are still using the “old” way for development websites (a.k.a., using macOSs own apache2 and brew php), you might want to wait with upgrading to High Sierra; I don’t have a working solution yet.

[UPDATE2] I think I might have a solution :)

Continue reading “macOS High Sierra, the magnificent update that killed the development environment.”

SSH + TOTP – Two factor Authentication on SSH with OATH Time-based One-Time Passwords

Following the footsteps of this TechOrganic blog article but not wanting to require all the authentication factors, just the TOTP in addition to Password authentication, and also running into macOS’ System Integrity Protection, I found a way to get OTP working on OSX 10.6 through 10.11 without destroying automated access with Private+Public KeyPair. Continue reading “SSH + TOTP – Two factor Authentication on SSH with OATH Time-based One-Time Passwords”

Synology NAS software on non-Synology hardware

I am the proud owner of a Synology DS1512+. She’s getting old but she’s still one of my more sensible purchases. The hardware quality and ease-of-use of the Synology Disk Manager (DSM) still pleases me every day.

I need my NAS to be operational. I use it for all my important stuff but I also have the “urge” to develop my own tools for it. I need a platform to develop software on, without the risk of losing any of my data.

Recently I found XPEnology. Is it a Synology DSM clone? No. It IS the original Synology DSM, without alterations. You just need something to boot it with; a bootloader. Is it legal???? I’m not sure. And when in doubt, go for safe; consider it illegal.

In retrospect, setting-up a XPEnology NAS is surprisingly easy. But for most tutorials you need a Windows computer (windows-only software is used). But on a Mac, you don’t need (most of this) 3rd party software. You have a Mac! A Mac comes with tools, but what tool to use and how?

Continue reading “Synology NAS software on non-Synology hardware”

Out with the old, in with the new — Switching from built-in software to one awesome piece of engineering: Local (by Flywheel)

A multitude of recent developments have aided me to make a choice. Some of them are

  • Apple going for thinner, lighter instead of stronger performance, and
  • Microsoft integrating Bash into Windows 10 with WSL (Windows Subsystem for Linux)

While the new Macbook Pro is quite a feet of engineering, it is hardly Pro”. Surely intel graphics are enough for typing letters and calculating spreadsheets, it’s not Pro. A 16GB memory limit (which with the compression tech used is like 24GB for any other OS) is great for battery life, but it’s not “Pro”. The keyboard is ultra thin and has good tactile feedback, but the keys need a firm press, and travel almost nothing. Great for thinning the device, but again, not “Pro”. For the same amount of money you can buy a portable powerhouse like the Asus ROG G752vy (seen in my post about this). This one has other issues, but at least it has got awesome graphics (nVidia 980), max 64 GB RAM and a “normal” laptop keyboard.

(Yeah, I know, I KNOW, I don’t need ‘awesome graphics’ for web development, but I like to game also, and to be honest; my favorite IDE – phpStorm – DOES prefer a sturdy GPU. Don’t know why, but it runs so much better on a discrete GPU than it does on intel Graphics)

Reasons to stay with macOS are rapidly diminishing, and reasons to start using Windows again are gaining support. Since the Windows 10 Anniversary Update, Windows offers Bash and all goodness that comes with Ubuntu linux, right at your fingertips. Well, not ALL goodness, but most of it.

Continue reading “Out with the old, in with the new — Switching from built-in software to one awesome piece of engineering: Local (by Flywheel)”

Adding more purpose to your iMac 27″, use it as monitor for any HDMI device, like your xbox, PS4, media player, set top box, etc. etc. etc.

Just a quick note for those wondering;

YES YOU CAN! Use a 27″ iMac in Target Display Mode with a non-Apple device on the other end of the cable!

The 27″ iMac (last sold in 2010) can be used as DisplayPort monitor. This is important!; the 24″ iMacs that came after the 27″ also have a Target Display Mode, but they require a ThunderBolt connection, as opposed to a Mini-DisplayPort connection.

(Source: https://support.apple.com/en-us/HT204592) Continue reading “Adding more purpose to your iMac 27″, use it as monitor for any HDMI device, like your xbox, PS4, media player, set top box, etc. etc. etc.”

Hey Siri, what do I need to do to get my development environment working again after upgrading to macOS Sierra?

Hello, macOS Sierra!

macOS… that name… so… long… ago…

It has been, what?, 11 years? 12? … System 9, that was the last OS to be called macOS. The name change does not change anything regarding the update cycle, although on one of my macs, the upgrade went horrifically bad! I ended up rebooting in Recovery mode and installing macOS from there.

For getting the development enviroment back up, not much to be done!

Apache could not find the default server certificates in

/private/etc/apache2/server.crt
so after correcting those paths in
/etc/apache2/extra/httpd-ssl.conf
and restarting Apache, all’s well!

Shell commandsudo nano /etc/apache2/extra/httpd-ssl.conf
Shell commandsudo apachectl restart

As always; feel free to comment or ask questions :)