<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bytes in the Margin</title>
	<atom:link href="https://oscarm.org/feed/" rel="self" type="application/rss+xml" />
	<link>https://oscarm.org</link>
	<description>A catalog of random thoughts</description>
	<lastBuildDate>Wed, 02 Oct 2024 05:01:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
<site xmlns="com-wordpress:feed-additions:1">55125707</site>	<item>
		<title>Inktober 1. Backpack</title>
		<link>https://oscarm.org/2024/10/inktober-1-backpack/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Wed, 02 Oct 2024 05:01:55 +0000</pubDate>
				<category><![CDATA[Drawing]]></category>
		<guid isPermaLink="false">https://oscarm.org/?p=2483</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-medium"><img fetchpriority="high" decoding="async" width="600" height="450" src="https://oscarm.org/wp-content/uploads/2024/10/IMG_0392-600x450.jpeg" alt="Ink drawing of an adventurer looking toward mountains, they are holding a map and wearing a large backpack" class="wp-image-2484" srcset="https://oscarm.org/wp-content/uploads/2024/10/IMG_0392-600x450.jpeg 600w, https://oscarm.org/wp-content/uploads/2024/10/IMG_0392-1024x768.jpeg 1024w, https://oscarm.org/wp-content/uploads/2024/10/IMG_0392-768x576.jpeg 768w, https://oscarm.org/wp-content/uploads/2024/10/IMG_0392-1536x1152.jpeg 1536w, https://oscarm.org/wp-content/uploads/2024/10/IMG_0392-2048x1536.jpeg 2048w" sizes="(max-width: 600px) 100vw, 600px" /></figure>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2483</post-id>	</item>
		<item>
		<title>Comparing directories with HTML output</title>
		<link>https://oscarm.org/2024/09/comparing-directories-with-html-output/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Wed, 11 Sep 2024 14:42:31 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">https://oscarm.org/?p=2480</guid>

					<description><![CDATA[If you have two copies of static sites and want to compare the output of the two, here are some Linux command line utilities I&#8217;ve used for that task on a recent project. HTML Tidy I used HTML tidy to normalize the HTML output of the two directories. This step formats the HTML files consistently [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">If you have two copies of static sites and want to compare the output of the two, here are some Linux command line utilities I&#8217;ve used for that task on a recent project. </p>



<h2 class="wp-block-heading">HTML Tidy</h2>



<p class="wp-block-paragraph">I used HTML tidy to normalize the HTML output of the two directories. This step formats the HTML files consistently and helped reduce false positives. </p>



<p class="wp-block-paragraph">I was happy to see that HTML tidy has been resurrected, on Ubuntu I installed it with</p>



<pre class="wp-block-code"><code>apt-get install tidy
</code></pre>



<p class="wp-block-paragraph">I ran tidy against all the HTML files in each output directory. I used the default configuration and it worked fine for me</p>



<pre class="wp-block-code"><code>find . -name '*.html' -type f -print -exec tidy --warn-proprietary-attributes false -mq '{}' \;</code></pre>



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



<p class="wp-block-paragraph">You can compare two directories at the command line and pipe the output to a text file for review. Once you&#8217;re familiar reading diff output, you can make sense of the lines that are different. I ended up using the &#8211;exclude and &#8211;ignore-matching-lines flag to get rid of lines which were different due to cache-busting flags or machine-generated CSS and JavaScript filenames. Doing so helped focus to find changes that matter.</p>



<pre class="wp-block-code"><code>diff -burw html/ html-new-nav/ &gt; html-diff.txt</code></pre>



<p class="wp-block-paragraph">This diff output was useful for identifying which files were actually different. To see the changes in specific pairs of files, I like using a visual diff utility like <a href="https://winmerge.org/">WinMerge</a>, <a href="https://meldmerge.org/">Meld</a>, or the diff built-in to PHPStorm.</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2480</post-id>	</item>
		<item>
		<title>Random Tables for Dokuwiki</title>
		<link>https://oscarm.org/2022/11/random-tables-for-dokuwiki/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Thu, 24 Nov 2022 04:33:49 +0000</pubDate>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://oscarm.org/?p=2469</guid>

					<description><![CDATA[I&#8217;ve been using dokuwiki to prepare for the D&#38;D game sessions I&#8217;ve been running since 2020. I know there are newer tools that are quite popular and used, particularly Notion and Obsidian. I like hosting my content and have always wanted to do more with Dokuwiki, which is a long-running PHP project that remains actively [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I&#8217;ve been using dokuwiki to prepare for the D&amp;D game sessions I&#8217;ve been running since 2020. I know there are newer tools that are quite popular and used, particularly Notion and Obsidian. I like hosting my content and have always wanted to do more with Dokuwiki, which is a long-running PHP project that remains actively developed and has an active community. I discovered it years ago when looking for a wiki solution that didn&#8217;t require a database to function. There are  plugins for adding new syntax, controlling page layout, and even for treating pages as database entries or interfacing with a sqlite database.</p>



<p class="wp-block-paragraph">One feature missing, which is quite specific to role playing games (and maybe some board games) are rolling on random tables. Not being able to find one that could be hacked to do the job, I&#8217;ve been working on a custom plugin to do just that. It&#8217;s finally  where I feel comfortable releasing it, in case others might find it useful. You can see how to install it and use it on <a href="https://www.dokuwiki.org/plugin:randomtables">RandomTables plugin page</a>.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="555" height="389" src="https://oscarm.org/wp-content/uploads/2022/11/random-table-ex.png" alt="An HTML table of four entries representing the suits in a deck of cards with a &quot;Roll&quot; button above that picks an entry at random." class="wp-image-2470"/><figcaption class="wp-element-caption">Sample random table output by my dokuwiki plugin.</figcaption></figure>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2469</post-id>	</item>
		<item>
		<title>Gargoyle Pug</title>
		<link>https://oscarm.org/2022/10/gargoyle-pub/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 03:31:41 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://oscarm.org/?p=2458</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" width="768" height="1024" src="https://oscarm.org/wp-content/uploads/2022/10/untitled_artwork-1-768x1024.jpg" alt="" class="wp-image-2460" srcset="https://oscarm.org/wp-content/uploads/2022/10/untitled_artwork-1-768x1024.jpg 768w, https://oscarm.org/wp-content/uploads/2022/10/untitled_artwork-1-450x600.jpg 450w, https://oscarm.org/wp-content/uploads/2022/10/untitled_artwork-1.jpg 900w" sizes="(max-width: 768px) 100vw, 768px" /></figure>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2458</post-id>	</item>
		<item>
		<title>Landscape Thumbnails 1</title>
		<link>https://oscarm.org/2022/02/landscape-thumbnails-1/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Thu, 10 Feb 2022 04:37:00 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://oscarm.org/?p=2453</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full"><img decoding="async" width="640" height="480" src="https://oscarm.org/wp-content/uploads/2022/02/BD7CD7FF-1C5C-4F91-8BB9-71B17DEFEA34.jpg" alt="Four black and white fantasy landscape scenes" class="wp-image-2454" srcset="https://oscarm.org/wp-content/uploads/2022/02/BD7CD7FF-1C5C-4F91-8BB9-71B17DEFEA34.jpg 640w, https://oscarm.org/wp-content/uploads/2022/02/BD7CD7FF-1C5C-4F91-8BB9-71B17DEFEA34-600x450.jpg 600w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption>Practicing landscape sketches.</figcaption></figure>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2453</post-id>	</item>
		<item>
		<title>Female Ranger drawing</title>
		<link>https://oscarm.org/2021/10/female-ranger-drawing/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Wed, 20 Oct 2021 03:30:27 +0000</pubDate>
				<category><![CDATA[Drawing]]></category>
		<guid isPermaLink="false">https://oscarm.org/?p=2447</guid>

					<description><![CDATA[Based on a reference image from https://www.instagram.com/shieldmaiden_larp/]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" width="768" height="1024" src="https://oscarm.org/wp-content/uploads/2021/10/D12B2245-9790-4974-859F-7D8B1A10F6F0-768x1024.jpeg" alt="" class="wp-image-2448" srcset="https://oscarm.org/wp-content/uploads/2021/10/D12B2245-9790-4974-859F-7D8B1A10F6F0-768x1024.jpeg 768w, https://oscarm.org/wp-content/uploads/2021/10/D12B2245-9790-4974-859F-7D8B1A10F6F0-450x600.jpeg 450w, https://oscarm.org/wp-content/uploads/2021/10/D12B2245-9790-4974-859F-7D8B1A10F6F0-1152x1536.jpeg 1152w, https://oscarm.org/wp-content/uploads/2021/10/D12B2245-9790-4974-859F-7D8B1A10F6F0-1536x2048.jpeg 1536w, https://oscarm.org/wp-content/uploads/2021/10/D12B2245-9790-4974-859F-7D8B1A10F6F0-scaled.jpeg 1920w" sizes="(max-width: 768px) 100vw, 768px" /></figure>



<p class="wp-block-paragraph">Based on a reference image from <a href="https://www.instagram.com/shieldmaiden_larp/">https://www.instagram.com/shieldmaiden_larp/</a></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2447</post-id>	</item>
		<item>
		<title>Vision Line Art</title>
		<link>https://oscarm.org/2021/03/vision-line-art/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Wed, 17 Mar 2021 03:56:30 +0000</pubDate>
				<category><![CDATA[Drawing]]></category>
		<guid isPermaLink="false">http://oscarm.org/?p=2441</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" width="768" height="1024" src="https://oscarm.org/wp-content/uploads/2021/03/00CB4F42-843B-4952-A56B-FC2832B77CE4-768x1024.jpeg" alt="" class="wp-image-2439" srcset="https://oscarm.org/wp-content/uploads/2021/03/00CB4F42-843B-4952-A56B-FC2832B77CE4-768x1024.jpeg 768w, https://oscarm.org/wp-content/uploads/2021/03/00CB4F42-843B-4952-A56B-FC2832B77CE4-450x600.jpeg 450w, https://oscarm.org/wp-content/uploads/2021/03/00CB4F42-843B-4952-A56B-FC2832B77CE4-1152x1536.jpeg 1152w, https://oscarm.org/wp-content/uploads/2021/03/00CB4F42-843B-4952-A56B-FC2832B77CE4-1536x2048.jpeg 1536w, https://oscarm.org/wp-content/uploads/2021/03/00CB4F42-843B-4952-A56B-FC2832B77CE4-scaled.jpeg 1920w" sizes="(max-width: 768px) 100vw, 768px" /></figure>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2441</post-id>	</item>
		<item>
		<title>Delg, Dwarven Cleric</title>
		<link>https://oscarm.org/2021/02/delg-dwarven-cleric/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Thu, 11 Feb 2021 21:29:35 +0000</pubDate>
				<category><![CDATA[Drawing]]></category>
		<guid isPermaLink="false">http://oscarm.org/?p=2436</guid>

					<description><![CDATA[Delg is the Life domain cleric I&#8217;m playing in our Saturday&#8217;s game when we run through Dungeon of the Mad Mage. He&#8217;s been fun to play, except the first game Intellect Devourers ate his brain, so he had to be resurrected. He also picked up a curse sword, but the rest of the party was [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" width="768" height="1024" src="https://oscarm.org/wp-content/uploads/2021/02/F9BAD80E-4476-4785-A7E8-10BEFDEF75DD-768x1024.jpeg" alt="" class="wp-image-2433" srcset="https://oscarm.org/wp-content/uploads/2021/02/F9BAD80E-4476-4785-A7E8-10BEFDEF75DD-768x1024.jpeg 768w, https://oscarm.org/wp-content/uploads/2021/02/F9BAD80E-4476-4785-A7E8-10BEFDEF75DD-450x600.jpeg 450w, https://oscarm.org/wp-content/uploads/2021/02/F9BAD80E-4476-4785-A7E8-10BEFDEF75DD-1152x1536.jpeg 1152w, https://oscarm.org/wp-content/uploads/2021/02/F9BAD80E-4476-4785-A7E8-10BEFDEF75DD-1536x2048.jpeg 1536w, https://oscarm.org/wp-content/uploads/2021/02/F9BAD80E-4476-4785-A7E8-10BEFDEF75DD-scaled.jpeg 1920w" sizes="(max-width: 768px) 100vw, 768px" /></figure>



<p class="wp-block-paragraph">Delg is the Life domain cleric I&#8217;m playing in our Saturday&#8217;s game when we run through Dungeon of the Mad Mage. He&#8217;s been fun to play, except the first game Intellect Devourers ate his brain, so he had to be resurrected. He also picked up a curse sword, but the rest of the party was kind enough to chop of his hand before resurrecting him, thus ending the curse.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2436</post-id>	</item>
		<item>
		<title>Testing HTTP Redirects in PHP</title>
		<link>https://oscarm.org/2021/01/testing-http-redirects-in-php/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Fri, 22 Jan 2021 04:05:29 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://oscarm.org/?p=2429</guid>

					<description><![CDATA[For a task today, I wanted to verify that redirects on a website were working as expected after migrating them from one redirect plugin to another one (yes, this site had 2 enabled). I couldn&#8217;t figure out the right invocation to test them using cURL in PHP, even though the documentation seemed straightforward (just set [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">For a task today, I wanted to verify that redirects on a website were working as expected after migrating them from one redirect plugin to another one (yes, this site had 2 enabled). I couldn&#8217;t figure out the right invocation to test them using cURL in PHP, even though the documentation seemed straightforward (just set follow redirects to false&#8230;didn&#8217;t work).</p>



<p class="wp-block-paragraph">At the end of the day, I initially got it working by using curl from the command line, then parsing the headers it spits back. The switches are s, k, and capital i). That makes the initial request and returns the headers without following any Location headers</p>



<pre class="wp-block-preformatted">exec( "curl -skI " . escapeshellarg( $url ), $output );</pre>



<p class="wp-block-paragraph">But, I really wanted to know it could be done without dropping to the shell. And of course, there is a way to do it, using stream filters. I got tripped up in creating the context. At first, I had max_redirect and follow_location in the ssl block, but they were ignored. I didn&#8217;t realize you could specify options across &#8220;protocols&#8221; but it is totally doable&#8212;all with native PHP functionality:</p>



<pre class="wp-block-code"><code>$url = "https://www.oscarm.org";

$opts = &#91;
    'ssl' => &#91;
        'method' => 'GET',
        'verify_peer' => false,
        'allow_self_signed' => true,
    ],
    'http' => &#91;
        'max_redirects' => 1,
        'follow_location' => 0,
    ],
];

$context = stream_context_create($opts);
$stream = fopen($url, 'r', false, $context);

// header information as well as meta data
// about the stream
$headers = stream_get_meta_data($stream);
var_dump($headers);</code></pre>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2429</post-id>	</item>
		<item>
		<title>Wyvern</title>
		<link>https://oscarm.org/2020/12/wyvern/</link>
		
		<dc:creator><![CDATA[Oscar M.]]></dc:creator>
		<pubDate>Sun, 13 Dec 2020 22:37:13 +0000</pubDate>
				<category><![CDATA[Drawing]]></category>
		<guid isPermaLink="false">http://oscarm.org/?p=2426</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" width="768" height="1024" src="https://oscarm.org/wp-content/uploads/2020/12/9DD7AA9F-C067-4512-9A1B-96B254962830-768x1024.jpeg" alt="" class="wp-image-2424" srcset="https://oscarm.org/wp-content/uploads/2020/12/9DD7AA9F-C067-4512-9A1B-96B254962830-768x1024.jpeg 768w, https://oscarm.org/wp-content/uploads/2020/12/9DD7AA9F-C067-4512-9A1B-96B254962830-450x600.jpeg 450w, https://oscarm.org/wp-content/uploads/2020/12/9DD7AA9F-C067-4512-9A1B-96B254962830-1152x1536.jpeg 1152w, https://oscarm.org/wp-content/uploads/2020/12/9DD7AA9F-C067-4512-9A1B-96B254962830-1536x2048.jpeg 1536w, https://oscarm.org/wp-content/uploads/2020/12/9DD7AA9F-C067-4512-9A1B-96B254962830-scaled.jpeg 1920w" sizes="(max-width: 768px) 100vw, 768px" /></figure>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2426</post-id>	</item>
	</channel>
</rss>
