<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" >

  <title>Erik L. Arneson — Writer and Software Developer</title>
  <subtitle>Erik L. Arneson is a freelance writer and software developer with WordPress experience. He is located in Portland, Oregon.</subtitle>
  <generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator>
  <link href="https://arnesonium.com/feeds/best-practices.xml" rel="self" type="application/atom+xml" />
  <link href="https://arnesonium.com/" rel="alternate" type="text/html" />
  <updated>2026-06-18T15:03:10+00:00</updated>
  <id>https://arnesonium.com/feeds/best-practices.xml</id>
  <author>
    <name>Erik L. Arneson</name>
  </author>
      <entry>
        
        <title>Slides on a Stick with Raspberry Pi Zero W</title>
        <author>
          <name>Erik L. Arneson</name>
        </author>        
        <link href="https://arnesonium.com/2017/10/slides-on-a-stick-with-raspberry-pi-zero-w/" rel="alternate" type="text/html" title="Slides on a Stick with Raspberry Pi Zero W" />
        <updated>2017-10-15T19:38:19+00:00</updated>
        <id>https://arnesonium.com/2017/10/slides-on-a-stick-with-raspberry-pi-zero-w</id>
          <category term="best-practices" />
        
          <category term="public-speaking" />
        
          <category term="raspberry-pi" />
        
          <category term="tutorial" />
        
          <category term="writing" />
        <content type="html" xml:base="https://arnesonium.com/2017/10/slides-on-a-stick-with-raspberry-pi-zero-w/">&lt;p&gt;If you give presentations often, you will know that one of the biggest headaches is managing slides. You have to figure out software, hardware, and connectors. I’ve usually resorted to bringing a USB thumb drive with my slides in PDF and ODP format, but then I came across an even better idea: the Raspberry Pi Zero W (or RPi0W).
&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;Previously, I had been playing with using &lt;a href=&quot;https://arnesonium.com/2017/04/raspberry-pi-gpio-with-erlang/&quot;&gt;Erlang on the RPi0W to control stepper motors&lt;/a&gt;, but this seemed more useful. Follow along to see how I created a portable presentation machine that’s about the size of a pack of gum.&lt;/p&gt;

&lt;h2 id=&quot;hardware-used&quot;&gt;Hardware Used&lt;/h2&gt;

&lt;iframe style=&quot;width:120px;height:240px;float:right;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;amp;OneJS=1&amp;amp;Operation=GetAdHtml&amp;amp;MarketPlace=US&amp;amp;source=ss&amp;amp;ref=as_ss_li_til&amp;amp;ad_type=product_link&amp;amp;tracking_id=aarggaminggroup&amp;amp;marketplace=amazon&amp;amp;region=US&amp;amp;placement=B01HG8DB5E&amp;amp;asins=B01HG8DB5E&amp;amp;linkId=5a34d4956347681153b14f52f9ee75a1&amp;amp;show_border=true&amp;amp;link_opens_in_new_window=true&quot;&gt;&lt;/iframe&gt;
&lt;p&gt;I purchased the RPi0W as part of a kit so it would have a nice case and all of the connectors I needed. I also wanted a good way to control it, so I found an inexpensive mini wireless keyboard and mouse on Amazon. You can follow my example or find your own alternatives.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.adafruit.com/product/3410&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;Raspberry Pi Zero W Budget Pack from Adafruit&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://amzn.to/2yq8A3E&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;Aerb 2.4GHz Mini Wireless Keyboard with Mouse Touchpad&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;installing-and-configuring-software&quot;&gt;Installing and Configuring Software&lt;/h2&gt;

&lt;p&gt;I’m not the first person to think of using a Raspberry Pi for slides and presentations. Rob Reilly wrote a &lt;a href=&quot;http://www.raspberry-pi-geek.com/Archive/2014/06/Equip-your-Pi-for-slide-and-video-presentations&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;great article on this topic for Raspberry Pi Geek&lt;/a&gt; which provides some great tips and recommendations. However, I wanted to create a presentation machine that was even faster and more portable.&lt;/p&gt;

&lt;p&gt;I used &lt;a href=&quot;https://www.raspberrypi.org/downloads/raspbian/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;Raspbian Stretch with Desktop&lt;/a&gt;, but knew that I would run into memory and performance issues on the RPi0W. It only has 512MB of RAM, so I would need to use small, efficient applications and cut out unnecessary services and applications on the device. It’s really important that the machine boots up fast and gets running quickly.&lt;/p&gt;

&lt;p&gt;Quickly I gave up on the idea of running LibreOffice Impress. Instead, I would use a lightweight full-screen PDF viewer. I tested out a number of the smaller PDF readers available on Raspbian before finally settling on &lt;a href=&quot;https://naihe2010.github.io/apvlv/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;apvlv&lt;/a&gt;. This reader is tiny, fast, and configurable. It also requires some additional setup.&lt;/p&gt;

&lt;p&gt;Install apvlv on your system with the following commands.&lt;/p&gt;

&lt;pre lang=&quot;bash&quot; line=&quot;1&quot;&gt;
sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
sudo apt install -y apvlv
&lt;/pre&gt;

&lt;p&gt;These commands might take a while. When you are done, edit the apvlv preferences file. You will probably do this using the command &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nano ~/.apvlvrc&lt;/code&gt; but you might want a different text editor. Edit to look like this.&lt;/p&gt;

&lt;pre lang=&quot;ini&quot; line=&quot;1&quot;&gt;
set fullscreen = yes
set zoom = fitwidth
set continuous = no
set scrollbar = no
set content = no
&lt;/pre&gt;

&lt;h2 id=&quot;displaying-slides&quot;&gt;Displaying Slides&lt;/h2&gt;

&lt;p&gt;You will need to get your PDF slides onto the RPi0W. I usually use a webpage to download them, or copy them over via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scp&lt;/code&gt;. Do whatever feels best to you.&lt;/p&gt;

&lt;p&gt;Simply use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apvlv&lt;/code&gt; command from a terminal or the menu to load your PDF file. The interface is a little arcane, but easy to get the hang of. You can use the up and down arrows on the mini keyboard to go forward and backward one slide. To exit, hit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;q&lt;/code&gt; and to go to a specific slide type &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;:go &amp;lt;number&amp;gt;&lt;/code&gt; and replace “&amp;lt;number&amp;gt;” with the slide number.&lt;/p&gt;

&lt;p&gt;The RPi0W still takes a little while to boot, but you now have an extremely portable device that plugs into any HDMI screen or projector and displays your slides with as little fuss as possible!&lt;/p&gt;</content>
      </entry>
    
      <entry>
        
        <title>Alternate Ways to Call wp-cron</title>
        <author>
          <name>Erik L. Arneson</name>
        </author>        
        <link href="https://arnesonium.com/2016/03/alternate-ways-to-call-wp-cron/" rel="alternate" type="text/html" title="Alternate Ways to Call wp-cron" />
        <updated>2016-03-05T17:09:28+00:00</updated>
        <id>https://arnesonium.com/2016/03/alternate-ways-to-call-wp-cron</id>
          <category term="best-practices" />
        
          <category term="php" />
        
          <category term="programming" />
        
          <category term="web-development" />
        
          <category term="web-performance" />
        
          <category term="wordpress" />
        <content type="html" xml:base="https://arnesonium.com/2016/03/alternate-ways-to-call-wp-cron/">&lt;p&gt;WordPress includes a job scheduling system called wp-cron. The default method for scheduled jobs is for wp-cron to be checked on each page load, which has the potential to slow down your website while background jobs are run. Check out these other options that help maintain the user experience on your WordPress site while still running important tasks in the background.
&lt;!--more--&gt;&lt;/p&gt;

&lt;h2 id=&quot;using-alternate_wp_cron&quot;&gt;Using ALTERNATE_WP_CRON&lt;/h2&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALTERNATE_WP_CRON&lt;/code&gt; method uses a quick, nearly invisible redirect to direct an incoming user to a new request while the old one continues running, executing background jobs. This is an easy, effective method and it works really well if you don’t have access to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;crontab&lt;/code&gt; on your hosting site. Even though this method adds some elements to the page URL, it’s only triggered when background jobs need to be run. To enable it, follow these instructions:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Open your site’s &lt;strong&gt;wp-config.php&lt;/strong&gt; in your text editor.&lt;/li&gt;
  &lt;li&gt;After the lines containing your database credentials, add the following lines:
    &lt;div class=&quot;language-php highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cd&quot;&gt;/** Use alternate WP_CRON method with redirects. */&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;ALTERNATE_WP_CRON&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href=&quot;http://wordpress-hackers.1065353.n5.nabble.com/ALTERNATE-WP-CRON-Is-it-worth-it-td39843.html&quot; target=&quot;_blank&quot;&gt;Read more about the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALTERNATE_WP_CRON&lt;/code&gt; method here.&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;using-crontab&quot;&gt;Using Crontab&lt;/h2&gt;

&lt;p&gt;If you have access to a shell on your web host and can run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cron&lt;/code&gt; jobs, this method might be the best. It ensures that background jobs will get run, even when your website isn’t getting any visitors. It also runs background jobs without requiring a redirect or any additional delays that will be noticed by users. Here’s how you do it.&lt;/p&gt;

&lt;h3 id=&quot;add-a-crontab-entry&quot;&gt;Add a Crontab Entry&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;Run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;crontab -e&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Add the following lines to the end of your crontab file:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Call wp-cron regularly&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;/15 &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; curl http://www.example.com/wp-cron.php &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /dev/null 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Make sure you replace “www.example.com” with your website’s hostname. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*/15&lt;/code&gt; specifies that &lt;strong&gt;wp-cron.php&lt;/strong&gt; will be called every 15 minutes. If you would like to change this, replace the 15 with a different number.&lt;/p&gt;

&lt;h3 id=&quot;disable-built-in-wp-cron&quot;&gt;Disable Built-in wp-cron&lt;/h3&gt;

&lt;p&gt;The next step is to disable the built-in call to wp-cron in WordPress.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Open your site’s &lt;strong&gt;wp-config.php&lt;/strong&gt; in your text editor.&lt;/li&gt;
  &lt;li&gt;After the lines containing your database credentials, add the following lines:
    &lt;div class=&quot;language-php highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cd&quot;&gt;/** Disable built-in cron in favor of system crontab */&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;DISABLE_WP_CRON&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For more details on this method, &lt;a href=&quot;https://easyengine.io/tutorials/wordpress/wp-cron-crontab/&quot; target=&quot;_blank&quot;&gt;check out this page on EasyEngine&lt;/a&gt;.&lt;/p&gt;</content>
      </entry>
    
      <entry>
        
        <title>Link Rodeo: Go Package Management and Boring Technology</title>
        <author>
          <name>Erik L. Arneson</name>
        </author>        
        <link href="https://arnesonium.com/2015/04/link-rodeo-go-package-management-and-boring-technology/" rel="alternate" type="text/html" title="Link Rodeo: Go Package Management and Boring Technology" />
        <updated>2015-04-06T15:47:00+00:00</updated>
        <id>https://arnesonium.com/2015/04/link-rodeo-go-package-management-and-boring-technology</id>
          <category term="best-practices" />
        
          <category term="golang" />
        
          <category term="javascript" />
        
          <category term="management" />
        
          <category term="node-js" />
        
          <category term="ocaml" />
        
          <category term="programming" />
        <content type="html" xml:base="https://arnesonium.com/2015/04/link-rodeo-go-package-management-and-boring-technology/">&lt;p&gt;Here are a number of interesting topics for you to think about this week.
&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;I’ve been learning the &lt;a href=&quot;http://arnesonium.com/tag/golang/&quot; title=&quot;Go language&quot;&gt;Go programming language&lt;/a&gt; recently, and in the process I’ve been having conversations about it with friends and colleagues. Go has a unique package management system that has already caused me a number of headaches. The recommended method for taking care of package dependencies is lacking, at best. Over at Nerdbucket, my buddy Nerdmaster has written &lt;a href=&quot;http://blog.nerdbucket.com/go-dependency-freezing/article&quot; title=&quot;Go Dependency Freezing at Nerdbucket&quot; target=&quot;_blank&quot;&gt;a thoughtful piece about it&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While I’m talking about new technology, I’d also like to contradict myself by agreeing with Dan McKinley’s great piece, &lt;a href=&quot;http://mcfunley.com/choose-boring-technology&quot; title=&quot;Choose Boring Technology by Dan McKinley&quot; target=&quot;_blank&quot;&gt;“Choose Boring Technology.”&lt;/a&gt; He argues that a project should be careful about adopting lots of new tools and technologies. It reminds me of a time recently when I was looking for a Node.js programmer, and one of the replies I got back was, “For us, Node.js is glue. Its ecosystem is still too young to support anything long-term. Libraries and packages move too fast to build a product that will need actual maintenance.” I’ve had the same feeling about many technologies I’ve wanted to try, such as &lt;a href=&quot;http://ocsigen.org/&quot; title=&quot;Ocsigen&quot; target=&quot;_blank&quot;&gt;Ocsigen for OCaml&lt;/a&gt;, which has a build system and API that is always several steps ahead of its documentation.&lt;/p&gt;

&lt;p&gt;&lt;small&gt;&lt;em&gt;This post’s featured photo is courtesy of Flickr user &lt;a href=&quot;https://www.flickr.com/photos/municipiopinas/8161449094/&quot; target=&quot;_blank&quot;&gt;MunicipioPinas&lt;/a&gt;.&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;</content>
      </entry>
    
      <entry>
        
        <title>Don&apos;t Modify the Clipboard with JavaScript</title>
        <author>
          <name>Erik L. Arneson</name>
        </author>        
        <link href="https://arnesonium.com/2015/03/dont-modify-the-clipboard-with-javascript/" rel="alternate" type="text/html" title="Don't Modify the Clipboard with JavaScript" />
        <updated>2015-03-02T16:42:53+00:00</updated>
        <id>https://arnesonium.com/2015/03/dont-modify-the-clipboard-with-javascript</id>
          <category term="best-practices" />
        
          <category term="javascript" />
        
          <category term="programming" />
        
          <category term="web-design" />
        
          <category term="web-development" />
        <content type="html" xml:base="https://arnesonium.com/2015/03/dont-modify-the-clipboard-with-javascript/">&lt;p&gt;Recently, I was reading an article about a newly published book that I’m interested in. However, the article didn’t include a link to the book, so I copied the title by highlighting it with the mouse and hitting ‘Ctrl-C’, and opened a new browser tab to do a search. However, upon pasting, I saw the book title along with an annoying addition: “To read more, visit our website at [redacted].”&lt;/p&gt;

&lt;p&gt;This sort of website behavior is not okay.
&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://arnesonium.com/wp-content/uploads/2015/02/3429454121_9a93f53855_o-300x200.jpg#right&quot; alt=&quot;3429454121_9a93f53855_o&quot; width=&quot;300&quot; height=&quot;200&quot; class=&quot;alignright size-medium wp-image-309&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I’ve seen the behavior on a number of websites, and it is among my least favorite trends in web development. The user is probably using his clipboard for one of two reasons. First, the website has a UX problem, and it has neglected to link to something important. Second, the user needs the text either for a quote, or to look up an unrelated term. For instance, this sentence has the word “bucolic” in it, and that’s an uncommon word that you might want to look up.&lt;/p&gt;

&lt;p&gt;But you can’t easily, because I’ve included JavaScript on this page that modifies your copy buffer. Do you see how annoying that is? Please don’t go mucking about in your users’ copy buffers.&lt;/p&gt;

&lt;p&gt;If you want to see what happens when you try to copy and paste on this page, highlight some text on the page and hit ‘Ctrl-C’ (or ‘Cmd-C’ for OS X users). Then go to the handy text area below and paste with ‘Ctrl-V’.&lt;/p&gt;

&lt;textarea style=&quot;width:100%&quot;&gt;&lt;/textarea&gt;

&lt;p&gt;That’s really obnoxious, isn’t it?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was updated in 2022 to use Jekyll to load custom JavaScript instead of a custom WordPress plugin.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;small&gt;&lt;em&gt;The image for this post comes from &lt;a href=&quot;https://www.flickr.com/photos/shimelle/&quot; target=&quot;_blank&quot;&gt;Flickr user Shimelle Laine&lt;/a&gt;.&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;</content>
      </entry>
    
</feed>
