<?xml version="1.0" encoding="UTF-8"?><feed
	xmlns="http://www.w3.org/2005/Atom"
	xmlns:thr="http://purl.org/syndication/thread/1.0"
	xml:lang="en-US"
	>
	<title type="text">Roy Tanck</title>
	<subtitle type="text">Personal blog</subtitle>

	<updated>2023-10-25T11:40:40Z</updated>

	<link rel="alternate" type="text/html" href="https://roytanck.com" />
	<id>https://roytanck.com/feed/atom/</id>
	<link rel="self" type="application/atom+xml" href="https://roytanck.com/feed/atom/" />

	<generator uri="https://wordpress.org/" version="6.3.2">WordPress</generator>
<icon>https://roytanck.com/wp-content/uploads/2018/05/cropped-rt-1-32x32.png</icon>
	<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[Testing the WordPress ActivityPub plugin]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2023/10/25/testing-the-wordpress-activitypub-plugin/" />

		<id>https://roytanck.com/?p=739</id>
		<updated>2023-10-25T11:40:40Z</updated>
		<published>2023-10-25T10:36:00Z</published>
		<category scheme="https://roytanck.com" term="WordPress" /><category scheme="https://roytanck.com" term="ActivityPub" /><category scheme="https://roytanck.com" term="Mastodon" /><category scheme="https://roytanck.com" term="WordPress plugin" />
		<summary type="html"><![CDATA[Mastodon is quickly becoming my favorite social media platform, so I thought I&#8217;d give the now-sorta-official ActivityPub plugin a go. The ActivityPub protocol is what Mastodon is built on, and the plugin makes it possible for Mastodon users to follow your blog. And comment on blog posts, apparently.]]></summary>

					<content type="html" xml:base="https://roytanck.com/2023/10/25/testing-the-wordpress-activitypub-plugin/"><![CDATA[
<p><a href="https://mastodon.online/@roytanck">Mastodon</a> is quickly becoming my favorite social media platform, so I thought I&#8217;d give the <a href="https://wordpress.com/blog/2023/03/17/making-the-social-web-a-better-place-activitypub-for-wordpress-joins-the-automattic-family/">now-sorta-official</a> <a href="https://wordpress.org/plugins/activitypub/">ActivityPub plugin</a> a go. The <a href="https://en.wikipedia.org/wiki/ActivityPub">ActivityPub</a> protocol is what Mastodon is built on, and the plugin makes it possible for Mastodon users to follow your blog. And comment on blog posts, apparently.</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-plugin-directory wp-block-embed-plugin-directory"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="2j32SXfkya"><a href="https://wordpress.org/plugins/activitypub/">ActivityPub</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" title="&#8220;ActivityPub&#8221; &#8212; Plugin Directory" src="https://wordpress.org/plugins/activitypub/embed/#?secret=EtyAueIJhp#?secret=2j32SXfkya" data-secret="2j32SXfkya" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>


<div class="activitypub-follow-me-block-wrapper wp-block-activitypub-follow-me" aria-label="Follow me on the Fediverse" data-attrs="{&quot;selectedUser&quot;:&quot;1&quot;,&quot;profileData&quot;:{&quot;name&quot;:&quot;Roy Tanck&quot;,&quot;icon&quot;:{&quot;type&quot;:&quot;Image&quot;,&quot;url&quot;:&quot;https:\/\/secure.gravatar.com\/avatar\/5b24aa3124d326de751ea3eb183aad03?s=120&#038;d=mm&#038;r=g&quot;},&quot;resource&quot;:&quot;roy@roytanck.com&quot;}}"></div>]]></content>
		
					<link rel="replies" type="text/html" href="https://roytanck.com/2023/10/25/testing-the-wordpress-activitypub-plugin/#comments" thr:count="4" />
			<link rel="replies" type="application/atom+xml" href="https://roytanck.com/2023/10/25/testing-the-wordpress-activitypub-plugin/feed/atom/" thr:count="4" />
			<thr:total>4</thr:total>
			</entry>
		<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[Fixing the Medion Erazer Engineer E10]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2023/02/17/fixing-the-medion-erazer-engineer-e10/" />

		<id>https://roytanck.com/?p=704</id>
		<updated>2023-02-18T12:24:22Z</updated>
		<published>2023-02-17T20:11:56Z</published>
		<category scheme="https://roytanck.com" term="General" /><category scheme="https://roytanck.com" term="hardware" />
		<summary type="html"><![CDATA[Tip: whenever you buy a pre-built PC, run some benchmarks to see if the performance numbers are comparable to similarly specced systems. Long story short: for my PC they weren&#8217;t. Geekbench reported a far lower score than my Intel Core i5-12400 should be capable of, and Cinebench was even worse. As is often the case,&#160;...]]></summary>

					<content type="html" xml:base="https://roytanck.com/2023/02/17/fixing-the-medion-erazer-engineer-e10/"><![CDATA[
<figure class="wp-block-image size-full"><img decoding="async" fetchpriority="high" width="2048" height="922" src="https://roytanck.com/wp-content/uploads/2023/02/541631fc14e4876f8.10580573.jpg" alt="Photo of the air intake of a jet fighter, with a sign saying &quot;danger, jet intake&quot;." class="wp-image-721" srcset="https://roytanck.com/wp-content/uploads/2023/02/541631fc14e4876f8.10580573.jpg 2048w, https://roytanck.com/wp-content/uploads/2023/02/541631fc14e4876f8.10580573-1440x648.jpg 1440w, https://roytanck.com/wp-content/uploads/2023/02/541631fc14e4876f8.10580573-768x346.jpg 768w, https://roytanck.com/wp-content/uploads/2023/02/541631fc14e4876f8.10580573-1536x692.jpg 1536w, https://roytanck.com/wp-content/uploads/2023/02/541631fc14e4876f8.10580573-1070x482.jpg 1070w" sizes="(max-width: 2048px) 100vw, 2048px" /><figcaption class="wp-element-caption"><a href="https://creativecommons.org/share-your-work/public-domain/cc0/">CCO</a> licensed <a href="https://wordpress.org/photos/photo/541631fc14/">photo</a> by <a href="https://wordpress.org/photos/author/goldsteinmedia/">Seth Goldstein</a> from the <a href="https://wordpress.org/photos/">WordPress Photo Directory</a>.</figcaption></figure>



<p>Tip: whenever you buy a pre-built PC, run some benchmarks to see if the performance numbers are comparable to similarly specced systems.</p>



<p>Long story short: for my PC they weren&#8217;t. <a href="https://www.geekbench.com/">Geekbench</a> reported a far lower score than my Intel Core i5-12400 should be capable of, and <a href="https://www.maxon.net/en/cinebench">Cinebench</a> was even worse. As is often the case, <a href="https://www.reddit.com/r/intel/comments/swnaw9/i512400_getting_only_half_of_expected_cinebench/">the solution was on Reddit</a>.</p>



<p>Turns out that Gigabyte motherboard in my Medion MD35244 came with a very old <a href="https://en.wikipedia.org/wiki/BIOS">BIOS</a> installed. One that severly limited the CPU performance of some Alder Lake CPUs. Gigabyte acknowledged this issue and released an <a href="https://www.gigabyte.com/Motherboard/B660M-DS3H-AX-DDR4-rev-1x/support#support-dl-bios">update</a> over a year ago. But that&#8217;s when I ran into an issue. My motherboard had a Medion BIOS, not a Gigabyte one.</p>



<h2 class="wp-block-heading">OemID Mismatch</h2>



<p>BIOS updates are tricky. If anything goes wrong, your PC can be bricked, and you may need to replace the motherboard. To keep people from flashing the wrong file, some checks are performed. In this case, when I tried to install Gigabyte&#8217;s newer version, I&#8217;d get an &#8220;OemID Mismatch&#8221;. Basically, I could only install a BIOS that came from Medion. But their tech support made it very clear they were not going to provide one.</p>



<p>This <a href="https://www.reddit.com/r/gigabyte/comments/pajmkr/b365_ds3h_wifi_oemid_mismatched/?utm_source=share&amp;utm_medium=android_app&amp;utm_name=androidcss&amp;utm_term=1&amp;utm_content=share_button">Reddit post</a> suggests booting <a href="https://freedos.org/">FreeDOS</a> and using a DOS-based tool to flash the BIOS. I spent hours trying to boot FreeDOS, but could not get it to work.</p>



<h2 class="wp-block-heading">Q-Flash Plus</h2>



<p>Luckily, this particular motherboard (B660M DS3H AX DDR4) has a little button labeled &#8220;Q-Flash Plus&#8221;. It provides a way to flash your BIOS, even without anything installed on the motherboard. This is helpful if your CPU is very new, and requires an update even before you build the system. My quess was that perhaps this would do fewer of those pesky checks, and I was right.</p>



<p>I&#8217;m not going to recommend that you do this, and if you do, please research the steps involved, and follow them to the letter. This is a potential footgun, so don&#8217;t blame me if it does not work.</p>



<p>In my case it worked flawlessly. I put the new BIOS on a USB stick (formatted FAT32), renamed it to &#8220;GIGABYTE.bin&#8221;, powered the computer down and pressed the &#8220;Q-Flash Plus&#8221; button. Ten minutes later, the PC booted into the new BIOS. No need to remove any components, as some guides suggest.</p>



<figure class="wp-block-image size-full small-image"><img decoding="async" width="358" height="337" src="https://roytanck.com/wp-content/uploads/2023/02/bios-update.png" alt="" class="wp-image-705"/><figcaption class="wp-element-caption">The brown bar shows the Cinebench score with the old Medion BIOS, orange is after the update.</figcaption></figure>



<h2 class="wp-block-heading">Medion</h2>



<p>Obviously, this voids your warranty, but I don&#8217;t really mind. Doubling the performance is worth it to me. What bugs me is that Medion did not, in multiple emails I got from them, even once acknowledge the problem, or offer a solution. They must have shipped more than one of these machines, and it&#8217;s likely they all have this issue.</p>



<p>The very least Medion could do is provide an updated BIOS file. But even then, most owners won&#8217;t even know their system is underperforming. Time for a recall?</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[Contributing to the WordPress Photo Directory]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2022/11/17/contributing-to-the-wordpress-photo-directory/" />

		<id>https://roytanck.com/?p=682</id>
		<updated>2022-11-17T13:38:49Z</updated>
		<published>2022-11-17T12:56:37Z</published>
		<category scheme="https://roytanck.com" term="Photography" /><category scheme="https://roytanck.com" term="WordPress" /><category scheme="https://roytanck.com" term="open source" />
		<summary type="html"><![CDATA[Writing Open Source software is bit of a weird proposition. You spend time and effort creating something useful, and when you&#8217;re done, you give it away. Literally anyone can then use your code, for free. Yet this is how some truly wonderful software has been created. Such as WordPress. It works. And now you can&#160;...]]></summary>

					<content type="html" xml:base="https://roytanck.com/2022/11/17/contributing-to-the-wordpress-photo-directory/"><![CDATA[
<figure class="wp-block-image size-full shadowimg"><img decoding="async" width="2560" height="1418" src="https://roytanck.com/wp-content/uploads/2022/11/wordpress-photo-directory-scaled.jpg" alt="Scfreenshot of the WordPress Photo Directory's home page" class="wp-image-684" srcset="https://roytanck.com/wp-content/uploads/2022/11/wordpress-photo-directory-scaled.jpg 2560w, https://roytanck.com/wp-content/uploads/2022/11/wordpress-photo-directory-1440x798.jpg 1440w, https://roytanck.com/wp-content/uploads/2022/11/wordpress-photo-directory-768x426.jpg 768w, https://roytanck.com/wp-content/uploads/2022/11/wordpress-photo-directory-1536x851.jpg 1536w, https://roytanck.com/wp-content/uploads/2022/11/wordpress-photo-directory-2048x1135.jpg 2048w, https://roytanck.com/wp-content/uploads/2022/11/wordpress-photo-directory-1070x593.jpg 1070w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>Writing Open Source software is bit of a weird proposition. You spend time and effort creating something useful, and when you&#8217;re done, you give it away. Literally anyone can then use your code, for free. Yet this is how some truly wonderful software has been created. Such as WordPress. It works. And now you can do it with your photos too.</p>



<h2 class="wp-block-heading">The WordPress Photo Directory</h2>



<p>For its code, WordPress uses the <a href="https://en.wikipedia.org/wiki/GNU_General_Public_License">GPL license</a>. Any code you submit is added under this license, and themes and plugins are required to also use this license. It&#8217;s almost the opposite of copyright, and is sometimes referred to as &#8220;copy-left&#8221;.</p>



<p>The <a href="https://wordpress.org/photos/">Photo Directory</a> uses an equally permissive <a href="https://en.wikipedia.org/wiki/Creative_Commons">Creative Commons</a> license, called &#8220;<a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>&#8220;. This places your work in the public domain, and allows anyone you use your image, for any purpose. Even attribution is not required (although it is encouraged).</p>



<h2 class="wp-block-heading">Contributing</h2>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="1707" height="2560" src="https://roytanck.com/wp-content/uploads/2022/11/joris-2048px-scaled.jpg" alt="" class="wp-image-685" srcset="https://roytanck.com/wp-content/uploads/2022/11/joris-2048px-scaled.jpg 1707w, https://roytanck.com/wp-content/uploads/2022/11/joris-2048px-1440x2160.jpg 1440w, https://roytanck.com/wp-content/uploads/2022/11/joris-2048px-768x1152.jpg 768w, https://roytanck.com/wp-content/uploads/2022/11/joris-2048px-1024x1536.jpg 1024w, https://roytanck.com/wp-content/uploads/2022/11/joris-2048px-1365x2048.jpg 1365w, https://roytanck.com/wp-content/uploads/2022/11/joris-2048px-1070x1605.jpg 1070w" sizes="(max-width: 1707px) 100vw, 1707px" /><figcaption class="wp-element-caption">This image of my cat was the <a href="https://wordpress.org/photos/photo/833636f68c/">5000th image</a> accepted into the Photo Directory</figcaption></figure>



<p>Contributing to the Photo Directory is pretty straightforward.</p>



<ul>
<li>You&#8217;ll need a <a href="https://login.wordpress.org/register">wordpress.org account</a></li>



<li>Once logged in, go to <a href="https://wordpress.org/photos/submit/">https://wordpress.org/photos/submit/</a></li>



<li>Select the photograph you wist to submit</li>



<li>There are a number of checkboxes that you&#8217;ll need to check, please read the <a href="https://wordpress.org/photos/guidelines/">requirements</a> carefully</li>



<li>Send the form (this can take a little while)</li>



<li>Wait for the photo to be approved, you&#8217;ll be notified by e-mail.</li>
</ul>



<h2 class="wp-block-heading">Openverse</h2>



<p>There&#8217;s some confusion about the relationship between the Photo Directory and another new WordPress project, <a href="https://wordpress.org/openverse/">Openverse</a>. In short, Openverse is a search engine that indexes Creative Commons licensed content from a number of sources. One of those sources it the WordPress Photo Directory.</p>



<p>Images you submit to the Photo Directory will therefore show up in Openverse search results.</p>



<h2 class="wp-block-heading">It&#8217;s better to give than to receive</h2>



<p>I&#8217;ve contributed to WordPress in a number of ways, and it feels really good to be able to give something back to such a wonderful project. Giving away <a href="https://wordpress.org/photos/author/roytanck/">some of my photos</a> feels similar. I hope people find them useful, and can&#8217;t wait to see them &#8220;in the wild&#8221;. If you love something, set it free.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[Getting a Gaming PC for Lightroom]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2022/11/12/getting-a-gaming-pc-for-lightroom/" />

		<id>https://roytanck.com/?p=677</id>
		<updated>2022-12-12T07:00:31Z</updated>
		<published>2022-11-12T15:26:14Z</published>
		<category scheme="https://roytanck.com" term="Photography" /><category scheme="https://roytanck.com" term="gaming" /><category scheme="https://roytanck.com" term="hardware" /><category scheme="https://roytanck.com" term="Lightroom" /><category scheme="https://roytanck.com" term="Windows" />
		<summary type="html"><![CDATA[As is probably evident from this blog, I&#8217;m a Linux guy. I&#8217;m not fond of Apple, and prefer not to use proprietary software. But I&#8217;m also a photographer, who likes to use Adobe Lightroom to develop the images I take. I tried Darktable and Rawtherapee, but keep coming back to Lightroom. For the last couple&#160;...]]></summary>

					<content type="html" xml:base="https://roytanck.com/2022/11/12/getting-a-gaming-pc-for-lightroom/"><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="2880" height="1920" src="https://roytanck.com/wp-content/uploads/2022/11/StockSnap_S6L2DPGXUW-2880x1920.jpg" alt="" class="wp-image-678" srcset="https://roytanck.com/wp-content/uploads/2022/11/StockSnap_S6L2DPGXUW-2880x1920.jpg 2880w, https://roytanck.com/wp-content/uploads/2022/11/StockSnap_S6L2DPGXUW-1440x960.jpg 1440w, https://roytanck.com/wp-content/uploads/2022/11/StockSnap_S6L2DPGXUW-768x512.jpg 768w, https://roytanck.com/wp-content/uploads/2022/11/StockSnap_S6L2DPGXUW-1536x1024.jpg 1536w, https://roytanck.com/wp-content/uploads/2022/11/StockSnap_S6L2DPGXUW-2048x1365.jpg 2048w, https://roytanck.com/wp-content/uploads/2022/11/StockSnap_S6L2DPGXUW-1070x713.jpg 1070w" sizes="(max-width: 2880px) 100vw, 2880px" /><figcaption class="wp-element-caption"><a href="https://stocksnap.io/photo/laptop-computer-S6L2DPGXUW">Photo</a> by <a href="https://stocksnap.io/author/5055">Tomasz Bazylinski</a> on <a href="https://stocksnap.io">StockSnap</a></figcaption></figure>



<p>As is probably evident from this blog, I&#8217;m a Linux guy. I&#8217;m not fond of Apple, and prefer not to use proprietary software. But I&#8217;m also a photographer, who likes to use Adobe Lightroom to develop the images I take. I tried <a href="https://www.darktable.org/">Darktable</a> and <a href="https://rawtherapee.com/">Rawtherapee</a>, but keep coming back to Lightroom.</p>



<p>For the last couple of years, this has been my setup:</p>



<ul>
<li>On my Ubuntu laptop, I&#8217;d use <a href="https://github.com/damonlynch/rapid-photo-downloader">Rapid Photo Downloader</a> to import the photos from the SD card into my preferred folder structure.</li>



<li>A simple command line rsync script would duplicate that folder to my NAS.</li>



<li>I&#8217;d then fire up a Windows 10 <a href="https://en.wikipedia.org/wiki/Virtual_machine">Virtual Machine</a> on my laptop to run Lightroom.</li>
</ul>



<p>This setup had a couple of issues:</p>



<ul>
<li>I appears to be currently impossible to upgrade Virtualbox VM&#8217;s to Windows 11.</li>



<li>Adobe&#8217;s software seems to be getting increasingly reliant on GPU accelleration, which is unavailable inside the VM.</li>



<li>It was truly, horribly slow.</li>
</ul>



<h2 class="wp-block-heading">Time to upgrade</h2>



<p>So, I decided I wanted something to run Lightroom without virtualization. I looked into refurbished workstation machines (Lenovo Thinkstation, HP Z-series, etc). There are plenty for sale, but I found that the cheaper ones came with older Intel Xeon&#8217;s that would not support Windows 11. Newer ones that did would be quite expensive.</p>



<p>For some reason, new PC&#8217;s with a discrete graphics card are hard to find&#8230; unless you get a &#8220;gaming&#8221; system. So now I have a Lightroom &#8220;workstation&#8221; with a glass side panel and LED lights inside. Luckily, the light color is fixed (blue), but if you buy something similar, you may end up with all sorts of RGB nonsense. Still, considering what I paid, it&#8217;s excellent value for money. It has a fast CPU and a mid-range video card that works well with Adobe software.</p>



<h2 class="wp-block-heading">My new workflow</h2>



<ul>
<li>I&#8217;m still using Rapid Photo Downloader, because I love that program.</li>



<li>Rsync is still the best, most reliable, way to copy files across a network (Linux laptop to NAS).</li>



<li>Once they&#8217;re there, I fire up my &#8220;gaming rig&#8221;, and connect to the image file folder on my NAS.</li>
</ul>



<p>I do not import the images to the PC&#8217;s SSD, but edit them &#8220;in place&#8221;. This used to be very slow for me in the past, but using <a href="https://roytanck.com/2022/10/30/creating-a-direct-connection-between-your-pc-and-nas/" data-type="post" data-id="667">2.5 gigabit networking</a> and a newer version of the <a href="https://en.wikipedia.org/wiki/Server_Message_Block">Samba protocol</a> fixed that.</p>



<p>With this new setup, Lightroom literally runs at least ten times faster than in my old workflow. Even with the files being accessed over the network.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[Creating a direct connection between your PC and NAS]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2022/10/30/creating-a-direct-connection-between-your-pc-and-nas/" />

		<id>https://roytanck.com/?p=667</id>
		<updated>2022-10-30T13:51:26Z</updated>
		<published>2022-10-30T13:51:26Z</published>
		<category scheme="https://roytanck.com" term="General" />
		<summary type="html"><![CDATA[NAS devices are great for storing large amounts of files, and making them available to other devices on the network. A typical gigabit home network is usually fast enough to conveniently access those files from your PC or Mac. If you need some extra speed from one of your computers, it might be worth checking&#160;...]]></summary>

					<content type="html" xml:base="https://roytanck.com/2022/10/30/creating-a-direct-connection-between-your-pc-and-nas/"><![CDATA[
<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="2048" height="1536" src="https://roytanck.com/wp-content/uploads/2022/10/81661dddb1e3f9558.71929795-2048x1536-1.jpg" alt="Airplane propeller with blue sky" class="wp-image-670" srcset="https://roytanck.com/wp-content/uploads/2022/10/81661dddb1e3f9558.71929795-2048x1536-1.jpg 2048w, https://roytanck.com/wp-content/uploads/2022/10/81661dddb1e3f9558.71929795-2048x1536-1-1440x1080.jpg 1440w, https://roytanck.com/wp-content/uploads/2022/10/81661dddb1e3f9558.71929795-2048x1536-1-768x576.jpg 768w, https://roytanck.com/wp-content/uploads/2022/10/81661dddb1e3f9558.71929795-2048x1536-1-1536x1152.jpg 1536w, https://roytanck.com/wp-content/uploads/2022/10/81661dddb1e3f9558.71929795-2048x1536-1-1070x803.jpg 1070w" sizes="(max-width: 2048px) 100vw, 2048px" /></figure>



<p>NAS devices are great for storing large amounts of files, and making them available to other devices on the network. A typical gigabit home network is usually fast enough to conveniently access those files from your PC or Mac. If you need some extra speed from one of your computers, it might be worth checking if your NAS has an available &#8220;better-than-gigabit&#8221; port.</p>



<h2 class="wp-block-heading">What you&#8217;ll need</h2>



<ul><li>A NAS with two network ports, of which at least one is 2.5 gigabit or better.</li><li>A PC or Mac with a free network port that supports the same connection speed. If your PC does not have one, there are USB3 adapters on the market that are quite affordable.</li><li>A UTP cable capable of better-than-gigabit speeds, typically &#8220;Cat6a&#8221;.</li><li>A working knowledge basic network things, like how to change adapter settings.</li><li>The NAS and PC need to be physically close to each other, since we&#8217;ll be connecting them using a single cable. </li></ul>



<h2 class="wp-block-heading">How this works</h2>



<p>IN most cases, your PC is connected to your home network using either wifi or (wired) gigabit ethernet. Your NAS is likely to be connected using ethernet. To get a faster connection between the two, you could upgrade your entire network to (for instance) 2.5 gigabit, but this would require a considerable investment.</p>



<p>If you just need a single PC with faster acces to the NAS, you can create a separate &#8220;network&#8221;, with only those two devices. I did this recently, and even at 2.5 gigabit (there&#8217;s also 5 and 10), there was a noticable improvement.</p>



<h2 class="wp-block-heading">Where&#8217;s how I did it</h2>



<p>These are the steps that were required to get this working with my hardware. That&#8217;s a relatively inexpensive QNAP NAS with a gigabit and a 2.5 gb port and a Windows PC with a 2.5 gb port and a cheap USB3-to-gigabit dongle (that I intend to replace eventually).</p>



<ol><li>Make sure the faster ports are availabe. I actually had my LAN plugged into the NAS&#8217;s fast port, so I needed to fix that, and do some configuration on the NAS to get the static IP set up again.</li><li>Once you have LAN access on both devices working, directly connect the 2.5 gb ports on the NAS and PC using the Cat6a cable. This won&#8217;t be plug &amp; play, there&#8217;s a few more steps.</li><li>On the NAS set the fast port&#8217;s IP to something like 192.168.5.99. Make sure to use a different range than your LAN. There&#8217;s no DHCP server on our little two-device network, so you&#8217;ll need to set the IP manually. Use 255.255.255.0 as the the subnet mask.</li><li>I found that I needed to remove the gateway address that was previously there, since it won&#8217;t be accessible on this network.</li><li>On the PC or Mac, set the fast adapter&#8217;s IP address to a different IP in the same range, so something like 192.168.5.100. Again, remove any gateway IP and use the same subnet mask.</li><li>When connecting to the NAS and setting up network shares, make sure to connect using the new IP. In Windows, this would be something like <code>\\192.168.5.99\[shared folder]</code>, Macs typically use <code>smb://192.168.5.99/[shared folder]</code>.</li></ol>



<p>Once I did this, editing photo&#8217;s directly from the NAS was a lot more fun than before. I paid three euros for the ethernet cable, which was absolutely worth it. I&#8217;ll definitely look for 10 gigbit ports when buying my next NAS&#8230;</p>



<p class="has-small-font-size">Featured image by <a href="https://wordpress.org/photos/photo/81661dddb1/">Jennifer Bourn</a>, available from the WordPress Photo Directory.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[I love my Vero 4K+]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2022/09/05/i-love-my-vero-4k/" />

		<id>https://roytanck.com/?p=661</id>
		<updated>2022-09-05T11:49:34Z</updated>
		<published>2022-09-05T11:49:33Z</published>
		<category scheme="https://roytanck.com" term="General" /><category scheme="https://roytanck.com" term="hardware" /><category scheme="https://roytanck.com" term="Linux" />
		<summary type="html"><![CDATA[Earlier this year, when I was isolating because of Covid-19, I bought a second hand Vero 4K+. In terms of hardware, it&#8217;s very similar to other media players, but it&#8217;s the software that sets it apart. Most cheap media players nowadays seem to run Android. Usually an older version, without any updates and security patches&#160;...]]></summary>

					<content type="html" xml:base="https://roytanck.com/2022/09/05/i-love-my-vero-4k/"><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="2880" height="1824" src="https://roytanck.com/wp-content/uploads/2022/09/vero-4kplus-2880x1824.jpg" alt="" class="wp-image-662" srcset="https://roytanck.com/wp-content/uploads/2022/09/vero-4kplus-2880x1824.jpg 2880w, https://roytanck.com/wp-content/uploads/2022/09/vero-4kplus-1440x912.jpg 1440w, https://roytanck.com/wp-content/uploads/2022/09/vero-4kplus-768x486.jpg 768w, https://roytanck.com/wp-content/uploads/2022/09/vero-4kplus-1536x973.jpg 1536w, https://roytanck.com/wp-content/uploads/2022/09/vero-4kplus-2048x1297.jpg 2048w, https://roytanck.com/wp-content/uploads/2022/09/vero-4kplus-1070x678.jpg 1070w" sizes="(max-width: 2880px) 100vw, 2880px" /></figure>



<p>Earlier this year, when I was isolating because of Covid-19, I bought a second hand <a href="https://osmc.tv/vero/">Vero 4K+</a>. In terms of hardware, it&#8217;s very similar to other media players, but it&#8217;s the software that sets it apart.</p>



<p>Most cheap media players nowadays seem to run Android. Usually an older version, without any updates and security patches from three years ago. In contrast, the Vero runs <a href="https://osmc.tv/">OSMC</a>, a lightweight Linux distribution with <a href="https://kodi.tv/">Kodi</a> on top. And it gets five years of guaranteed software updates.</p>



<p>The 4K+ has been on the market since 2018, but since it&#8217;s still being sold I assume updates will keep coming for some time.</p>



<h2 class="wp-block-heading">Pros</h2>



<p>Kodi plays pretty much all media files, and it runs beautifully on the Vero. It&#8217;s very responsive. I use it to play files from my NAS, and image and sound quality are great. The remote is also much more convenient than the clunky media keyboard I was using with my old media PC.</p>



<h2 class="wp-block-heading">Cons</h2>



<p>Last month, my Vero started to regularly lock up, and eventually it wouldn&#8217;t boot. On the OSMC forums, I found that this is usually a power supply problem. This does indeed seem to be the case, because the replacement power supply I ordered fixed the issue. It&#8217;s wonderful being able to troubleshoot issues with help of the community.</p>



<p>The Vero 4K+ uses very little energy, but I find it weird that there&#8217;s no real standby mode and no way to turn the device off. There&#8217;s a &#8220;faux&#8221; suspend mode, but that pretty much only turns off the video output.</p>



<h2 class="wp-block-heading">Open source media player</h2>



<p>This little box is the only truly open source media player I know of. It&#8217;s a little more expensive than competing products, but the frequent updates and trusted OS make well worth the premium. Highly recommended.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[To my surprise, Ubuntu 22.04 comes with a wallpaper image I created]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2022/05/25/to-my-surprise-ubuntu-22-04-comes-with-a-wallpaper-image-i-created/" />

		<id>https://roytanck.com/?p=653</id>
		<updated>2022-05-25T09:47:59Z</updated>
		<published>2022-05-25T09:19:36Z</published>
		<category scheme="https://roytanck.com" term="General" /><category scheme="https://roytanck.com" term="Art" /><category scheme="https://roytanck.com" term="Linux" /><category scheme="https://roytanck.com" term="Ubuntu" />
		<summary type="html"><![CDATA[Last february, I submitted the image above in the &#8220;Jammy Jellyfish 22.04 Wallpaper Competition&#8220;. After the competition closed, I received a message saying that it made it to the finalists, but was not selected to be included in the Ubuntu 22.04 release. Surprise! To my surprise however, I came across a video on Reddit last&#160;...]]></summary>

					<content type="html" xml:base="https://roytanck.com/2022/05/25/to-my-surprise-ubuntu-22-04-comes-with-a-wallpaper-image-i-created/"><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="2880" height="1620" src="https://roytanck.com/wp-content/uploads/2022/05/ubuntu-2204-wallpaper-2880x1620.jpg" alt="" class="wp-image-654" srcset="https://roytanck.com/wp-content/uploads/2022/05/ubuntu-2204-wallpaper-2880x1620.jpg 2880w, https://roytanck.com/wp-content/uploads/2022/05/ubuntu-2204-wallpaper-1440x810.jpg 1440w, https://roytanck.com/wp-content/uploads/2022/05/ubuntu-2204-wallpaper-768x432.jpg 768w, https://roytanck.com/wp-content/uploads/2022/05/ubuntu-2204-wallpaper-1536x864.jpg 1536w, https://roytanck.com/wp-content/uploads/2022/05/ubuntu-2204-wallpaper-2048x1152.jpg 2048w, https://roytanck.com/wp-content/uploads/2022/05/ubuntu-2204-wallpaper-1070x602.jpg 1070w" sizes="(max-width: 2880px) 100vw, 2880px" /><figcaption>The wallpaper image that I created for Ubuntu 22.04</figcaption></figure>



<p>Last february, I submitted the image above in the &#8220;<a href="https://discourse.ubuntu.com/t/jammy-jellyfish-22-04-wallpaper-competition/26388">Jammy Jellyfish 22.04 Wallpaper Competition</a>&#8220;. After the competition closed, I received a message saying that it made it to the <a href="https://discourse.ubuntu.com/t/jammy-jellyfish-22-04-wallpaper-competition-winners/27260">finalists</a>, but was not selected to be included in the Ubuntu 22.04 release.</p>



<h2 class="wp-block-heading">Surprise!</h2>



<p>To my surprise however, I came across a video on Reddit last week, posted by a user who was having issues with a fresh install of 22.04. He was using my wallpaper, which as far as I knew was not part of the release. So I did a little digging, and found <a href="https://ubuntu.com/blog/ubuntu-22-04-lts-whats-new-linux-desktop">this blog post on ubuntu.com</a>.</p>



<blockquote class="wp-block-quote"><p>&#8230;our community wallpaper competition had so many great submissions that we decided to <a href="https://discourse.ubuntu.com/t/jammy-jellyfish-22-04-wallpaper-competition-winners/27260">include all the finalists</a> for the LTS release.</p><cite>From: https://ubuntu.com/blog/ubuntu-22-04-lts-whats-new-linux-desktop</cite></blockquote>



<p>So basically, my image was on millions of computers, and I had no idea.</p>



<h2 class="wp-block-heading">Generated with my 4K Wallpaper Generator</h2>



<p>To create this particular image, I tweaked my <a href="https://roytanck.com/2021/11/29/generate-your-own-personal-4k-desktop-wallpaper/" data-type="post" data-id="499">Wallpaper Generator</a> so that it used Ubuntu&#8217;s brand identity colors. I love that this image was created on Ubuntu (running on a Raspberry Pi), using nothing but some open source JavaScript.</p>



<p>This was the second time a <a href="https://roytanck.com/2018/05/04/a-wallpaper-image-i-submitted-made-it-into-ubuntu-18-04-lts/" data-type="post" data-id="19">wallpaper I created was selected</a>, although the earlier image was quite different.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[A Tale of Two Celerons]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2022/04/17/a-tale-of-two-celerons/" />

		<id>https://roytanck.com/?p=624</id>
		<updated>2022-04-17T20:09:29Z</updated>
		<published>2022-04-17T20:09:29Z</published>
		<category scheme="https://roytanck.com" term="General" /><category scheme="https://roytanck.com" term="hardware" />
		<summary type="html"><![CDATA[A while ago, I bought a Vero 4K+ media player. OSMC is excellent, and I love the Vero, but that&#8217;s a different story. This is about the machine it replaced. An older, passively cooled Shuttle barebone I previously used to watch movies in my living room. That little Shuttle machine has a Celeron 1037U CPU.&#160;...]]></summary>

					<content type="html" xml:base="https://roytanck.com/2022/04/17/a-tale-of-two-celerons/"><![CDATA[
<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="1920" height="1280" src="https://roytanck.com/wp-content/uploads/2022/04/ryan-tpAyLp9Ro50-unsplash1.jpg" alt="Close-up of a CPU" class="wp-image-627" srcset="https://roytanck.com/wp-content/uploads/2022/04/ryan-tpAyLp9Ro50-unsplash1.jpg 1920w, https://roytanck.com/wp-content/uploads/2022/04/ryan-tpAyLp9Ro50-unsplash1-1440x960.jpg 1440w, https://roytanck.com/wp-content/uploads/2022/04/ryan-tpAyLp9Ro50-unsplash1-768x512.jpg 768w, https://roytanck.com/wp-content/uploads/2022/04/ryan-tpAyLp9Ro50-unsplash1-1536x1024.jpg 1536w, https://roytanck.com/wp-content/uploads/2022/04/ryan-tpAyLp9Ro50-unsplash1-1070x713.jpg 1070w" sizes="(max-width: 1920px) 100vw, 1920px" /><figcaption>Photo by <a href="https://unsplash.com/@rioryan?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Ryan</a> on <a href="https://unsplash.com/s/photos/cpu?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure>



<p>A while ago, I bought a Vero 4K+ media player. <a href="https://osmc.tv/">OSMC</a> is excellent, and I love the Vero, but that&#8217;s a different story. This is about the machine it replaced. An older, passively cooled Shuttle barebone I previously used to watch movies in my living room.</p>



<p>That little Shuttle machine has a Celeron 1037U CPU. And like with any older hardware I get my hands on, I wanted to see how useful it still was. I wasn&#8217;t hopeful because, on paper, the 1037U seems worse than the already dead slow Celeron in my <a href="https://roytanck.com/2021/03/13/upgrading-a-chromebook-to-run-linux/" data-type="post" data-id="426">Toshiba Chromebook-turned-Linux-laptop</a>.</p>



<figure class="wp-block-table"><table><thead><tr><th>CPU</th><th>Intel Celeron 1037U</th><th>Intel Celeron N2840</th></tr></thead><tbody><tr><td>Introduced</td><td>Q1 2013</td><td>Q3 2014</td></tr><tr><td>Core / threads</td><td>2 / 2</td><td>2 / 2</td></tr><tr><td>Clock speed</td><td>1.80 GHz</td><td>2.16 GHz (2.58 GHz boost)</td></tr><tr><td>Lithography</td><td>22 nm</td><td>22 nm</td></tr><tr><td>Instruction Set</td><td>64 bit</td><td>64 bit</td></tr><tr><td>TDP</td><td>17 W</td><td>7.5 W</td></tr><tr><td>Graphics Frequency</td><td>350 MHz / 1 GHz</td><td>311 MHz / 792 MHz</td></tr></tbody></table></figure>



<p>Besides the higher TDP (the amount of power the chip is designed to use during normal operation) these specs seemed similar to me. The fact that the 1037U is older and the lower clock speed made me think this thing would be terrible. Spoiler: it&#8217;s not.</p>



<h2 class="wp-block-heading">Performance</h2>



<p>I installed <a href="https://linuxmint.com/">Linux Mint</a> on it to see what that would be like. Since I&#8217;m not really a fan of XFCE, I opted for the heavier Cinnamon version. To my surprise, it is very responsive. Hell, it feels downright fast.</p>



<p>In benchmarks I could find online, the 1037U beats the N2840 by at least 50%, and in some cases by up to 400%. That&#8217;s a huge difference for chips with such similar specs.</p>



<h2 class="wp-block-heading">Core vs Atom</h2>



<p>So I did some digging, and found that the 1037U is based on Intel&#8217;s &#8220;Ivy Bridge&#8221; architecture. Basically, it&#8217;s a scaled down version of the 3rd generation of Intel Core CPUs. The N2840 however is &#8220;Silvermont&#8221;, a power-efficient architecture meant to compete with the ARM CPU&#8217;s of that time. Silvermont is essentially a range of Atom CPUs. Like the ones in first-gen netbooks. The N2840 is a very, very slow chip.</p>



<h2 class="wp-block-heading">1080p only</h2>



<p>While the little Shuttle machine runs well with Mint installed, there&#8217;s a catch. The internal graphics of the 1037U is limited to 1080p &#8220;full HD&#8221; resolution. There&#8217;s no way I can get it to output my monitor&#8217;s native 1440p resolution. It does run 1080p at 75Hz though. Technically, 1440p shouldn&#8217;t be an issue. This is likely an artificial limitation. Guess Intel needs to make sure we occasionally buy a new CPU.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[Solving Sudokus with Rust]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2022/01/23/solving-sudokus-with-rust/" />

		<id>https://roytanck.com/?p=595</id>
		<updated>2022-02-11T13:09:01Z</updated>
		<published>2022-01-23T11:56:13Z</published>
		<category scheme="https://roytanck.com" term="General" /><category scheme="https://roytanck.com" term="programming" /><category scheme="https://roytanck.com" term="sudoku" />
		<summary type="html"><![CDATA[When I posted my Javascript Sudoku solver earlier this month, I noted that it would be interesting to build a version that was optimized for speed. The original deliberately pauses every 1/100th of a second to update the screen and give your computer a chance to breathe. In my experience, Javascript running at full speed&#160;...]]></summary>

					<content type="html" xml:base="https://roytanck.com/2022/01/23/solving-sudokus-with-rust/"><![CDATA[
<p>When I posted my <a href="https://roytanck.com/2022/01/05/my-attempt-at-writing-a-sudoku-solver/" data-type="post" data-id="561">Javascript Sudoku solver</a> earlier this month, I noted that it would be interesting to build a version that was optimized for speed. The original deliberately pauses every 1/100th of a second to update the screen and give your computer a chance to breathe.</p>



<p>In my experience, Javascript running at full speed for a long time tends to make browsers unresponsive. So the solver uses only about 3% of my laptop&#8217;s CPU power, and can take up to 5 minutes to solve a complicated puzzle. On the plus side, I think it does look nice, and it&#8217;s fast enough for any Sudoku you&#8217;ll find in puzzle books.</p>



<h2 class="wp-block-heading" id="trying-rust">Trying Rust</h2>



<p>I&#8217;d been wanting to try <a href="https://www.rust-lang.org/">Rust</a> for a while. It&#8217;s a modern programming language that is very different from other languages I use. And from what I&#8217;d heard, programs written in Rust were really fast.</p>



<p>So this seemed like the perfect thing to try and build as a first Rust project. I decided to do a CLI application that solves Sudokus using the same algorithm I used in Javascript, but with no visual output. Also, I&#8217;d not throttle it in any way to see how fast it was.</p>



<p><a href="https://github.com/roytanck/sudoku-solver-rust">https://github.com/roytanck/sudoku-solver-rust</a></p>



<p>Please keep in mind that this was quite literally the first thing I ever wrote in Rust after &#8220;Hello, World!&#8221;. I&#8217;m probably not fully utilizing the language&#8217;s strengths, and yet it seems plenty fast to me already.</p>



<h2 class="wp-block-heading" id="testing">Testing</h2>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="881" height="632" src="https://roytanck.com/wp-content/uploads/2022/01/sudoku-rust-large.png" alt="" class="wp-image-596" srcset="https://roytanck.com/wp-content/uploads/2022/01/sudoku-rust-large.png 881w, https://roytanck.com/wp-content/uploads/2022/01/sudoku-rust-large-768x551.png 768w" sizes="(max-width: 881px) 100vw, 881px" /></figure>



<p>This is actually the same puzzle that took the Javascript version 5 minutes to solve. It&#8217;s designed to frustrate brute force solvers, but from the looks of it fails miserably at that :).</p>



<p>Since there&#8217;s a lot of randomness in the algorithm, solve times vary wildly, even with the same puzzle. But the 2ms in the screenshot isn&#8217;t even the fastest solve I&#8217;ve seen. Anything between 0(!) and 30 milliseconds is common, and the highest I&#8217;ve seen is ~90ms.</p>



<p>Currently, the CLI application uses 100% of a single CPU core. Rust does support multi-threading, but I&#8217;m not sure it would make much of a difference here.</p>



<p>Please note that this does not mean that Rust is 30,000 times faster than Javascript. The two programs are very different in what they aim to do. It does prove that on a reasonably fast computer, my algorithm can solve pretty much any Sudoku puzzle in a fraction of a second.</p>



<h2 class="wp-block-heading" id="update-benchmarking">Update: Benchmarking</h2>



<p>I decided to add a simple benchmarking option to the CLI program, that allows you to solve the same puzzle multiple time. I used the included puzzles and got some interesting results.</p>



<figure class="wp-block-table"><table><thead><tr><th>Puzzle</th><th>Nr of solves</th><th>Time (mm:ss)</th><th>Avg. time</th></tr></thead><tbody><tr><td>extreme.txt</td><td>100,000</td><td>02:40</td><td>1.60 ms</td></tr><tr><td>unsolvable.txt</td><td>10,000</td><td>29:35</td><td>177.50 ms</td></tr><tr><td>protected.txt</td><td>1,000</td><td>08:43</td><td>523.10 ms</td></tr></tbody></table></figure>



<p>(Update, Feb 11th, 2022: A bug caused the original benchmarking results to be wrong, so I updated these with new, correct values).</p>



<h2 class="wp-block-heading" id="update-2-multi-threading">Update 2: Multi-threading</h2>



<p>Since the only way to make this any faster was to use multiple CPU threads, I read up on multi-threading in Rust. That turned out to be relatively straightforward, so I added that. If I re-run the benchmarks with four threads, I get the following results.</p>



<figure class="wp-block-table"><table><thead><tr><th>Puzzle</th><th>Nr of solves</th><th>Time (mm:ss)</th><th>Avg. time</th></tr></thead><tbody><tr><td>extreme.txt</td><td>100,000</td><td>01:00</td><td>0.60 ms</td></tr><tr><td>unsolvable.txt</td><td>10,000</td><td>11:22</td><td>68.28 ms</td></tr><tr><td>protected.txt</td><td>1,000</td><td>03:22</td><td>202.14 ms</td></tr></tbody></table></figure>



<p>The Virtual Machine I&#8217;m using for Rust development has access to half of my laptop&#8217;s four cores and eight threads. So the best result is likely going to be achieved using four threads. As, expected, we&#8217;re seeing a 50%+ reduction in average solve times.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>Roy Tanck</name>
					</author>

		<title type="html"><![CDATA[Tweaking Surge by adding a configuration file]]></title>
		<link rel="alternate" type="text/html" href="https://roytanck.com/2022/01/13/tweaking-surge-by-adding-a-configuration-file/" />

		<id>https://roytanck.com/?p=585</id>
		<updated>2022-01-13T09:18:27Z</updated>
		<published>2022-01-13T08:31:24Z</published>
		<category scheme="https://roytanck.com" term="WordPress" /><category scheme="https://roytanck.com" term="performance" />
		<summary type="html"><![CDATA[Surge is a new WordPress page caching plugin that stands out because it has no settings. There&#8217;s nothing to configure, it just works. If you&#8217;re an experienced webmaster however, there are a few configuration tweaks you can do by adding a small PHP file. Here&#8217;s how. Step 1, add the file Create a new file&#160;...]]></summary>

					<content type="html" xml:base="https://roytanck.com/2022/01/13/tweaking-surge-by-adding-a-configuration-file/"><![CDATA[
<p><a href="https://roytanck.com/2021/12/09/some-quick-performance-tests-with-surge-a-new-wordpress-caching-plugin/" data-type="post" data-id="525">Surge</a> is a new WordPress page caching plugin that stands out because it has no settings. There&#8217;s nothing to configure, it just works. If you&#8217;re an experienced webmaster however, there are a few configuration tweaks you can do by adding a small PHP file. Here&#8217;s how.</p>



<h2 class="wp-block-heading">Step 1, add the file</h2>



<p>Create a new file in the root of your WordPress install, and call it &#8220;cache-config.php&#8221;. You can use a differen name since we&#8217;ll tell Surge where to find it in step 2, but make sure it&#8217;s a PHP file. This is what should be in it at the very minimum.</p>


<pre class="wp-block-code" aria-describedby="shcb-language-1" data-shcb-language-name="PHP" data-shcb-language-slug="php"><span><code class="hljs language-php"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-keyword">return</span> $config;</code></span><small class="shcb-language" id="shcb-language-1"><span class="shcb-language__label">Code language:</span> <span class="shcb-language__name">PHP</span> <span class="shcb-language__paren">(</span><span class="shcb-language__slug">php</span><span class="shcb-language__paren">)</span></small></pre>


<p>Once we&#8217;ve hooked it up in the next step, this file will be included by Surge, and it&#8217;ll know about the $config variable. That variable contains an array of settings. Our file&#8217;s job is to modify $config, and then return it. Any settings we&#8217;ll change before returning $config will then be used by Surge. But for now, let&#8217;s simply return the array as is.</p>



<h2 class="wp-block-heading">Step 2, modify wp-config.php</h2>



<p>Next, we&#8217;ll need to tell Surge where our new file is, and what it&#8217;s called. You can do this by adding a single line to your website&#8217;s wp-config.php. Find the line that sets &#8220;WP_CACHE&#8221; to true, and directly below it, add the following.</p>


<pre class="wp-block-code" aria-describedby="shcb-language-2" data-shcb-language-name="PHP" data-shcb-language-slug="php"><span><code class="hljs language-php">define( <span class="hljs-string">'WP_CACHE_CONFIG'</span>, <span class="hljs-keyword">__DIR__</span> . <span class="hljs-string">'/cache-config.php'</span> );</code></span><small class="shcb-language" id="shcb-language-2"><span class="shcb-language__label">Code language:</span> <span class="shcb-language__name">PHP</span> <span class="shcb-language__paren">(</span><span class="shcb-language__slug">php</span><span class="shcb-language__paren">)</span></small></pre>


<p>This will tell Surge to look for cache-config.php in the current folder. Check if your site still works, and we&#8217;re ready to do some actual tweaks. If your wp-config.php is not in the site&#8217;s web root folder, you&#8217;ll nee to modify the code above accordingly.</p>



<h2 class="wp-block-heading">Configuration fields</h2>



<p>Currently, the $config array contains four fields that you can change. You&#8217;re not allowed to remove any, and adding new ones won&#8217;t work either.</p>



<figure class="wp-block-table is-style-regular"><table><thead><tr><th>Array key</th><th>Value</th></tr></thead><tbody><tr><td>ttl</td><td>The number of seconds a page is cached before cache is invalidated</td></tr><tr><td>ignore_cookies</td><td>An array of cookie names that are will not cause a page to be excluded from caching</td></tr><tr><td>ignore_query_vars</td><td>An array of URL parameters that won&#8217;t cause a page to be excluded from caching</td></tr><tr><td>variants</td><td>An array of &#8220;variants&#8221;, <a href="https://konstantin.blog/2021/wordpress-cache-invalidation-with-flags/">see this blog post</a> for more info</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Setting a longer cache expiration time</h2>



<p>TTL stands for &#8220;time to live&#8221;, and basically determines how long any page will be served from cache before a fresh copy is generated. By default the value is 600, so any cache file will be expire after 10 minutes. This is a good default value, but on this blog, which isn&#8217;t updated very often, I wanted to set it to a higher value. Here&#8217;s the cache-config.php I&#8217;m using.</p>


<pre class="wp-block-code" aria-describedby="shcb-language-3" data-shcb-language-name="PHP" data-shcb-language-slug="php"><span><code class="hljs language-php"><span class="hljs-meta">&lt;?php</span>
$config&#91;<span class="hljs-string">'ttl'</span>] = <span class="hljs-number">1800</span>;
<span class="hljs-keyword">return</span> $config;</code></span><small class="shcb-language" id="shcb-language-3"><span class="shcb-language__label">Code language:</span> <span class="shcb-language__name">PHP</span> <span class="shcb-language__paren">(</span><span class="shcb-language__slug">php</span><span class="shcb-language__paren">)</span></small></pre>


<p>As you can see, I&#8217;ve added a line that sets the &#8220;ttl&#8221; value before returning the array to Surge. As a result, pages are now cached for half an hour.</p>



<h2 class="wp-block-heading">Adding a URL parameter to ignore</h2>



<p>If your website uses a URL parameter that does not result in the page&#8217;s content being unique, you can improve Surge&#8217;s efficiency by adding that parameter to &#8220;ignore_query_vars&#8221;.</p>


<pre class="wp-block-code" aria-describedby="shcb-language-4" data-shcb-language-name="PHP" data-shcb-language-slug="php"><span><code class="hljs language-php"><span class="hljs-meta">&lt;?php</span>
$config&#91;<span class="hljs-string">'ignore_query_vars'</span>]&#91;] = <span class="hljs-string">'my_var'</span>;
<span class="hljs-keyword">return</span> $config;</code></span><small class="shcb-language" id="shcb-language-4"><span class="shcb-language__label">Code language:</span> <span class="shcb-language__name">PHP</span> <span class="shcb-language__paren">(</span><span class="shcb-language__slug">php</span><span class="shcb-language__paren">)</span></small></pre>


<p>This will add &#8220;my_var&#8221; to the of set url variables that Surge ignores. This means that &#8220;example.com?my_var=1&#8221; and &#8220;example.com?my_var=2&#8221; are considered identical and will be served from cache.</p>



<p>If you&#8217;re not familiar with PHP, please note the extra set op square brackets. In other languages, you&#8217;d use something like push(), but this is PHP&#8217;s weird way of adding an item to an array. Without the [], the existing array would be overwritten. Since is contains a large number of commonly use tracking and marketing variables, that is not a good idea. Also, &#8220;ignore_query_vars&#8221; would then be a string, not an array.</p>



<p>Adding cookie names and variants works in much the same way.</p>



<h2 class="wp-block-heading">Advanced options</h2>



<p>Since the configuration file is written in PHP, you can get creative with it. For instance, a simple if-statement will allow you to modify the settings only for certain user agents. Please do note that cache-config.php is executed very early, before most of WordPress is booted up. Hooks, filters and core functions may not yet be available.</p>



<p>For most users, Surge will work fine out of the box. But it&#8217;s nice to have some control should you need it.</p>
]]></content>
		
			</entry>
	</feed>
