<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Dan&#39;s Bloviating</title>
  <subtitle>I am writing about stuff I care about.</subtitle>
  <link href="https://danieljblumenfeld.com/blog/feed.xml" rel="self"/>
  <link href="https://danieljblumenfeld.com/blog/"/>
  <updated>2024-12-11T00:00:00Z</updated>
  <id>https://danieljblumenfeld.com/blog/</id>
  <author>
    <name>Dan Blumenfeld</name>
    <email>dan@danieljblumenfeld.com</email>
  </author>
  
  <entry>
    <title>Starting to play with the UI</title>
    <link href="https://danieljblumenfeld.com/blog/2024/12/ui/"/>
    <updated>2024-12-11T00:00:00Z</updated>
    <id>https://danieljblumenfeld.com/blog/2024/12/ui/</id>
    <content type="html">&lt;section&gt;
&lt;p&gt;In the first iteration of this reincarnation of my site, I started with a quick-n-dirty Bootstrap theme to get the ball rolling...seemed reasonable, right? 
    A quick way to get started?
&lt;/p&gt;
&lt;p&gt;
    Yeah, well...it took roughly 2 hours before I began to realize that implementing anything in Bootstrap before I had at least 
    a passing familiarity with CSS was a bad idea. When I found myself sprinkling the pages with &lt;code&gt;&amp;lt;hr&amp;gt;&lt;/code&gt;s and &lt;code&gt;&amp;amp;nbsp;&lt;/code&gt;s 
    just to mess with layout, that was a danger sign. Young(er) Dan may well have stubbornly forged ahead, but old(er) wise(r) Dan chose another path.
&lt;/p&gt;
&lt;p&gt;
    So, I pulled out all of the CSS and Bootstrap junk I&#39;d dropped in place, and started instead hand-crafting the CSS one step at a time.
&lt;/p&gt;
&lt;/section&gt;


&lt;h2&gt;Preliminary cleanup&lt;/h2&gt;

&lt;section&gt;
    &lt;h3&gt;Eleventy blocks&lt;/h3&gt;
    One of the first things I realized, even before getting to the styling, is that I wanted to be able to override the page title format. I&#39;m happy with the default of &lt;strong&gt;Dan Blumenfeld - {page title}&lt;/strong&gt; in most cases, but, as an example, &lt;strong&gt;Dan Blumenfeld - Blog - {post title}&lt;/strong&gt; might be better for blog posts.

    This was pleasantly easy to accomplish.
    &lt;ol&gt;
        &lt;li&gt;
            In my base page layout (&lt;code&gt;base.njk&lt;/code&gt;), I defined the title as &lt;code&gt;&amp;lt;title&amp;gt;{% block title %}Dan Blumenfeld - {{ title }}{% endblock %}&amp;lt;/title&amp;gt;&lt;/code&gt;, so that whatever title was defined in the front matter of the page being displayed would be used.
        &lt;/li&gt;
        &lt;li&gt;
            I created a child layout (&lt;code&gt;blog.njk&lt;/code&gt;), with the following content:
            &lt;p&gt;
            &lt;code&gt;
    {% extends &quot;layouts/base.njk&quot; %}

    {% block title %}Dan Blumenfeld - Blog - {{ title }}{% endblock %}
    &lt;/code&gt;&lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
            I specified the child layout in the front matter of my post as so: &lt;code&gt;layout: layouts/blog.njk&lt;/code&gt;
        &lt;/li&gt;
    &lt;/ol&gt;
    &lt;p&gt;
        And just like magic, it worked. :-)
    &lt;/p&gt;    
&lt;/section&gt;

&lt;section&gt;
    &lt;h3&gt;File format choices&lt;/h3&gt;
    &lt;p&gt;
        I had started with a mix of Markdown and HTML, as I hadn&#39;t yet come across a reason to prefer one over the other. 
        Until I realized that Markdown was going to be converted to HTML anyway, so I&#39;d have more control over the eventual output 
        if I just went to HTML in the first place.
    &lt;/p&gt;
    &lt;p&gt;
        This triggered a bit of angst because I&#39;d already created quite a few Markdown files which needed to be converted; 
        but, taking steps now to make things more consistent down the road seemed wise.
    &lt;/p&gt;
    &lt;p&gt;
        So, to sum up: the gerneral rule is that all layout files are Nunjucks(.njk) and all content files are HTML.
    &lt;/p&gt;
&lt;/section&gt;

&lt;section&gt;
    &lt;h3&gt;Semantic markup&lt;/h3&gt;
    &lt;p&gt;
        Apparently, in this newfangled world of HTML5, there are more options than just the &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag for 
        &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Document_and_website_structure#Enter_HTML5_structural_elements%22&quot;&gt;grouping content&lt;/a&gt;. 
        Who knew?!?
    &lt;/p&gt;
    &lt;p&gt; So, I went through and made a feeble stab at applying the correct tags.&lt;/p&gt;
&lt;/section&gt;



&lt;h2&gt;Styling&lt;/h2&gt;
&lt;section&gt;
    &lt;h3&gt;Resources used&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;https://youtu.be/OXGznpKZ_sA?si=lb0_hswsnAhsSsUy&quot;&gt;CSS Tutorial Video&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS&quot;&gt;MDN CSS Reference&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt; My first question: variables, please?&lt;/h3&gt;
    &lt;p&gt;
        After typing the same color and size variables more than twice, I had to ask: how can I define variables or otherwise keep my CSS as DRY as possible?
    &lt;/p&gt;
    &lt;p&gt;
        It turns out that I can use &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties&quot;&gt;CSS Custom Properties&lt;/a&gt;. 
        This is a means by which properties can be defined using two dashes (--), so that they operate in the same cascading manner as other CSS entities;
        or they can be defined using the @property at-rule. In both cases, they can then be referenced using an inline &lt;code&gt;var(--custompropname);&lt;/code&gt; syntax in the following CSS.
    &lt;/p&gt;
    &lt;section&gt;
        &lt;h4&gt;Two-dash declaration&lt;/h4&gt;
        &lt;p&gt;Has to be written inside a ruleset. For global access, adding them to the root selector is an easy approach, but they can be declared inside any ruleset.&lt;/p&gt;
        &lt;pre&gt;
            :root {
                --secondary-color: #c0ffee;
              }
              
        &lt;/pre&gt;
    &lt;/section&gt;
    &lt;section&gt;
        &lt;h4&gt;@property at-rule definition&lt;/h4&gt;
        &lt;p&gt;More expressive, in theory. I&#39;ve not really used them yet.&lt;/p&gt;
        &lt;pre&gt;
            @property --secondary-color {
                syntax: &quot;&lt;color&gt;&quot;;
                inherits: false;
                initial-value: #c0ffee;
              }              
        &lt;/color&gt;&lt;/pre&gt;
    &lt;/section&gt;
    &lt;section&gt;
        &lt;h4&gt;Referencing the custom properties&lt;/h4&gt;
        &lt;pre&gt;
            main {
                background-color: var(--secondary-color);
              }              
        &lt;/pre&gt;
    &lt;/section&gt;
&lt;/section&gt;





</content>
  </entry>
  
  <entry>
    <title>Configuring my daily driver using Ansible</title>
    <link href="https://danieljblumenfeld.com/blog/2024/12/ansible/"/>
    <updated>2024-12-06T00:00:00Z</updated>
    <id>https://danieljblumenfeld.com/blog/2024/12/ansible/</id>
    <content type="html">&lt;p&gt;
Historically, I&#39;ve practiced a form of infrastructure management I like to call &quot;memory-based chaos&quot;. 
However, as I slide through middle age with increasing lack of cognitive grace, it becomes more apparent that I should let my tools work for me. 
Enter shell scripting and &lt;a href=&quot;https://www.ansible.com/&quot;&gt;Ansible&lt;/a&gt; 
&lt;/p&gt;

&lt;h2&gt;The goal&lt;/h2&gt;
In my ideal world, I&#39;d like to use the following ever-so-elaborate process to set up my daily driver:
&lt;ol&gt;
    &lt;li&gt;Install a clean copy of Ubuntu with minimal tools (including Git)&lt;/li&gt;
    &lt;li&gt;Pull &lt;a href=&quot;https://github.com/DanBlumenfeld/ansible-ubuntu-local&quot;&gt;my repo&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Execute &lt;a href=&quot;https://github.com/DanBlumenfeld/ansible-ubuntu-local/blob/main/local-install.sh&quot;&gt;local-install.sh&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Answer a couple of questions, then wait&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;Requirements&lt;/h2&gt;
&lt;ul&gt;
    &lt;li&gt;It should be idempotent. I don&#39;t want to cause problems by re-running the process.&lt;/li&gt;
    &lt;li&gt;It should be user friendly. The process should save my responses locally, and ask me if I wish to re-use them. (With obvious exceptions for sensitive data like passwords and access tokens, of course.)&lt;/li&gt;
    &lt;li&gt;It should be designed to run locally, but with an eye towards running it against other hosts too. &lt;em&gt;This is more for my learning than any practical purpose, as I find it unlikely that I&#39;ll want to set up my workstation remotely&lt;/em&gt;.&lt;/li&gt;
    &lt;li&gt;Each component should be able to be run independently, with minimal upstream dependencies. This keeps things easier to use on an ad-hoc basis, as well as easier to debug.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;The initial manifest&lt;/h2&gt;
&lt;ol&gt;
 	&lt;li&gt;Ansible (Used to drive the rest of the system configuration)&lt;/li&gt;
 	&lt;li&gt;Git configuration. Defines local git settings, generates SSH key, pushes said key to Github&lt;/li&gt;
 	&lt;li&gt;System hardening, details TBD&lt;/li&gt;
 	&lt;li&gt;Tor Browser&lt;/li&gt;
 	&lt;li&gt;1Password &lt;/li&gt;
 	&lt;li&gt;1Password CLI &lt;/li&gt;
 	&lt;li&gt;Sublime Text &lt;/li&gt;
 	&lt;li&gt;Sublime Merge &lt;/li&gt;
 	&lt;li&gt;Docker and docker-compose&lt;/li&gt;
 	&lt;li&gt;DevToys &lt;/li&gt;
 	&lt;li&gt;Visual Studio Code&lt;/li&gt;
 	&lt;li&gt;Terraform&lt;/li&gt;
 &lt;/ol&gt;

 &lt;h2&gt;How&#39;s it going so far?&lt;/h2&gt;
 &lt;p&gt;Quite well, actually. &lt;/p&gt;
 &lt;p&gt;I&#39;ve got a seemingly decent model for the individual playbooks and associated scripts, with at least a modicum of sanity checking and convenience features.&lt;/p&gt;
 &lt;p&gt;The Ansible, git config, Tor Browser, and VS Code scripts and playbooks are implemented and seem to work nicely.&lt;/p&gt; 

 &lt;h2&gt;Lessons Learned&lt;/h2&gt;
- My UniFi network &lt;a href=&quot;https://danieljblumenfeld.com/nts/unifi-and-tor/&quot;&gt;needed some help&lt;/a&gt; to unblock Tor traffic. Apparently. &quot;dark web&quot; is synonymous with &quot;concern for privacy&quot; in the eyes of Ubiquiti&#39;s UX designers.</content>
  </entry>
  
  <entry>
    <title>Thriller!</title>
    <link href="https://danieljblumenfeld.com/blog/2024/12/thriller/"/>
    <updated>2024-12-03T00:00:00Z</updated>
    <id>https://danieljblumenfeld.com/blog/2024/12/thriller/</id>
    <content type="html">
&lt;img src=&quot;https://danieljblumenfeld.com/assets/blog/2024/12/thriller/Michael_jackson.png&quot; alt=&quot;Michael Jackson in zombie makeup from the Thriller music video&quot; title=&quot;Dead, and still better looking than I am.&quot; /&gt;
&lt;br /&gt;
&lt;small&gt;*&lt;a href=&quot;https://commons.wikimedia.org/wiki/File:Michael_jackson_vector.svg&quot;&gt;Vectorportal&lt;/a&gt;, &lt;a href=&quot;https://creativecommons.org/licenses/by/3.0&quot;&gt;CC BY 3.0&lt;/a&gt;, via Wikimedia Commons*&lt;/small&gt;

&lt;p&gt;
    This, my personal website, has been under the weather for quite some time. I had set it up using Namecheap-hosted Wordpress many years ago, then let it lie fallow ever since. 
    At some point in the past year or so, the Wordpress instance stopped working, and I didn&#39;t even realize it until this month.
&lt;/p&gt;
&lt;p&gt;
    So, it&#39;s time to bring the site back to life. This time, I&#39;m broadening my horizons by avoiding any dynamic server-based solutions, 
    and am instead going with static content and old-school hand-crafted HTML/CSS/JS.
&lt;/p&gt;
&lt;p&gt;
    Because I&#39;m not a *complete* masochist, I&#39;m using &lt;a href=&quot;https://www.11ty.dev/&quot;&gt;Eleventy&lt;/a&gt; &lt;del&gt;and Bootstrap&lt;/del&gt;&lt;small&gt;[Edited to add] A week later, I decided to skip Bootstrap and learn some CSS basics instead.&lt;/small&gt;.
&lt;/p&gt;
&lt;p&gt;
    My front-end implementation and design skills are lacking, to say the least, but at least this will force me to learn something.
&lt;/p&gt;</content>
  </entry>
</feed>