Skip to main content

Senior Web Engineer. Open web / music. Remote DJ. Tall Dutch guy.

twitter.com/svandragt

github.com/svandragt

mixcloud.com/cloudseer

Sometimes I do research for a browser tab and want to go back to the last used tab when I close the research topic. Other times I want to review all open tabs and cycle through them without switching back to the last used one every time. I'm ctrl-tabbing to make all tabs active but a separate keyboard shortcut would be great

WorkLog 2.2

1 min read

WorkLog.py is a very simple script that allows you to keep track of what you are working on by writing a timestamped message to a CSV file.
It turns out it helps me stay on track during a long day of work.

Version 2.2 has some new quality of life improvements:

v2.2:

* ctrl-d or enter to quit.
* works on python2 default systems.
* f-strings,
* code more elegant.
* day based csv files.

https://gist.github.com/svandragt/080843c4ba632deaab6f3aea57ca9684

Fixing Virtualbox host network adapter cannot be created error

1 min read

If when trying to start a vm, for example using vagrant, you get the error message that the host network adapter cannot be created (the error is cryptic but will contain hostonly, create, vboxmanage -- unfortunately I forgot to screenshot it), make sure to first start the virtualbox GUI application. It does some extra checks, and sometimes highlights the permission problem:

In my case (OpenSuse 15.1 Leap), my user was not added to the vboxusers group. Via Yast > Users and Security .... and editing my user account it was a simple checkbox away. Remember to relog.

What's up with keyboard shortcuts on macos? For many system shortcuts, there's an application shortcut that does something different.

I hope iPads will become more repairable for everyone in the future. This LCD issue ours developed can be repaired only by a full swap, for 75% of the cost of a brand new faster iPad! If the price is based on value of the product instead of its cost, then so should the repair price be.

I’ve wondered for years why and don’t supply an update service for applications to hook into to keep themselves updated. I guess it’s a lot more complex than building an updater.

So seems to have removed the Preferences > Sidebar > Additional Options > Show the Quick Switcher setting. Problem is I must have accidentally enabled this before it was removed and now I can't get rid of it?

ACF field groups with the same option position can be ordered by setting a key value. Key values starting with underscores are shown first. Field groups without keys are displayed inconsistently depending on the user role.

WordPress Canonical URLs for Category/PostName Permalinks

1 min read

When the permalink format is set to %category%/%postname%/ then a post is available under category/postname links for all categories, as well as under all parent/child/postname links.

If you use Yoast SEO and have set a primary category, that  becomes the canonical URL that's used for SEO. If you don't then the postname for whatever category has a lower ID (was created first) becomes the canonical URL.

What is the meaning of a site's Last Updated property?

2 min read

When running a WordPress multisite, in the site directory each site has a Last Updated property. I previously incorrectly assumed this reflected  when the site's metadata changed, for example the site's attributes. However, archiving and deactivating a site does not change the Last Updated value, so what does it do in WordPress 5.2.1?

As usual the best place to look is the WordPress codebase. It turns out that, on a multisite, this value is updated whenever a post is updated or deleted. It reflects the last content update, not the site's metadata.

By inspecting the html and looking up the property name, we find that the function that updates this is called wpmu_update_blogs_date and there is an action hook wpmu_blog_updated that receives the site_id variable. This function can be called whenever we want to update the value. It isn't used anywhere else.

If we're looking to update this date whenever the site's status changes, then via the same process it appears that he actions to hook into site attribute updates are in wp_maybe_transition_site_statuses_on_update so one could write a quick mu-plugin that updates the Last Updated property whenever these fire.