<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ubuntu on Andrew's Memory Blog</title><link>https://andrewmemory.acornwall.net/tags/ubuntu/</link><description>Recent content in Ubuntu on Andrew's Memory Blog</description><generator>Hugo -- gohugo.io</generator><image><url>https://andrewmemory.acornwall.net/img/rss_image.png</url><title>Ubuntu on Andrew's Memory Blog</title><link>https://andrewmemory.acornwall.net/</link></image><language>en</language><managingEditor>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</managingEditor><webMaster>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</webMaster><copyright>Copyright 2009--2025</copyright><lastBuildDate>Sun, 15 Feb 2026 23:08:05 -0700</lastBuildDate><atom:link href="https://andrewmemory.acornwall.net/tags/ubuntu/index.xml" rel="self" type="application/rss+xml"/><item><title>Setting up systemd resolv.conf</title><link>https://andrewmemory.acornwall.net/blog/2026-02-15-setting-up-systemd-resolv-conf/</link><pubDate>Sun, 15 Feb 2026 23:08:05 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2026-02-15-setting-up-systemd-resolv-conf/</guid><description>&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="A meme from Scooby Doo. Fred is taking the mask off a ghost labelled systemd, to discover it&amp;rsquo;s really svchost.exe"
width="300"
height="400"
src="https://andrewmemory.acornwall.net/blog/2026-02-15-setting-up-systemd-resolv-conf/images/systemd.webp"
srcset="https://andrewmemory.acornwall.net/blog/2026-02-15-setting-up-systemd-resolv-conf/images/systemd.webp 800w, https://andrewmemory.acornwall.net/blog/2026-02-15-setting-up-systemd-resolv-conf/images/systemd.webp 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2026-02-15-setting-up-systemd-resolv-conf/images/systemd.webp"&gt;&lt;/figure&gt;
&lt;p&gt;Like every intelligent person, I hate systemd. But Linux seems determined to undo all good things, and Debian has adopted it.&lt;/p&gt;
&lt;p&gt;In my Ubuntu 22.04 install, I&amp;rsquo;d disabled it and gone back to normal resolv.conf resolution. That didn&amp;rsquo;t work for 24.04. So I had to figure out the stupid resolution the systemd way.&lt;/p&gt;
&lt;p&gt;To fix DNS on Ubuntu 24.04 — which, I will note, works perfectly for every other system that gets provisioned from my DHCP server — I had to go into /etc/systemd/resolved.conf and uncomment a bunch of stupid crap.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;figcaption&gt;&lt;span&gt;&lt;mark&gt;/etc/systemd/resolved.conf&lt;/mark&gt;&lt;/span&gt; &lt;/figcaption&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-systemd" data-lang="systemd"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;[Resolve]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;DNS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;(my DNS server IP address)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;Domains&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;(my local domain)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;DNSSEC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;yes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;DNSStubListener&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;no&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;</description></item><item><title>More on using Uniden Sentinel BCDx36HP on Ubuntu 24.04 under Wine</title><link>https://andrewmemory.acornwall.net/blog/2025-04-16-more-on-uniden-sentinel-bcdx36hp-on-ubuntu-24.04-under-wine/</link><pubDate>Wed, 16 Apr 2025 22:45:00 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2025-04-16-more-on-uniden-sentinel-bcdx36hp-on-ubuntu-24.04-under-wine/</guid><description>&lt;p&gt;Running the Uniden Sentinel (BCD436HP/BCD536HP) programming software didn&amp;rsquo;t work on Wine when I was running on X on Ubuntu 24.04. After installing several versions of Wine with no joy, winetricksing random things, switching to the Intel non-free graphics driver, and more reinstalls than I want to remember, I finally hit upon success.&lt;/p&gt;
&lt;p&gt;My problem was that, after I&amp;rsquo;d started the BCDx36HP.exe, I&amp;rsquo;d see a dialog box. Then the editor window would come up. And then&amp;hellip; the editor window would disappear.&lt;/p&gt;
&lt;p&gt;The breakthrough came when I realized I could drag the editor window as it was drawing, and it would redraw correctly and stay on the screen. However, it would redecorate from the classic look to a more modern look.&lt;/p&gt;
&lt;p&gt;So&amp;hellip; I turned that setting off under the Graphics tab of &lt;code&gt;winecfg&lt;/code&gt;:&lt;/p&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="The winecfg dialog with the Graphics tab selected and &amp;lsquo;Allow the window manager to decorate the windows&amp;rsquo; unchecked, but &amp;lsquo;Allow the window manager to control the windows&amp;rsquo; checked"
width="418"
height="479"
src="https://andrewmemory.acornwall.net/blog/2025-04-16-more-on-uniden-sentinel-bcdx36hp-on-ubuntu-24.04-under-wine/images/winecfg-uncheck-window-manager-decorations.png"
srcset="https://andrewmemory.acornwall.net/blog/2025-04-16-more-on-uniden-sentinel-bcdx36hp-on-ubuntu-24.04-under-wine/images/winecfg-uncheck-window-manager-decorations.png 800w, https://andrewmemory.acornwall.net/blog/2025-04-16-more-on-uniden-sentinel-bcdx36hp-on-ubuntu-24.04-under-wine/images/winecfg-uncheck-window-manager-decorations.png 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2025-04-16-more-on-uniden-sentinel-bcdx36hp-on-ubuntu-24.04-under-wine/images/winecfg-uncheck-window-manager-decorations.png"&gt;&lt;/figure&gt;
&lt;p&gt;Once I&amp;rsquo;d done that, the &lt;a href="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/" &gt;usual instructions for using Sentinel&lt;/a&gt; worked.&lt;/p&gt;</description></item><item><title>Installing VNC on Ubuntu 24.04 with X</title><link>https://andrewmemory.acornwall.net/blog/2024-11-17-installing-x11vnc-on-ubuntu-24.04/</link><pubDate>Sun, 17 Nov 2024 16:51:20 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2024-11-17-installing-x11vnc-on-ubuntu-24.04/</guid><description>&lt;p&gt;After I &amp;ldquo;upgraded&amp;rdquo; to Ubuntu 24.04, I had to install X in order to use xscreensaver, since Wayland is way too immature. This meant I couldn&amp;rsquo;t use the integrated VNC, so I had to install another one. I found a good starting point at &lt;a href="https://forums.bunsenlabs.org/viewtopic.php?id=2154" target="_blank" rel="noreferrer"&gt;forums.bunselnabs.org&lt;/a&gt;. I ended up making a few changes. First, I needed VNC and xscreensaver and needed to add it to the autostart:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt install x11vnc xscreensaver
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir ~/.x11vnc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;x11vnc -storepassword mySecretPassword ~/.x11vnc/passwd
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir ~/.config/autostart&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Then I created files much like those from BunsenLabs. I made a few changes to get things to work and to secure them.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;figcaption&gt;&lt;span&gt;&lt;mark&gt;~/.config/autostart/x11vnc.desktop&lt;/mark&gt;&lt;/span&gt; &lt;/figcaption&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=Start the X11 VNC server
Exec=/usr/local/bin/x11vnc-start
StartupNotify=false
Terminal=false
Hidden=false&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;figure class="highlight"&gt;
&lt;figcaption&gt;&lt;span&gt;&lt;mark&gt;~/.config/autostart/xscreensaver-desktop&lt;/mark&gt;&lt;/span&gt; &lt;/figcaption&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=XSSVR
Comment=Start the X screensaver
Exec=/usr/local/bin/xscreensaver-start
StartupNotify=false
Terminal=false
Hidden=false&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;figure class="highlight"&gt;
&lt;figcaption&gt;&lt;span&gt;&lt;mark&gt;/usr/local/bin/xscreensaver-start&lt;/mark&gt;&lt;/span&gt; &lt;/figcaption&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/bash -
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&lt;/span&gt;/usr/bin/xscreensaver -no-splash &lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;figure class="highlight"&gt;
&lt;figcaption&gt;&lt;span&gt;&lt;mark&gt;/usr/local/bin/x11vnc-start&lt;/mark&gt;&lt;/span&gt; &lt;/figcaption&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/bash -
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&lt;/span&gt;/usr/bin/x11vnc -forever -display &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$DISPLAY&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; -rfbauth /home/&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$USER&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;/.x11vnc/passwd &lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Set up some good permissions:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo chmod &lt;span class="m"&gt;600&lt;/span&gt; ~/.x11vnc/passwd
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo chmod &lt;span class="m"&gt;700&lt;/span&gt; ~/.x11vnc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo chmod &lt;span class="m"&gt;755&lt;/span&gt; /usr/local/bin/xscreensaver-start
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo chmod &lt;span class="m"&gt;755&lt;/span&gt; /usr/local/bin/x11vnc-start&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Disable Automatic Screen Lock in Gnome&amp;rsquo;s Privacy settings. Configure xscreensaver with &lt;code&gt;xscreensaver-settings&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Shutdown and restart to make sure it works — that you can VNC in, that VNC requires the right password, and that the screensaver comes on when expected. The autostart commands show up in Startup Applications, which is nice. I can also type capital letters on this VNC — I couldn&amp;rsquo;t do that on the 22.04 integrated VNC.&lt;/p&gt;</description></item><item><title>Building Emacs 29.4 on Ubuntu 22.04</title><link>https://andrewmemory.acornwall.net/blog/2024-08-24-building-emacs-29-4-on-ubuntu-22-04/</link><pubDate>Sat, 24 Aug 2024 20:10:15 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2024-08-24-building-emacs-29-4-on-ubuntu-22-04/</guid><description>&lt;p&gt;I recently had to rebuild Emacs to &lt;a href="https://andrewmemory.acornwall.net/blog/2024-08-24-locking-weirdness-between-ubuntu-cifs-and-emacs/" &gt;diagnose a problem&lt;/a&gt;. It turned out the problem wasn&amp;rsquo;t the Ubuntu Emacs build, but since I had to figure it out, I&amp;rsquo;m writing it down so I will remember next time.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Grab the GNU public keys
&lt;div id="grab-the-gnu-public-keys" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#grab-the-gnu-public-keys" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;GNU has to be different. Rather than signing with some sane thing, they sign their files with gpg. 🙄 Anyway, here&amp;rsquo;s how to do that:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ curl https://ftp.gnu.org/gnu/gnu-keyring.gpg --output gnu-keyring.gpg$ gpg --import gnu-keyring.gpg
# Yes, it just imported 552 keys.&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;h2 class="relative group"&gt;Download Emacs and validate the signature
&lt;div id="download-emacs-and-validate-the-signature" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#download-emacs-and-validate-the-signature" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Feel free to substitute your favorite &lt;a href="https://www.gnu.org/prep/ftp.en.html#gnu_mirror_list" target="_blank" rel="noreferrer"&gt;mirror&lt;/a&gt; for ftp.gnu.org&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ curl https://ftp.gnu.org/gnu/emacs/emacs-29.4.tar.gz.sig --output emacs-29.4.tar.gz.sig
$ curl https://ftp.gnu.org/gnu/emacs/emacs-29.4.tar.gz --output emacs-29.4.tar.gz
$ gpg --verify emacs-29.4.tar.gz.sig
emacs-29.4.tar.gz
gpg: Signature made Sat 22 Jun 2024 08:04:31 AM MST
gpg: using RSA key BB02E407AE9EAA87C9E72A1D2D4E1FE95957135D
gpg: issuer &amp;#34;stefankangas@gmail.com&amp;#34;gpg: Good signature from &amp;#34;Stefan Kangas &amp;lt;stefan@marxist.se&amp;gt;&amp;#34; [expired]
gpg: aka &amp;#34;Stefan Kangas &amp;lt;skangas@skangas.se&amp;gt;&amp;#34; [expired]
gpg: Note: This key has expired!
Primary key fingerprint: CEA1 DE21 AB10 8493 CC9C 6574 2E82 323B 8F43 53EE
Subkey fingerprint: BB02 E407 AE9E AA87 C9E7 2A1D 2D4E 1FE9 5957 135D&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I guess? that means it&amp;rsquo;s trustworthy?&lt;/p&gt;
&lt;h2 class="relative group"&gt;Install dependencies
&lt;div id="install-dependencies" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#install-dependencies" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;In order to build you&amp;rsquo;ll need some dependencies, so install those using apt.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo apt install libgtk-3-dev libgif-dev libgnutls28-dev texinfo&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;h2 class="relative group"&gt;Extract, build and install Emacs
&lt;div id="extract-build-and-install-emacs" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#extract-build-and-install-emacs" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Next, extract the files. Then configure Emacs for your environment, build it and finally install it.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ tar xzvf emacs-29.4.tar.gz
$ cd emacs-29.4/
$ ./configure (or use ./configure --with-x-toolkit=no if you don&amp;#39;t want X support)
$ make clean; make
$ sudo make install (this installs emacs in /usr/local/bin)
$ /usr/local/bin/emacs
(if you want to uninstall)
$ sudo make uninstall&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;This build installed Emacs in /usr/local/bin, which is ahead of /usr/bin in my path, so I can have both the version I built and the package version installed at the same time. Either change your path, alias emacs=/usr/local/bin/emacs, or uninstall the Ubuntu emacs package.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Clean up
&lt;div id="clean-up" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#clean-up" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Once you&amp;rsquo;re done, you can remove libgtk-3-dev, libgif-dev, libgnutls28-dev and texinfo. Or keep &amp;rsquo;em around, they won&amp;rsquo;t hurt anything.&lt;/p&gt;</description></item><item><title>Locking weirdness between Ubuntu, CIFS and Emacs</title><link>https://andrewmemory.acornwall.net/blog/2024-08-24-locking-weirdness-between-ubuntu-cifs-and-emacs/</link><pubDate>Sat, 24 Aug 2024 01:37:20 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2024-08-24-locking-weirdness-between-ubuntu-cifs-and-emacs/</guid><description>&lt;p&gt;I&amp;rsquo;d run into a strange problem that made working with Emacs really painful. Any time I edited a file with Emacs on my CIFS mounted drive on Ubuntu 22.04, I&amp;rsquo;d see:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;Unlocking file: Invalid argument&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;&amp;hellip; when I opened it. Then, when I tried to save, I&amp;rsquo;d get a message that the save failed. I couldn&amp;rsquo;t exit Emacs, even when I said to abandon changes. (The changes themselves got saved successfully.) I could kill with a SIGTERM, but that left the file locked so I couldn&amp;rsquo;t edit it again.&lt;/p&gt;
&lt;p&gt;I tried rebuilding Emacs from source. Same issue. I suspect there&amp;rsquo;s a problem with CIFS file locking everywhere on Ubuntu, not just Emacs. Some day I&amp;rsquo;ll turf the Ubuntu built-in CIFS and go back to Samba. In the meantime, sometimes all you have is a rock when you want to pound in a nail. Adding:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;;; Something weird going on with file locking on CIFS. Disable it.
(setq create-lockfiles nil)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;to my ~/.emacs solved the problem.&lt;/p&gt;</description></item><item><title>Changing the MTA's maximum message size (postfix)</title><link>https://andrewmemory.acornwall.net/blog/2024-06-13-changing-the-mtas-maximum-message-size-postfix/</link><pubDate>Thu, 13 Jun 2024 23:36:45 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2024-06-13-changing-the-mtas-maximum-message-size-postfix/</guid><description>&lt;p&gt;I have a local machine that I use for backup. For the past week I haven&amp;rsquo;t been seeing status messages. Looking into my /var/log/syslog, I saw:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;Jun 13 04:37:07 foureyes postfix/postdrop[138227]: warning: uid=0: File too large
Jun 13 04:37:08 foureyes postfix/sendmail[138226]: warning: mail_stream_cleanup: close error
Jun 13 04:37:08 foureyes postfix/sendmail[138226]: fatal: root(0): message file too big
Jun 13 04:37:08 foureyes CRON[138018]: (root) MAIL (mailed 12798406 bytes of output but got status 0x004b from MTA#012)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I guess that means what I&amp;rsquo;m printing out for the backup is bigger than the ~10M that the Postfix default allows. Time to do something about that:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ postconf | grep message_size_limitmessage_size_limit = 10240000
$ sudo postconf message_size_limit=0
$ postconf | grep message_size_limitmessage_size_limit = 0&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Hopefully that did it.&lt;/p&gt;</description></item><item><title>Setting up and using Uniden Sentinel BCDx36HP on Ubuntu 22.04 under Wine</title><link>https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/</link><pubDate>Mon, 15 Jan 2024 22:37:00 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/</guid><description>&lt;p&gt;I finally have had success in programming my Uniden BCD436 (and would probably succeed with the Uniden BCD586 if I owned one) under Wine! This has been a problem that has persisted for ages, and now it appears that things have advanced enough that it&amp;rsquo;s possible.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Installation
&lt;div id="installation" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#installation" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;First, uninstall Wine: (&lt;strong&gt;warning&lt;/strong&gt;: this will blow away all your Wine configs, so if you use it for more than just Sentinel, save everything first)&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo apt remove wine
$ sudo apt autoremove&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Next, install Wine from the WineHQ repo by adding the winehq key, adding it to your list of repos, and instaling the package (these instructions come from &lt;a href="https://wiki.winehq.org/Ubuntu" target="_blank" rel="noreferrer"&gt;https://wiki.winehq.org/Ubuntu&lt;/a&gt;):&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
$ sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources$ wine --versionwine-8.0.2&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Install Sentinel. Download it from &lt;a href="https://info.uniden.com/" target="_blank" rel="noreferrer"&gt;info.uniden.com&lt;/a&gt; and you&amp;rsquo;ll have a zip file with a name like: BCDx36HP_Sentinel_Version_2_&lt;em&gt;xx&lt;/em&gt;_&lt;em&gt;yy&lt;/em&gt;.zip&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ unzip BCDx36HP_Sentinel_Version_2_xx_yy.zip$ cd BCDx36HP_Sentinel_Version_2_xx_yy$ wine setup.exe&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="Welcome to the BCDx36HP Sentinel Setup Wizard"
width="486"
height="112"
src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/sentinel-install.png"
srcset="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/sentinel-install.png 800w, https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/sentinel-install.png 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/sentinel-install.png"&gt;&lt;/figure&gt;
&lt;p&gt;Follow the normal Sentinel setup procedure.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve got Sentinel data files stored on my shared drive. Because of this, I had to do the following to get it reading my shared config. You probably won&amp;rsquo;t do this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Start Sentinel and download the master database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Exit Sentinel&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;cd ~/.wine/drive_c/users/_myuser_/Documents/Uniden&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;mv BCDx36HP BCDx36HP-old&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ln -s /my/shared/uniden/data-directory BCDx36HP&lt;/code&gt; (this is the directory on the SMB share that contains ActivityLog, DiscoveryLog, FavoriteLists and Profile)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start Sentinel again and confirm you can read it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Exit Sentinel&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 class="relative group"&gt;Using Sentinel
&lt;div id="using-sentinel" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#using-sentinel" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;I adapted these instructions from &lt;a href="https://wiki.radioreference.com/index.php/Sentinel_%5C%28Uniden_software%5C%29#Using_Sentinel_Under_Wine" target="_blank" rel="noreferrer"&gt;https://wiki.radioreference.com/index.php/Sentinel_(Uniden_software)#Using_Sentinel_Under_Wine&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Step 1: Connect the BCD436 to your Linux device by turning it on and selecting &amp;ldquo;Mass Storage Mode&amp;rdquo; (press the E/yes key). You&amp;rsquo;ll see it automount on Linux.&lt;/p&gt;
&lt;p&gt;Step 2: Start Sentinel by clicking on Activities in the upper left and typing bcd, then clicking on the icon:&lt;/p&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="Typing bcd in Activities"
width="395"
height="225"
src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/start-sentinel.png"
srcset="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/start-sentinel.png 800w, https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/start-sentinel.png 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/start-sentinel.png"&gt;&lt;/figure&gt;
&lt;p&gt;Step 3: Cancel out of the &amp;ldquo;Run updates&amp;rdquo; dialog. Instead, run &lt;code&gt;winecfg&lt;/code&gt; from the terminal.&lt;/p&gt;
&lt;p&gt;Step 4: In the dialog that comes up, click the Drives tab and then use cursor down to highlight the drive letter of the /media/ path that Ubuntu used when it automounted the drive.&lt;/p&gt;
&lt;p&gt;Step 5: Click &amp;ldquo;Show Advanced&amp;rdquo; and change the Type from &amp;ldquo;Autodetect&amp;rdquo; to &amp;ldquo;Floppy Disk&amp;rdquo;. Press &amp;ldquo;Apply&amp;rdquo; and then &amp;ldquo;OK&amp;rdquo;.&lt;/p&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="Selecting Floppy disk under the Type field of the Drives tab of the Wine Config dialog"
width="406"
height="482"
src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/winecfg.png"
srcset="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/winecfg.png 800w, https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/winecfg.png 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/winecfg.png"&gt;&lt;/figure&gt;
&lt;p&gt;Step 6: In Sentinel, Update -&amp;gt; Update Firmware&amp;hellip;&lt;/p&gt;
&lt;p&gt;If all went well, you should see:&lt;/p&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="The Sentinel utility with an option to mapped a microSD drive to a drive letter for the scanner"
width="450"
height="290"
src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/readfromscanner.png"
srcset="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/readfromscanner.png 800w, https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/readfromscanner.png 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/readfromscanner.png"&gt;&lt;/figure&gt;
&lt;p&gt;Step 7. Click OK. Your firmware just got updated.&lt;/p&gt;
&lt;p&gt;At this point you should be able to Update -&amp;gt; Update Master Database(HPDB). You can also make changes. Once you&amp;rsquo;ve made your changes, Scanner -&amp;gt; Write to Scanner&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; the Linux driver that talks to the scanner can be very slow when writing. You&amp;rsquo;ll have plenty of time to get a coffee, especially if you select &amp;ldquo;Force Write Full Database&amp;rdquo;. Just remember to come back in time to tell Sentinel how to handle conflicts.&lt;/p&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="A dialog box titled BCDx36HP Sentinel with the text &amp;ldquo;Finished writing to the scanner&amp;rdquo;"
width="519"
height="189"
src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/completed-1.png"
srcset="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/completed-1.png 800w, https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/completed-1.png 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/completed-1.png"&gt;&lt;/figure&gt;
&lt;p&gt;Step 8: When you&amp;rsquo;re done, shut down Sentinel and then unmount the device, then eject it:&lt;/p&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="The USB unmount/eject icon with Unmount selected"
width="198"
height="101"
src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/unmount.png"
srcset="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/unmount.png 800w, https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/unmount.png 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2024-01-15-setting-up-and-using-uniden-sentinel-bcdx36hp-on-ubuntu-22-04-under-wine/images/unmount.png"&gt;&lt;/figure&gt;
&lt;p&gt;Turn the radio off. Then unplug the cable. Congratulations, you&amp;rsquo;re done.&lt;/p&gt;</description></item><item><title>Stop "[Application]" Is Not Responding on Ubuntu 22.04/Gnome</title><link>https://andrewmemory.acornwall.net/blog/2023-10-28-stop-application-is-not-responding-on-ubuntu-22-04-gnome/</link><pubDate>Sat, 28 Oct 2023 14:17:41 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2023-10-28-stop-application-is-not-responding-on-ubuntu-22-04-gnome/</guid><description>&lt;p&gt;Since upgrading to Ubuntu 22.04, I&amp;rsquo;ve been seeing a lot more of those messages from Gnome that say:&lt;/p&gt;
&lt;p&gt;&amp;ldquo;&lt;/p&gt;
\[Some Application\]&lt;p&gt;&amp;rdquo; is not responding. You may choose to wait a short while for it to continue or force the application to quit entirely.&lt;/p&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="A dialog that reads &amp;ldquo;Thunderbird Mail&amp;rdquo; is not responding. You may choose to wait a short while for it to continue or force the application to quit entirely. There are two buttons, &amp;ldquo;Force Quit&amp;rdquo; and &amp;ldquo;Wait&amp;rdquo;"
width="494"
height="163"
src="https://andrewmemory.acornwall.net/blog/2023-10-28-stop-application-is-not-responding-on-ubuntu-22-04-gnome/images/not-responding.png"
srcset="https://andrewmemory.acornwall.net/blog/2023-10-28-stop-application-is-not-responding-on-ubuntu-22-04-gnome/images/not-responding.png 800w, https://andrewmemory.acornwall.net/blog/2023-10-28-stop-application-is-not-responding-on-ubuntu-22-04-gnome/images/not-responding.png 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2023-10-28-stop-application-is-not-responding-on-ubuntu-22-04-gnome/images/not-responding.png"&gt;&lt;/figure&gt;
&lt;p&gt;Probably Ubuntu 22.04 takes up more resources on my underpowered mini PC. This error pops up when an app is not responsive for more than 5 seconds.&lt;/p&gt;
&lt;p&gt;Luckily, that timeout is configurable. I&amp;rsquo;m not as impatient as the Gnome developers, so I adjusted mine to 15 seconds. In theory this gets stored so you don&amp;rsquo;t need to do anything to make it permanent:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ gsettings get org.gnome.mutter check-alive-timeout uint32 5000
$ gsettings set org.gnome.mutter check-alive-timeout 15000&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;You probably don&amp;rsquo;t want to set this much below 1000 or you&amp;rsquo;re going to be dealing with lots of dialogs that block the rest of the UI.&lt;/p&gt;</description></item><item><title>Ubuntu 22.04 logs not rotating</title><link>https://andrewmemory.acornwall.net/blog/2022-11-26-ubuntu-22-04-logs-not-rotating/</link><pubDate>Sat, 26 Nov 2022 15:56:40 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2022-11-26-ubuntu-22-04-logs-not-rotating/</guid><description>&lt;p&gt;I happened to look at my /var/log and discovered that it was completely full! How&amp;rsquo;d that happen?&lt;/p&gt;
&lt;p&gt;It looks as if 22.04 broke log rotation. So the log files just keep growing until they max out the device and then stop. Yay Ubuntu!&lt;/p&gt;
&lt;p&gt;I did a couple of things - first was to expand the size of my log device (I&amp;rsquo;m using log2ram)&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# sudo emacs /etc/log2ram.conf
SIZE=120M&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Next, change how much the journal keeps:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# sudo emacs /etc/systemd/jourlnald.conf
SystemMaxUse=40M&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Clear out the journal:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# sudo journalctl --vacuum-size 40M&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Then I went looking for the problem. Luckily, two other people had run into this and &lt;a href="https://askubuntu.com/questions/1429612/ubuntu-22-04-logrotate-not-working-after-upgrade-to-ubuntu-22-04/" target="_blank" rel="noreferrer"&gt;documented it on StackOverflow&lt;/a&gt;. I tried the same test:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# sudo logrotate /etc/logrotate.d/rsyslog --debug&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;and saw the same results:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;error: skipping &amp;#34;/var/log/syslog&amp;#34; because parent directory has insecure permissions (It&amp;#39;s world writable or writable by group which is not &amp;#34;root&amp;#34;)
Set &amp;#34;su&amp;#34; directive in config file to tell logrotate which user/group should be used for rotation.&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;And then made the same change to almost everything in /etc/logrotate.d (alternatives apport bootlog btmp dpkg log2ram ppp sane-utils ufw wtmp) and to each I added to the config file (before the monthly, weekly, daily - right at the top):&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# sudo emacs (one of the following: alternatives apport bootlog btmp dpkg log2ram ppp sane-utils ufw wtmp)
su syslog syslog&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Then make sure they all work:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo logrotate /etc/logrotate.d/alternatives --debug
sudo logrotate /etc/logrotate.d/apport --debug
sudo logrotate /etc/logrotate.d/bootlog --debug
sudo logrotate /etc/logrotate.d/btmp --debug
sudo logrotate /etc/logrotate.d/dpkg --debug
sudo logrotate /etc/logrotate.d/log2ram --debug
sudo logrotate /etc/logrotate.d/ppp --debug
sudo logrotate /etc/logrotate.d/sane-utils --debug
sudo logrotate /etc/logrotate.d/ufw --debug
sudo logrotate /etc/logrotate.d/wtmp --debug&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Finally, clear out all the emacs droppings because otherwise logrotate will still try to run them:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo rm /etc/logrotate.d/*~
sudo rm /etc/logrotate.d/\#*
sudo rm /etc/systemd/journald.conf~
sudo rm /etc/log2ram.conf~&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;And&amp;hellip; that&amp;rsquo;s it, I hope!&lt;/p&gt;</description></item><item><title>Merging multiple PDFs</title><link>https://andrewmemory.acornwall.net/blog/2022-07-24-merging-multiple-pdfs/</link><pubDate>Sun, 24 Jul 2022 17:25:34 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2022-07-24-merging-multiple-pdfs/</guid><description>&lt;p&gt;I&amp;rsquo;d recently downloaded a bunch of separate PDFs that I wanted to turn into a handy file that I could carry around. After grabbing the PDFs, I merged them with:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ pdfunite *.pdf really-big-output.pdf&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;PDFUnite is part of Poppler, so be sure to:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo apt install poppler-utils&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;&amp;hellip; if you don&amp;rsquo;t have it already. That&amp;rsquo;s it!&lt;/p&gt;</description></item><item><title>Building TQSL 2.6.4 for Ubuntu 20.04 (or TQSL 2.6.5 for Ubuntu 22.04)</title><link>https://andrewmemory.acornwall.net/blog/2022-06-26-building-tqsl-2-6-4-for-ubuntu-20-04/</link><pubDate>Sun, 26 Jun 2022 23:28:10 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2022-06-26-building-tqsl-2-6-4-for-ubuntu-20-04/</guid><description>&lt;p&gt;It&amp;rsquo;s the day after Field Day, and I&amp;rsquo;m too lazy to grab my old laptop that has TQSL and FLDigi on it to enter my logs. So I decided to install FLDigi and TQSL on my desktop machine instead.&lt;/p&gt;
&lt;p&gt;Bad news, though: Ubuntu has an outdated version of TQSL, and the ARRL doesn&amp;rsquo;t provide a package for Ubuntu. Boo. However, building it was pretty painless, with only a few attempts. The result:&lt;/p&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="A working TQSL"
width="572"
height="445"
src="https://andrewmemory.acornwall.net/blog/2022-06-26-building-tqsl-2-6-4-for-ubuntu-20-04/images/tqsl.png"
srcset="https://andrewmemory.acornwall.net/blog/2022-06-26-building-tqsl-2-6-4-for-ubuntu-20-04/images/tqsl.png 800w, https://andrewmemory.acornwall.net/blog/2022-06-26-building-tqsl-2-6-4-for-ubuntu-20-04/images/tqsl.png 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2022-06-26-building-tqsl-2-6-4-for-ubuntu-20-04/images/tqsl.png"&gt;&lt;/figure&gt;
&lt;p&gt;The machine I started with already had a basic development environment. But if yours doesn&amp;rsquo;t, you&amp;rsquo;ll probably need to grab a few things first:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo apt install make cmake gcc libappimage-dev&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Next you need to download the latest file from &lt;a href="http://www.arrl.org/tqsl-download" target="_blank" rel="noreferrer"&gt;arrl.org/tqsl-download&lt;/a&gt; and stash it somewhere on your filesystem. The day I tried it, the latest was tqsl-2.6.4.tar.gz. So&amp;hellip;&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ tar xzvf tqsl-2.6.4.tar.gz
$ cd tqsl-2.6.4&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I was happy to see a nice linux-make-appimage.sh script ready for consumption. If you look at the INSTALL file (which I didn&amp;rsquo;t) you&amp;rsquo;ll see you need to install a few prerequisites. I didn&amp;rsquo;t bother downloading them, but just used the ones that were already built for Ubuntu:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo apt-get install libssl-dev liblmdb-dev libdb-dev libexpat1-dev libcurl4-openssl-dev libwxgtk-media3.0-gtk3-dev libzlcore-dev
$ sh ./linux-make-appimage.sh&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;After a few false starts (yes, it clones the repo every time you try to build) I ended up with a pretty TQSL-x86_64.AppImage in my build directory. I wanted to run that from the command line, so I did the following:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo apt remove trustedqsl # need to make sure the old package isn&amp;#39;t there
$ sudo cp TQSL-x86_64.AppImage /usr/local/bin/TQSL_2.6.4-x86_64.AppImage
$ sudo chmod 555 /usr/local/bin/TQSL_2.6.4-x86_64.AppImage
$ sudo ln -s /usr/local/bin/TQSL_2.6.4-x86_64.AppImage /usr/local/bin/tqsl&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;That left me with a tqsl symbolic link pointing to /usr/local/bin/TQSL_2.6.4-x86_64.AppImage in /usr/local/bin (which is on my $PATH). That&amp;rsquo;s it!&lt;/p&gt;
&lt;p&gt;Oh yeah, after all that I ended up having to boot the old laptop anyway. I needed to extract my old TQSL config (exported to tqslconfig.tbk) in order to import it to this version. When importing the preferences I got an error message about an unknown token, but it worked anyway&amp;hellip; and I got the same message when importing into a Windows build that the ARRL created. Go figure.&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t need to re-import my certs - they were already there.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Changes for TQSL 2.6.5
&lt;div id="changes-for-tqsl-265" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#changes-for-tqsl-265" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Looks like they broke the AppImage build in TQSL 2.6.5. If I try it on Ubunutu 22.04, I get:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;ERROR: Icon entry missing in desktop file: AppDir/usr/share/applications/tqsl.desktop &lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;So instead of the &lt;code&gt;sh ./linux-make-appimage.sh&lt;/code&gt; above, I did the following:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ cd /wherever you put it/tqsl-2.6.5
$ cmake .
$ make&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;And then created a shell script &lt;code&gt;/usr/local/bin/tqsl&lt;/code&gt; to run tqsl from where I&amp;rsquo;d built it:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;#!/bin/bash -
cd /wherever you put it/tqsl-2.6.5/apps
./tqsl&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;You can&amp;rsquo;t just copy the binary because it needs some libraries that it builds as well. I tried &lt;code&gt;make install&lt;/code&gt; but that&amp;rsquo;s broken on Ubuntu 22.04 as well. Don&amp;rsquo;t forget:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo chmod 550 /usr/local/bin/tqsl&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;</description></item><item><title>Setting up NFS on Ubuntu 20.04</title><link>https://andrewmemory.acornwall.net/blog/2021-05-30-setting-up-nfs-on-ubuntu-20-04/</link><pubDate>Sun, 30 May 2021 14:11:18 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2021-05-30-setting-up-nfs-on-ubuntu-20-04/</guid><description>&lt;p&gt;I have been experiencing random weirdness with CIFS on Ubuntu 20.04. Every now and then the current working directory will disappear. I can usually get things back to normal by &amp;ldquo;cd ..; cd &lt;em&gt;myDir&lt;/em&gt;&amp;rdquo; but that&amp;rsquo;s a pain - more of a pain when a build has failed because the current directory evaporated on the Gradle script.&lt;/p&gt;
&lt;p&gt;So I decided to try NFS. Setting up NFS is not too hard. I found a &lt;a href="https://linuxconfig.org/how-to-configure-nfs-on-linux" target="_blank" rel="noreferrer"&gt;very useful page on LinuxConfig.org&lt;/a&gt; that got me 90% of the way there.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Server setup&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In short, on the server:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo apt install nfs-kernel-server
$ sudo systemctl enable --now nfs-server&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Then edit /etc/exports on the server to include the line:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;/myshareddisk 192.168.1.0/8(rw,sync,no_subtree_check)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;It looks as if there&amp;rsquo;s no easy way for NFS to handle DHCP unless the file server can look up the IP. Boo. Going onward and knowing my network is now less protected:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo exportfs -arv&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;At this point, the LinuxConfig.org instructions start pointing you to server configuration. However, there&amp;rsquo;s a vital step omitted - pretty much every sane app will fail with &amp;ldquo;no locks available.&amp;rdquo; Why? &lt;a href="https://askubuntu.com/questions/837962/nfs-error-no-locks-available-after-update-to-16-10" target="_blank" rel="noreferrer"&gt;StackExchange&lt;/a&gt; to the rescue. Enabling NFS doesn&amp;rsquo;t enable rpc-statd.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo systemctl enable rpc-statd
$ sudo systemctl start rpc-statd &lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;As the StackExchage article says, &amp;ldquo;Thanks, systemd!&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Client setup&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next you can set up the client:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo mount -t nfs4 my-server-fqdn:/myshareddisk /localmnt&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Hey, it mounted, and it looks like a file system. Now anyone on my network can mount my NFS server! Exposing it to ransomware and all sorts of excellent things like that. Err&amp;hellip; good?&lt;/p&gt;
&lt;p&gt;Last step is to make it automount on the client by editing /etc/fstab:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;my-server-fqdn:/myshareddisk /localmnt nfs4 defaults,user,exec 0 2&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I&amp;rsquo;m really unsure about this, and may need to undo it or at least find a way to stop it advertising to everyone. But it&amp;rsquo;s that way for now.&lt;/p&gt;</description></item><item><title>Mounting a partition from a raw disk image</title><link>https://andrewmemory.acornwall.net/blog/2020-11-28-mounting-a-partition-from-a-raw-disk-image/</link><pubDate>Sat, 28 Nov 2020 15:20:55 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2020-11-28-mounting-a-partition-from-a-raw-disk-image/</guid><description>&lt;p&gt;In the past I&amp;rsquo;d backed up an SD card with&lt;/p&gt;
&lt;p&gt;&lt;code&gt;dd if=/dev/sdc of=mydisk.img&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now I wanted to get something off of it. However, the SD card had two partitions on it. I wondered if there was a more elegant way to get data out than just writing it to another SD card. Turns out, there is! There&amp;rsquo;s a great post at &lt;a href="https://dustymabe.com/2012/12/15/mounting-a-partition-within-a-disk-image/" target="_blank" rel="noreferrer"&gt;dustymabe.com/2012/12/15/mounting-a-partition-within-a-disk-image&lt;/a&gt; that explains how to do it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo losetup -v -f mydisk.img sudo losetup -a&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This gives me the /dev/loop* device that my image is mounted as. In my case, it was /dev/loop18. Next, I could use partx to create loop devices for the partitions:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo partx -v --add /dev/loop18&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This created /dev/loop18p1 through /dev/loop18p(however many partitions I had). Once those partitions have been created, you can mount them like any other partition on a regular block device. Once you&amp;rsquo;re done,&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo partx -v --delete /dev/loop18&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;will get rid of both the device and its partitions.&lt;/p&gt;</description></item><item><title>Persistent serial ports on Ubuntu</title><link>https://andrewmemory.acornwall.net/blog/2020-06-30-persistent-serial-ports-on-ubuntu/</link><pubDate>Tue, 30 Jun 2020 01:12:11 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2020-06-30-persistent-serial-ports-on-ubuntu/</guid><description>&lt;p&gt;Last time I rebooted my file server (which has a couple of serial devices attached), it picked the wrong ones for /dev/ttyUSB0 and /dev/ttyUSB1. That meant the speeds (which I&amp;rsquo;d configured in minicomrc files) were wrong.&lt;/p&gt;
&lt;p&gt;I needed to make the serial ports persistent. Again with the udev rules!&lt;/p&gt;
&lt;p&gt;Luckily, there was a handy page at: &lt;a href="https://indilib.org/support/tutorials/157-persistent-serial-port-mapping.html" target="_blank" rel="noreferrer"&gt;indilib.org/support/tutorials/157-persistent-serial-port-mapping.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;with what I needed to know. I ended up adding two rules in /lib/udev/rules.d/99-serial-aliases.rules: &lt;code&gt;# portal SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;0403&amp;quot;, ATTRS{idProduct}==&amp;quot;6001&amp;quot;, ATTRS{serial}==&amp;quot;AM00NPHK&amp;quot;, MODE=&amp;quot;0666&amp;quot;, SYMLINK+=&amp;quot;ttyPortal&amp;quot; # wally SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;10c4&amp;quot;, ATTRS{idProduct}==&amp;quot;ea60&amp;quot;, ATTRS{serial}==&amp;quot;0130D901&amp;quot;, MODE=&amp;quot;0666&amp;quot;, SYMLINK+=&amp;quot;ttyWally&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I got these values by running lsusb -v (which in truth gives you everything you need to know) and: &lt;code&gt;udevadm info -a -n /dev/ttyUSB0 | grep serial | head -1&lt;/code&gt; and &lt;code&gt;udevadm info -a -n /dev/ttyUSB1 | grep serial | head -1&lt;/code&gt; on my two serial ports. (I could also grep idProduct and idVendor, but lsusb gave me the right ones already.)&lt;/p&gt;
&lt;p&gt;Then delete (sigh) /lib/udev/rules.d/99-serial-aliases.rules~ that Emacs left over. Cause it gets read if you don&amp;rsquo;t. Sigh. I always forget.&lt;/p&gt;
&lt;p&gt;After that a quick: &lt;code&gt;sudo udevadm control --reload-rules sudo udevadm trigger&lt;/code&gt; and I had my /dev/ttyPortal and /dev/ttyWally. Now to fix up those minicom configs&amp;hellip;&lt;/p&gt;</description></item><item><title>Fixing a busy CP210x serial device on Ubuntu</title><link>https://andrewmemory.acornwall.net/blog/2020-04-05-fixing-a-busy-cp210x-serial-device-on-ubuntu/</link><pubDate>Sun, 05 Apr 2020 21:04:06 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2020-04-05-fixing-a-busy-cp210x-serial-device-on-ubuntu/</guid><description>&lt;p&gt;I had the opportunity to reorganize my local machines. As part of that, I wanted to plug my firewall&amp;rsquo;s serial port into USB serial and pop that into my server. I have a &lt;a href="https://www.pcengines.ch/usbcom1a.htm" target="_blank" rel="noreferrer"&gt;CP2104 serial device&lt;/a&gt; that I bought with my &lt;a href="https://www.pcengines.ch/apu2.htm" target="_blank" rel="noreferrer"&gt;PC Engines apu2&lt;/a&gt; which I use for a firewall.&lt;/p&gt;
&lt;p&gt;The USB serial device worked fine when plugged into my Windows 8 laptop, but I want my server to be able to connect to my firewall even when the network is down. Because the apu2 is headless, it&amp;rsquo;s nice to have something that&amp;rsquo;s plugged into a monitor when I need to fix things.&lt;/p&gt;
&lt;p&gt;I plugged the USB serial port in, and tried to connect to my firewall with minicom. I got this instead:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ minicom
minicom: cannot open /dev/ttyUSB0: Device or resource busy&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;So, time to look at who has /dev/ttyUSB0 open:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo lsof | grep ttyUSB0
gpsd 416 root 3u CHR 188,0 0t0 176 /dev/ttyUSB0&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Ok, why is gpsd holding /dev/ttyUSB0 open? It&amp;rsquo;s true I have a GPS attached to my server, but that runs as /dev/ttyACM0 and has nothing to do with /dev/ttyUSB0. Hmm&amp;hellip; time to search and find this in the gpsd FAQ: &lt;a href="https://gpsd.gitlab.io/gpsd/faq.html#conflict" target="_blank" rel="noreferrer"&gt;Why does GPSD open non-GPS USB devices?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That made me suspicious. See, gpsd is trying to be too friendly - and to do that, it opens a whole bunch of possibly GPS devices even if they&amp;rsquo;re not GPS devices! Could that be my problem?&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 003: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 040: ID 1546:01a7 U-Blox AG
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Hmm&amp;hellip; let&amp;rsquo;s take a peek in /lib/udev/rules.d/60-gpsd.rules:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;... blah blah blah...
# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241 and Wintec grays2 wbt-201) [linux module: cp210x]
ATTRS{idVendor}==&amp;#34;10c4&amp;#34;, ATTRS{idProduct}==&amp;#34;ea60&amp;#34;, SYMLINK&amp;#43;=&amp;#34;gps%n&amp;#34;, TAG&amp;#43;=&amp;#34;systemd&amp;#34;, ENV{SYSTEMD_WANTS}=&amp;#34;gpsdctl@%k.service&amp;#34;
... more blah...&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;So in an effort to detect the Holux m241 and Wintec grays2 wbt-201, it&amp;rsquo;s matching the vendor and product ID of my CP2104 serial device as well! Luckily, I don&amp;rsquo;t have any of those GPS devices, so a quick snip:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241 and Wintec grays2 wbt-201) [linux module: cp210x]
# commented out because it interferes with Andrew&amp;#39;s PC Engines 2104 USB serial cable
#ATTRS{idVendor}==&amp;#34;10c4&amp;#34;, ATTRS{idProduct}==&amp;#34;ea60&amp;#34;, SYMLINK&amp;#43;=&amp;#34;gps%n&amp;#34;, TAG&amp;#43;=&amp;#34;systemd&amp;#34;, ENV{SYSTEMD_WANTS}=&amp;#34;gpsdctl@%k.service&amp;#34;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;was all it took. Now my USB serial device shows up as a serial device, and is not held open by a GPS daemon.&lt;/p&gt;
&lt;p&gt;I have to disagree with the GPSD FAQ&amp;rsquo;s statement, &amp;ldquo;It&amp;rsquo;s not a problem we can solve with clever programming, the devices simply don&amp;rsquo;t yield enough information about themselves to avoid conflicts.&amp;rdquo; Err, no&amp;hellip; clever programming would have the user run through an install procedure which involved plugging the device in, and detecting the device. Then they could update the udev rules so that only the device that a user owned was stolen by gpsd, and not all serial devices on the planet that happened to match a vendor/product ID that they knew about.&lt;/p&gt;</description></item><item><title>Programing with a PICkit 2 on Linux</title><link>https://andrewmemory.acornwall.net/blog/2020-01-08-programing-with-a-pickit-2-on-linux/</link><pubDate>Wed, 08 Jan 2020 23:17:28 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2020-01-08-programing-with-a-pickit-2-on-linux/</guid><description>&lt;p&gt;I recently bought a PICkit 2 clone (the &lt;a href="https://www.piccircuit.com/shop/pic-programmer/56-ica03-usb-pic-programmer-set.html" target="_blank" rel="noreferrer"&gt;ICA03&lt;/a&gt;) from PICCircuit.com. Programming it has been something of a challenge, mostly because Microchip no longer really supports Linux programming of PIC chips.&lt;/p&gt;
&lt;p&gt;First, I needed to get pk2cmd. There are lots of pointers to Microchip&amp;rsquo;s website, but all of them go to 404s. What I ended up using is a github repo: &lt;a href="https://github.com/psmay/pk2cmd" target="_blank" rel="noreferrer"&gt;https://github.com/psmay/pk2cmd&lt;/a&gt;. After reading the threatening license agreement, I cloned the repo and built it with make then sudo make install.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;git clone https://github.com/psmay/pk2cmd
cd pk2cmd/pk2cmd
make linux
sudo make install&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Even after installing PK2DeviceFile.dat in /usr/share and including /usr/share/pk2 on the path (ugh) per the instructions, I still wasn&amp;rsquo;t able to use it from anywhere except the directory I built it from. At some point I&amp;rsquo;ll need to look into that.&lt;/p&gt;
&lt;p&gt;I plugged the PIC into the ZIF socket with the marking near the top, and made sure the selection switch was on 28-40.&lt;/p&gt;
&lt;p&gt;Next, I took my .hex file and stuffed it in ~/pk2cmd/pk2cmd/. Then:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;~/pk2cmd/pk2cmd$ sudo pk2cmd -P
Auto-Detect: Found part PIC16F886.&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Yay! Let&amp;rsquo;s try writing the file:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;~/pk2cmd/pk2cmd$ sudo ./pk2cmd -PPIC16F886 \
-f my_hex_file.hex -MPC -Y&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;(I didn&amp;rsquo;t include IE on the -M switch because I think my hex file has ID and EEPROM memory in it. -Y does the verification.)&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;PICkit 2 Program Report
8-1-2020, 23:12:12
Device Type: PIC16F886
Program Succeeded.
PICkit 2 Verify Report
8-1-2020, 23:12:12
Device Type: PIC16F886
Verify Succeeded.
Operation Succeeded&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Yay!&lt;/p&gt;</description></item><item><title>Mapping a USB volume knob into a keyboard on Linux for SDR</title><link>https://andrewmemory.acornwall.net/blog/2019-12-16-mapping-a-usb-volume-knob-into-a-keyboard-on-linux-for-sdr/</link><pubDate>Mon, 16 Dec 2019 00:21:10 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2019-12-16-mapping-a-usb-volume-knob-into-a-keyboard-on-linux-for-sdr/</guid><description>&lt;p&gt;I recently discovered the existence of USB volume knobs. A Reddit user posted an &lt;a href="https://www.reddit.com/r/amateurradio/comments/e8v30z/en_subs_vfo_knob_for_sdrs_from_a_volume_control/" target="_blank" rel="noreferrer"&gt;article about reflashing the firmware&lt;/a&gt; on one to convert it to a keyboard.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="auto"
alt="IMG_20191216_010138"
width="400"
height="362"
src="https://andrewmemory.acornwall.net/blog/2019-12-16-mapping-a-usb-volume-knob-into-a-keyboard-on-linux-for-sdr/images/img_20191216_010138.jpg"
srcset="https://andrewmemory.acornwall.net/blog/2019-12-16-mapping-a-usb-volume-knob-into-a-keyboard-on-linux-for-sdr/images/img_20191216_010138.jpg 800w, https://andrewmemory.acornwall.net/blog/2019-12-16-mapping-a-usb-volume-knob-into-a-keyboard-on-linux-for-sdr/images/img_20191216_010138.jpg 1280w"
sizes="(min-width: 768px) 50vw, 65vw"
data-zoom-src="https://andrewmemory.acornwall.net/blog/2019-12-16-mapping-a-usb-volume-knob-into-a-keyboard-on-linux-for-sdr/images/img_20191216_010138.jpg"&gt;&lt;/figure&gt;
&lt;p&gt;Inspired, I picked one up for $18 on eBay (&amp;quot;&lt;a href="https://www.ebay.com/sch/i.html?_nkw=USB&amp;#43;Volume&amp;#43;Controller&amp;#43;Knob&amp;#43;Adjuster&amp;#43;Switcher&amp;#43;for&amp;#43;Tablet&amp;#43;PC&amp;#43;Speaker&amp;#43;Audio" target="_blank" rel="noreferrer"&gt;USB Volume Controller Knob Adjuster Switcher for Tablet PC Speaker Audio&lt;/a&gt;&amp;quot;) and thought that I might be able to do something similar.&lt;/p&gt;
&lt;p&gt;It turns out, under Linux, this is pretty easy.&lt;/p&gt;
&lt;p&gt;First, I plugged in the volume knob and saw that Linux detected it correctly and used it to adjust the volume. That was a promising start. I could see it show the &amp;ldquo;HDMI / DisplayPort&amp;rdquo; volume - and it went up when I turned the knob to the right, down when I turned the knob to the left, and muted when I pressed the knob.&lt;/p&gt;
&lt;p&gt;Next, I wanted to see what events were being generated. I found some very useful instructions at &lt;a href="https://yulistic.gitlab.io/2017/12/linux-keymapping-with-udev-hwdb/" target="_blank" rel="noreferrer"&gt;https://yulistic.gitlab.io/2017/12/linux-keymapping-with-udev-hwdb/&lt;/a&gt; and did them:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ cat /proc/bus/input/devices
...
I: Bus=0003 Vendor=0483 Product=572d Version=0111
N: Name=&amp;#34;STMicroelectronics USB Volume Control&amp;#34;
P: Phys=usb-0000:00:1d.0-1.7.2.4.3.1/input0
S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7.2/2-1.7.2.4/2-1.7.2.4.3/2-1.7.2.4.3.1/2-1.7.2.4.3.1:1.0/0003:0483:572D.0008/input/input14
U: Uniq=2070363C4250
H: Handlers=kbd event8
B: PROP=0
B: EV=13
B: KEY=3800000000 e000000000000 0
B: MSC=10
...&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;This showed me a few useful things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The device vendor for my device is 0483 (the &amp;ldquo;I:&amp;rdquo; line)&lt;/li&gt;
&lt;li&gt;The product ID for my device is 572d (also on the &amp;ldquo;I:&amp;rdquo; line)&lt;/li&gt;
&lt;li&gt;The device is attached on /dev/input/event8 (on the &amp;ldquo;H:&amp;rdquo; line)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So now I could scan the events that came across when I moved the knob:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo evtest /dev/input/event8
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x483 product 0x572d version 0x111
Input device name: &amp;#34;STMicroelectronics USB Volume Control&amp;#34;
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 113 (KEY_MUTE)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 163 (KEY_NEXTSONG)
Event code 164 (KEY_PLAYPAUSE)
Event code 165 (KEY_PREVIOUSSONG)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1576479720.245227, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9
Event: time 1576479720.245227, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1576479720.245227, -------------- SYN_REPORT ------------
Event: time 1576479720.253248, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9
Event: time 1576479720.253248, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1576479720.253248, -------------- SYN_REPORT ------------
Event: time 1576479722.325231, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00ea
Event: time 1576479722.325231, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1576479722.325231, -------------- SYN_REPORT ------------
Event: time 1576479722.333224, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00ea
Event: time 1576479722.333224, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1576479722.333224, -------------- SYN_REPORT ------------
Event: time 1576479724.381251, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e2
Event: time 1576479724.381251, type 1 (EV_KEY), code 113 (KEY_MUTE), value 1
Event: time 1576479724.381251, -------------- SYN_REPORT ------------
Event: time 1576479724.389251, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e2
Event: time 1576479724.389251, type 1 (EV_KEY), code 113 (KEY_MUTE), value 0
Event: time 1576479724.389251, -------------- SYN_REPORT ------------&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Neat, even more useful things. In particular:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When I turn the knob to the right, I get an MSC_SCAN event of type c00e9 (along with a KEY_VOLUMEUP event)&lt;/li&gt;
&lt;li&gt;When I turn the knob to the left, I get an MSC_SCAN event of type c00ea (along with a KEY_VOLUMEDOWN event)&lt;/li&gt;
&lt;li&gt;When I push on the knob, I get an MSC_SCAN event of type c00e2 (along with a KEY_MUTE event)&lt;/li&gt;
&lt;li&gt;Apparently the firmware supports KEY_NEXTSONG, KEY_PREVIOUSSONG and KEY_PLAYPAUSE as well. Huh.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I want to map those MSC_SCAN events to different key codes. In particular, I want a cursor-left key when I turn the knob to the left, a cursor-right key when I turn the knob to the right, and something useful (say, pressing the &amp;ldquo;m&amp;rdquo; key) when I press the knob. So I created a hwdb file for my device:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ cat /etc/udev/hwdb.d/99-usb-knob.hwdb
evdev:input:b*v0483p572D*
KEYBOARD_KEY_c00ea=left
KEYBOARD_KEY_c00e9=right
KEYBOARD_KEY_c00e2=m&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;You&amp;rsquo;ll recognize the vendor (0483) and the device (572d) that I found earlier. It&amp;rsquo;s important to use uppercase hex codes for vendor and product in the hwdb file - but &lt;em&gt;not&lt;/em&gt; for the scan codes, which should be lowercase. The values on the right have to be lowercase, and correspond to the KEY_LEFT, KEY_RIGHT and KEY_M values from &lt;a href="https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h" target="_blank" rel="noreferrer"&gt;/usr/include/linux/input-event-codes.h&lt;/a&gt;. (You can pick any of the KEY_ values from there.) Then a quick bit of Linux magic to update the hardware database:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo systemd-hwdb update
$ sudo udevadm trigger&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;&amp;hellip;and&amp;hellip; exactly the same as before. I got the volume control displayed when I turned the knob.&lt;/p&gt;
&lt;p&gt;After scratching my head and doing some searching, I happened on &lt;a href="https://catswhisker.xyz/log/2018/8/27/use_vecinfinity_usb_foot_pedal_as_a_keyboard_under_linux/" target="_blank" rel="noreferrer"&gt;https://catswhisker.xyz/log/2018/8/27/use_vecinfinity_usb_foot_pedal_as_a_keyboard_under_linux/&lt;/a&gt; which gave me the clue I needed. My knob was being detected, but not as a keyboard - so it wasn&amp;rsquo;t being used as a keyboard input device.&lt;/p&gt;
&lt;p&gt;So I created this file:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ cat /etc/udev/rules.d/99-usb-knob.rules
ACTION==&amp;#34;add|change&amp;#34;, KERNEL==&amp;#34;event[0-9]*&amp;#34;,
ATTRS{idVendor}==&amp;#34;0483&amp;#34;, ATTRS{idProduct}==&amp;#34;572d&amp;#34;,
ENV{ID_INPUT_KEYBOARD}=&amp;#34;1&amp;#34;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;(That&amp;rsquo;s all on one line on my machine.) You&amp;rsquo;ll recognize the vendor and product ID from earlier, using lowercase for the hex this time. I added ID_INPUT_KEYBOARD to the list of attributes for this device. Unplug the device, plug it back in, and hooray! I&amp;rsquo;m doing what I wanted to! When I turn the knob left, I go left. When I turn the knob right, I go right. When I press the knob, &amp;ldquo;m&amp;rdquo; shows up on the screen.&lt;/p&gt;
&lt;p&gt;Now I just need to install an SDR program&amp;hellip; and an SDR&amp;hellip;.&lt;/p&gt;</description></item><item><title>Finding out which disk is which on Ubuntu</title><link>https://andrewmemory.acornwall.net/blog/2019-06-09-finding-out-which-disk-is-which-on-ubuntu/</link><pubDate>Sun, 09 Jun 2019 00:44:05 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2019-06-09-finding-out-which-disk-is-which-on-ubuntu/</guid><description>&lt;p&gt;My file server often has various disks swapped in and out. It can get confusing which /dev/sd? corresponds to which drive. While reading the man page of findfs, I stumbled on this:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The complete overview about filesystems and partitions you can get for example by:&lt;br&gt;
  lsblk &amp;ndash;fs&lt;br&gt;
  partx &amp;ndash;show&lt;br&gt;
  blkid&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;These three things (along with judicious use of e2label and the other *label commands) is going to make my life a lot easier!&lt;/p&gt;</description></item><item><title>Fixing Brother printing on Ubuntu</title><link>https://andrewmemory.acornwall.net/blog/2019-03-15-fixing-brother-printing-on-ubuntu/</link><pubDate>Fri, 15 Mar 2019 18:14:10 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2019-03-15-fixing-brother-printing-on-ubuntu/</guid><description>&lt;p&gt;Since moving to Ubuntu 16.04.3, printing to my Brother MFC-J650DW printer has been broken. I can print fine, but it&amp;rsquo;s always offset by a bit, never where it should be on the page.&lt;/p&gt;
&lt;p&gt;Turns out this is &lt;a href="https://bugs.launchpad.net/ubuntu/&amp;#43;source/cups/&amp;#43;bug/1184663" target="_blank" rel="noreferrer"&gt;a bug&lt;/a&gt; and there&amp;rsquo;s &lt;a href="https://askubuntu.com/questions/284441/hl-2240-brother-not-printing-at-margins?rq=1" target="_blank" rel="noreferrer"&gt;a workaround&lt;/a&gt;. So I don&amp;rsquo;t forget next time I set up printers:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;lpadmin -p &amp;quot;Brother_MFC_J650DW&amp;quot; -o pdftops-renderer-default=pdftops&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Let me know (mail me) when there's an error</title><link>https://andrewmemory.acornwall.net/blog/2018-09-05-let-me-know-when-theres-an-error/</link><pubDate>Wed, 05 Sep 2018 23:42:04 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2018-09-05-let-me-know-when-theres-an-error/</guid><description>&lt;p&gt;I&amp;rsquo;ve got a shell script where I&amp;rsquo;d like to know when an error happens. Typically when that happens, something gets written to stdout or stderr - and I&amp;rsquo;d like to see that. But when things are just peachy, I don&amp;rsquo;t want to be bothered.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s an easy way to achieve that. At the beginning of my script, I have:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;WEATHEROUT=`/bin/mktemp`
WEATHERERR=`/bin/mktemp`&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;(Did I mention this is a script for a weather station? Yep.)&lt;/p&gt;
&lt;p&gt;Then in the body of the script, I have:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;/usr/local/bin/do-the-thing &amp;gt; ${WEATHEROUT} 2&amp;gt; ${WEATHERERR}
/usr/local/bin/do-the-other-thing &amp;gt;&amp;gt; ${WEATHEROUT} 2&amp;gt;&amp;gt; ${WEATHERERR}&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Finally, at the end of the script, there&amp;rsquo;s:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;if [ -s ${WEATHERERR} -o -s ${WEATHEROUT} ]; then
cat ${WEATHEROUT} ${WEATHERERR} | /usr/bin/mail -s &amp;#34;Weather command error&amp;#34; me@myaddr
fi&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;That&amp;rsquo;s all!&lt;/p&gt;</description></item><item><title>What's up with mod_security and User-Agent? (406 Not Acceptable)</title><link>https://andrewmemory.acornwall.net/blog/2018-05-01-whats-up-with-mod_security-and-user-agent-406-not-acceptable/</link><pubDate>Tue, 01 May 2018 21:25:32 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2018-05-01-whats-up-with-mod_security-and-user-agent-406-not-acceptable/</guid><description>&lt;p&gt;So&amp;hellip; what&amp;rsquo;s the deal with mod_security and User-Agent? I tried to browse to &lt;a href="http://handheldradio.net" target="_blank" rel="noreferrer"&gt;HandheldRadio.net&lt;/a&gt; using Lynx, and was greeted with this 406 error:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt; Not Acceptable
An appropriate representation of the requested resource / could not be
found on this server.
Additionally, a 406 Not Acceptable error was encountered while trying
to use an ErrorDocument to handle the request.&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;A few searches and I discovered this was due to Apache mod_security.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t get it. Why would you exclude based on User-Agent? That&amp;rsquo;s something that can be changed at will by any program that decides to be nefarious. This seems like security theatre rather than real security.&lt;/p&gt;
&lt;p&gt;Even in the &lt;a href="https://flameeyes.posts/2009/02/16/my-idea-works-filtering-by-user-agent-that-is/" target="_blank" rel="noreferrer"&gt;best case&lt;/a&gt;, this kind of &amp;ldquo;security&amp;rdquo; just turns into a red queen&amp;rsquo;s race to the bottom where everything will now lie about what it is because someone screwed up a config file somewhere.&lt;/p&gt;
&lt;p&gt;And so I&amp;rsquo;ve started lying (in my .bashrc):&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;alias lynx=&amp;#39;lynx -useragent=&amp;#34;Mozilla/5.0 (X11; Ubuntu Lynx; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0&amp;#34;&amp;#39;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Damn, that&amp;rsquo;s stupid.&lt;/p&gt;</description></item><item><title>Setting a user and group for Samba drives</title><link>https://andrewmemory.acornwall.net/blog/2018-04-14-setting-a-user-and-group-for-samba-drives/</link><pubDate>Sat, 14 Apr 2018 21:06:43 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2018-04-14-setting-a-user-and-group-for-samba-drives/</guid><description>&lt;p&gt;The last time I tried to set a user and password on my Samba drive, I ran into a strange problem: even though my credentials were correct, I was still using the user and group I was logged in as, rather than the one I&amp;rsquo;d stored with the Samba config.&lt;/p&gt;
&lt;p&gt;Luckily, these days there&amp;rsquo;s an easy way around it in /etc/fstab:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;//mysvr/music /music cifs uid=1000,gid=1000,credentials=/etc/samba/credentials/mysvr&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Simply adding the uid= and gid= lines fixed up the problem for me.&lt;/p&gt;</description></item><item><title>What the hell, Gnome? Canonical?</title><link>https://andrewmemory.acornwall.net/blog/2018-01-01-what-the-hell-gnome-canonical/</link><pubDate>Mon, 01 Jan 2018 23:00:29 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2018-01-01-what-the-hell-gnome-canonical/</guid><description>&lt;p&gt;Today when I started working on my desktop, I saw a crash in gom-media-tracker. What? Why is there a media tracker on my desktop?&lt;/p&gt;
&lt;p&gt;I learned this is part of Gnome (what? Why is there a media tracker in Gnome?) and it&amp;rsquo;s included in Ubuntu 16.04 LTS (why is Canonical including tracking software in Ubuntu?)&lt;/p&gt;
&lt;p&gt;Screw that. I removed it.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo apt remove gnome-online-miners
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
gnome-documents gnome-online-miners gnome-photos ubuntu-gnome-desktop
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 6,472 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: warning: files list file for package &amp;#39;fonts-gfs-complutum&amp;#39; missing; assuming package has no files currently installed
(Reading database ... 493027 files and directories currently installed.)
Removing ubuntu-gnome-desktop (0.58.3) ...
Removing gnome-documents (3.18.3-0ubuntu0.16.04.1) ...
Removing gnome-photos (3.18.2-1) ...
Removing gnome-online-miners (3.14.3-1ubuntu2) ...
Processing triggers for libglib2.0-0:amd64 (2.48.2-0ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0&amp;#43;16.04.20160824-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...
$ &lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Now that I&amp;rsquo;ve done that, I don&amp;rsquo;t appear to have lost anything I use. (Why is an optional packages forcing other packages out?)&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t want random tracking software on my machine.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://wiki.gnome.org/Projects/Tracker" target="_blank" rel="noreferrer"&gt;wiki.gnome.org/Projects/Tracker&lt;/a&gt;, you suck. Gnome, you suck. Canonical, you suck.&lt;/p&gt;</description></item><item><title>Upgrading Mythbuntu from Trusty to Xenial</title><link>https://andrewmemory.acornwall.net/blog/2017-06-25-upgrading-mythbuntu-from-trusty-to-xenial/</link><pubDate>Sun, 25 Jun 2017 16:35:29 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2017-06-25-upgrading-mythbuntu-from-trusty-to-xenial/</guid><description>&lt;p&gt;Yesterday I took the plunge and upgraded my Mythbuntu install from Trusty to Xenial. Except for a few heart-stopping moments, it went smoothly.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Things I wish I&amp;rsquo;d known about the upgrade
&lt;div id="things-i-wish-id-known-about-the-upgrade" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#things-i-wish-id-known-about-the-upgrade" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;There&amp;rsquo;s a bug with upgrading MySQL when you have the Mythbuntu tweaks installed. As a result, the upgrade fails to install MySQL properly - and then everything looks broken. Ouch. &lt;a href="https://bugs.launchpad.net/ubuntu/&amp;#43;source/mythbuntu-common/&amp;#43;bug/1576767" target="_blank" rel="noreferrer"&gt;You can find out more about the defect here&lt;/a&gt;. The symptom is the message &amp;ldquo;\[ERROR\] unknown variable &amp;rsquo;table_cache=128&amp;rsquo; &amp;quot; which scrolls off the screen when you do an upgrade (or dpkg &amp;ndash;configure -a). The fix is to change&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;table_cache = 128&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;table_open_cache = 128&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;in /etc/mysql/conf.d/mythtv-tweaks.cnf.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;During the upgrade, I got prompted for which user to use for the database. (With the recommendation to use &amp;ldquo;root&amp;rdquo; if you don&amp;rsquo;t thoroughly understand the permissions models.) But of course &amp;ldquo;root&amp;rdquo; didn&amp;rsquo;t work. What did work was the default, debian-sys-maint.&lt;/li&gt;
&lt;li&gt;After install, lirc didn&amp;rsquo;t work. I uninstalled lirc using Mythbuntu Control Center and rebooted; that appeared to fix things and now my Streamzap remote is being detected as a keyboard device with the appropriate mappings. (I get a warning about a plugin using MCC, but hey, it seems to work.)&lt;/li&gt;
&lt;li&gt;Next, I got warnings using apt. Probably due to the upgrade failure, I had a file called 50unattended-upgrades.ucf-old left over in /etc/apt/apt.conf.d. Nuking that fixed things.&lt;/li&gt;
&lt;li&gt;It looks as if mythfrontend and mythbackend are using different users now. I&amp;rsquo;m not sure why, but some day I&amp;rsquo;ll need to go through and fix permissions / unify those two users.&lt;/li&gt;
&lt;li&gt;I had to go into mythtv-setup and assign directories for music and music art. (Since I didn&amp;rsquo;t have an art directory, I created one under my music directory. That seems to work.)&lt;/li&gt;
&lt;li&gt;Probably as a result of the botched upgrade, mythweb was broken. I installed php7.0-mysql, then removed/installed mythweb and it was working again.&lt;/li&gt;
&lt;li&gt;Finally, I tried to look into mythconverg. In this release the admin user is debian-sys-maint, and the password for that user is stored in /etc/mysql/debian.cnf.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Ubuntu 16.04.1 - cron mail not working</title><link>https://andrewmemory.acornwall.net/blog/2016-09-19-ubuntu-16-04-1-cron-mail-not-working/</link><pubDate>Mon, 19 Sep 2016 00:08:08 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2016-09-19-ubuntu-16-04-1-cron-mail-not-working/</guid><description>&lt;p&gt;I recently ran into a strange issue. I wasn&amp;rsquo;t getting mail from cron - even though I could mail myself locally without incident. My cron daemon was running fine, and I had MAILTO=user specified in the crontab.&lt;/p&gt;
&lt;p&gt;The first piece of advice everyone says when you search about this is &amp;ldquo;make sure you can send mail to yourself.&amp;rdquo; And I could - using mail or mailx and sending to andrew. And if you try searching for help after that, you get lost in the weeds of people trying to send mail to Gmail, and setting up postfix, and going insane.&lt;/p&gt;
&lt;p&gt;After a little poking around, I noticed this in my /var/log/mail.log:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;Sep 12 04:28:01 myserver postfix/qmgr[2902]: A292710059B:
from=&amp;lt;root@myserver.mydomain.com&amp;gt;, size=800, nrcpt=1 (queue active)
Sep 12 04:28:01 myserver postfix/error[20839]: A292710059B:
to=&amp;lt;andrew@myserver.mydomain.com&amp;gt;, orig_to=&amp;lt;andrew&amp;gt;, relay=none, delay=1.4,
delays=1/0.12/0/0.25, dsn=5.0.0, status=bounced (myserver.mydomain.com)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I&amp;rsquo;ve been faking my domain name and it looks like when I upgraded to Ubuntu 16.04.1 things stopped working. (I have a sneaking suspicion that the upgrade process yanked the domain address out of /etc/hosts. But maybe cron changed and started using my FQDN instead of my local mail address.)&lt;/p&gt;
&lt;p&gt;But even after changing my hosts file from:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;127.0.1.1 myserver&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;to:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;127.0.1.1 myserver myserver.mydomain.com&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;things weren&amp;rsquo;t mailing again. I finally changed my crontab to MAILTO=andrew@localhost instead. But that seems kind of bogus. If you&amp;rsquo;ve got better ideas (/etc/mailname maybe?) let me know.&lt;/p&gt;</description></item><item><title>Formatting an SD card as exfat</title><link>https://andrewmemory.acornwall.net/blog/2015-12-17-formatting-an-sd-card-as-exfat/</link><pubDate>Thu, 17 Dec 2015 22:32:07 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2015-12-17-formatting-an-sd-card-as-exfat/</guid><description>&lt;p&gt;On Android, by default SD cards with 64M or more on them are formatted as exfat, while smaller cards are formatted as fat32. But what if you want to force an SD card to be exfat? Here&amp;rsquo;s how to do it. You&amp;rsquo;ll need a Linux box.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;sudo apt-get install fuse-exfat exfat-utils&lt;/li&gt;
&lt;li&gt;Partition the card if it&amp;rsquo;s not already partitioned&lt;/li&gt;
&lt;li&gt;sudo mkfs -texfat /dev/sdf1&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Mostly this post is to remind me that the new format is called exfat, since I keep forgetting that.&lt;/p&gt;</description></item><item><title>Rescuing a hard drive with ddrescue</title><link>https://andrewmemory.acornwall.net/blog/2015-11-05-rescuing-a-hard-drive-with-ddrescue/</link><pubDate>Thu, 05 Nov 2015 23:13:45 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2015-11-05-rescuing-a-hard-drive-with-ddrescue/</guid><description>&lt;p&gt;A while ago, one of my Windows hard drives gave up the ghost. Unfortunately, the last backup I&amp;rsquo;d done on it was a while ago. Lesson #1: Don&amp;rsquo;t forget to back things up.&lt;/p&gt;
&lt;p&gt;The hard drive had been staring at me on my desk for a while, so I decided to see what I could do about it. My searches led me to CGSecurity and two pages on their website: &lt;a href="http://www.cgsecurity.org/wiki/TestDisk" target="_blank" rel="noreferrer"&gt;TestDisk&lt;/a&gt; and the &lt;a href="http://www.cgsecurity.org/wiki/Damaged_Hard_Disk" target="_blank" rel="noreferrer"&gt;Damaged Hard Disk&lt;/a&gt; page. They in turn led me to &lt;a href="https://www.gnu.org/software/ddrescue/" target="_blank" rel="noreferrer"&gt;ddrescue&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s what I&amp;rsquo;ve done so far:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Have a nice server that has a motherboard advanced enough to hot-mount SATA drives. This is very useful if the disk disappears now and then and needs to be remounted.&lt;/li&gt;
&lt;li&gt;Mount the drive in a spare slot in the server.&lt;/li&gt;
&lt;li&gt;sudo apt-get install lzip because ddrescue is stored in lzip archives&lt;/li&gt;
&lt;li&gt;Grab the latest stable build from the &lt;a href="http://ftpmirror.gnu.org/ddrescue/" target="_blank" rel="noreferrer"&gt;ddrescue download directory&lt;/a&gt;. (I used version 1.20.)&lt;/li&gt;
&lt;li&gt;lzip -d then extract the ddrescue tar file.&lt;/li&gt;
&lt;li&gt;cd into the ddrescue directory and configure; make&lt;/li&gt;
&lt;li&gt;Next I tried plain ddrescue: sudo ./ddrescue -n /dev/sde /data/sde_rescue sde_map&lt;/li&gt;
&lt;li&gt;That seemed to be having trouble, so I reversed direction: sudo ./ddrescue -n -R /dev/sde /data/sde_rescue sde_map&lt;/li&gt;
&lt;li&gt;That whirred for a few days. Next I decided to try mounting as a raw device, on the theory that the kernel cache might be obscuring things.&lt;/li&gt;
&lt;li&gt;sudo /sbin/modprobe raw&lt;/li&gt;
&lt;li&gt;sudo raw /dev/raw/raw1 /dev/sde&lt;/li&gt;
&lt;li&gt;sudo ./ddrescue -n -R /dev/raw/raw1 /data/sde_rescue sde_map&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So far I&amp;rsquo;ve theoretically recovered 130M of my 500M disk. When reading the raw device, I don&amp;rsquo;t get an estimate of time remaining (which was about a year). It will be interesting to see if this actually gets recovered, or if I&amp;rsquo;m just grabbing random numbers at this point.&lt;/p&gt;</description></item><item><title>Changing user and group ID on Unix</title><link>https://andrewmemory.acornwall.net/blog/2015-05-02-changing-user-and-group-id-on-unix/</link><pubDate>Sat, 02 May 2015 21:05:32 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2015-05-02-changing-user-and-group-id-on-unix/</guid><description>&lt;p&gt;Recently I&amp;rsquo;ve set up a file server for both Windows and Linux. When I went to mount the file system on Linux, things were broken - because I hadn&amp;rsquo;t paid attention to user ID and group ID when I created users on my different Unix machines.&lt;/p&gt;
&lt;p&gt;So I needed to change the UID and GID of a user, then update the files. Luckily, someone had already done the work:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://muffinresearch.co.uk/linux-changing-uids-and-gids-for-user/" target="_blank" rel="noreferrer"&gt;https://muffinresearch.co.uk/linux-changing-uids-and-gids-for-user/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In short:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;usermod -u &amp;lt;NEWUID&amp;gt; &amp;lt;LOGIN&amp;gt;    
groupmod -g &amp;lt;NEWGID&amp;gt; &amp;lt;GROUP&amp;gt;
find / -user &amp;lt;OLDUID&amp;gt; -exec chown -h &amp;lt;NEWUID&amp;gt; {} \;
find / -group &amp;lt;OLDGID&amp;gt; -exec chgrp -h &amp;lt;NEWGID&amp;gt; {} \;
usermod -g &amp;lt;NEWGID&amp;gt; &amp;lt;LOGIN&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;One wrinkle that I wasn&amp;rsquo;t expecting: you can&amp;rsquo;t change the user ID of a user who has a running process. So I had to create a second user with adduser, add that user as in /etc/groups for sudo, log in as that user, and then change the user ID of the original user.&lt;/p&gt;
&lt;p&gt;When I ran this on Ubuntu and Raspbian, I saw about 4 errors in /proc which I ignored. There&amp;rsquo;s probably a faster way to do to this using xargs rather than running -exec each time, but I was a little worried I might exceed what I could pass in on a command line (I had hundreds of thousands of files) so I let it do its thing.&lt;/p&gt;</description></item><item><title>Samba - let Windows execute even if execute bit not set</title><link>https://andrewmemory.acornwall.net/blog/2015-04-23-samba-let-windows-execute-even-if-execute-bit-not-set/</link><pubDate>Thu, 23 Apr 2015 23:24:54 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2015-04-23-samba-let-windows-execute-even-if-execute-bit-not-set/</guid><description>&lt;p&gt;I&amp;rsquo;ve set up Samba once again, and it&amp;rsquo;s still not easy, especially with Cygwin in the mix. I still haven&amp;rsquo;t figured out Cygwin, but I did get the magic phrase that lets Windows machines run exe files without having to set the execute bit.&lt;/p&gt;
&lt;p&gt;This is an option that&amp;rsquo;s not documented in the /etc/samba/smb.conf file, but that&amp;rsquo;s where it goes: &lt;code&gt;# Allow Windows machines to execute things that don't have # the execute bit set acl allow execute always = True&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href="https://forge.univention.org/bugzilla/show_bug.cgi?id=33785" target="_blank" rel="noreferrer"&gt;forge.univention.org/bugzilla/show_bug.cgi?id=33785&lt;/a&gt; for the info!&lt;/p&gt;</description></item><item><title>Setting up a WD Red drive for use in a NAS</title><link>https://andrewmemory.acornwall.net/blog/2015-04-12-setting-up-a-wd-red-drive-for-use-in-a-nas/</link><pubDate>Sun, 12 Apr 2015 13:56:55 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2015-04-12-setting-up-a-wd-red-drive-for-use-in-a-nas/</guid><description>&lt;p&gt;It&amp;rsquo;s in bits and pieces all over the net, but I haven&amp;rsquo;t seen it all in one place yet. Western Digital Red drives have 4k (4096 byte) sectors rather than the old 512 byte sectors. In order to use them optimally, you need to format them aligned on those sectors.&lt;/p&gt;
&lt;p&gt;The first trick is to use parted rather than fdisk/cfdisk to define the partitions, and parted version 2.2 or higher, as described on this &lt;a href="https://wdc.custhelp.com/app/answers/detail/a_id/5655/~/how-to-install-a-wd-advanced-format-drive-on-a-non-windows-operating-system" target="_blank" rel="noreferrer"&gt;Western Digital support article&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Next, you need to decide what your partition table should look like. For maximum compatibility, use msdos. But if you have drives larger than 2G, you will probably want to use gpt instead.&lt;/p&gt;
&lt;p&gt;Assuming you&amp;rsquo;re using /dev/sdd as your drive:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# parted -a optimal /dev/sdd
(parted) mklabel msdos
(parted) q&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Next, you will want to add the partition. In my case, I wanted to create an ext4 partition that took up the whole disk. Here&amp;rsquo;s how:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# parted -a optimal /dev/sdd
(parted) mkpart primary ext4 0% 100%
(parted) p
Model: ATA WDC WD20EFRX-68A (scsi)
Disk /dev/sdd: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Number  Start   End     Size    Type     File system  Flags
 1      1049kB  2000GB  2000GB  primary  ext3
(parted) q&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;The -a optimal is the magic bit that tells parted to partition on 4k boundaries for a 4k drive. My ext4 partition actually got created as an ext3 partition, since those are the same partition type.&lt;/p&gt;
&lt;p&gt;Then you need to create a file system on the partition you just created. I add a label afterwards so I can mount it via label in /etc/fstab. (There&amp;rsquo;s a way to add a label in the mkfs command, but I can never remember it, so I do it in two steps.)&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# mkfs -t ext4 /dev/sdd1
# e2label /dev/sdd1 mynewdrive&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Then edit /etc/fstab to add the new drive to it:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;LABEL=mynewdrive /newdrivemountpoint ext4 defaults 0 2&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;The label matches the label I specified on e2label, and the /newdrivemountpoint is the directory in the Unix file system that I want the drive to be mounted on. The last two numbers say &amp;ldquo;don&amp;rsquo;t dump&amp;rdquo; (0) and &amp;ldquo;do fsck after the root drive&amp;rdquo; (2). See the man page or the &lt;a href="https://help.ubuntu.com/community/Fstab" target="_blank" rel="noreferrer"&gt;Ubuntu fstab page&lt;/a&gt; for more details on that.&lt;/p&gt;</description></item><item><title>Signal out of range on Soyo Topaz S</title><link>https://andrewmemory.acornwall.net/blog/2014-11-25-signal-out-of-range-on-soyo-topaz-s/</link><pubDate>Tue, 25 Nov 2014 00:01:51 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2014-11-25-signal-out-of-range-on-soyo-topaz-s/</guid><description>&lt;p&gt;I recently upgraded my monitor from an old Sharp 12&amp;quot; to a Soyo Topaz S. Things seemed to be going well with the new monitor until I rebooted my Ubuntu Server (which was on 12.04 LTS). When I did that, I got the message &amp;ldquo;Signal Out of Range&amp;rdquo; from the monitor, and I couldn&amp;rsquo;t see what was being displayed.&lt;/p&gt;
&lt;p&gt;According to a number of sources, this was because my monitor was being detected incorrectly and choosing the wrong resolution or colour depth. Lots of articles explained that you can change the mode in the config file /etc/default/grub.&lt;/p&gt;
&lt;p&gt;To start with, I booted &lt;a href="http://www.sysresccd.org/" title="SystemRescueCD homepage" target="_blank" rel="noreferrer"&gt;SysRescCD&lt;/a&gt; with the option &lt;a href="https://www.gnu.org/software/grub/manual/html_node/gfxpayload.html#gfxpayload" title="gfxpayload page from grub" target="_blank" rel="noreferrer"&gt;gfxpayload=640x480&lt;/a&gt;. This got me to the point where I could see the file system, do an fsck (I&amp;rsquo;d gone 327 days without one) and mount my root drive in /mnt.&lt;/p&gt;
&lt;p&gt;Naturally, when I did that, I discovered the file /mnt/etc/default/grub didn&amp;rsquo;t exist. That&amp;rsquo;s because I had upgraded originally from 8.04 LTS and that had never upgraded my grub to grub2.&lt;/p&gt;
&lt;p&gt;But at least now I could ssh into my server again. I updated, then upgraded to 14.04.1 LTS because hey, the server needed it anyway. Immediately after doing that, I saw an error with every command, &amp;ldquo;no talloc stackframe at ../source3/param/loadparm.c, leaking memory&amp;rdquo;. The quick fix for that (as described in &lt;a href="http://ubuntuforums.org/showthread.php?t=2214042" title="forum thread" target="_blank" rel="noreferrer"&gt;this ubuntuforums thread&lt;/a&gt;) was to run pam-auth-update and remove &amp;ldquo;SMB password synchronization&amp;rdquo;. As far as I can tell, that hasn&amp;rsquo;t changed anything with respect to what passwords are used for my shares.&lt;/p&gt;
&lt;p&gt;Then I followed the &lt;a href="https://help.ubuntu.com/community/Grub2/Upgrading" title="upgrading grub instructions" target="_blank" rel="noreferrer"&gt;instructions to upgrade from grub to grub2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After that, I still couldn&amp;rsquo;t see my screen when I booted&amp;hellip; but I had an /etc/default/grub. So I edited it, uncommented the line:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;GRUB_GFXMODE=640x480&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;and had a booting system again. Yay! Eventually I figured out that I could go up to 1024x768 with no problems.&lt;/p&gt;
&lt;p&gt;After that I realized I couldn&amp;rsquo;t do anything with the grub menu. I booted into the system, but couldn&amp;rsquo;t choose the OS to load with my USB keyboard.&lt;/p&gt;
&lt;p&gt;So the next time I booted, I had to switch &amp;ldquo;USB Keyboard Support&amp;rdquo; in my BIOS from &amp;ldquo;OS&amp;rdquo; to &amp;ldquo;BIOS&amp;rdquo;. That fixed the grub menu problem.&lt;/p&gt;</description></item><item><title>Upgrading Mythbuntu from Lucid to Precise</title><link>https://andrewmemory.acornwall.net/blog/2013-09-22-upgrading-mythbuntu-from-lucid-to-precise/</link><pubDate>Sun, 22 Sep 2013 00:30:28 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2013-09-22-upgrading-mythbuntu-from-lucid-to-precise/</guid><description>&lt;p&gt;Recently I decided to finally take the plunge and upgrade my Mythbuntu installation from Lucid (10.04) to Precise (12.04). I&amp;rsquo;d been getting prompts to do the release upgrade for a while, and I knew if I put it off too long then the upgrade path would disappear and I&amp;rsquo;d have to do a full reinstall.&lt;/p&gt;
&lt;p&gt;The upgrade process was mostly painless. I did: &lt;code&gt;sudo do-release-upgrade&lt;/code&gt; and walked away for quite a while. I had to kill X, and while churning the upgrade noticed that I&amp;rsquo;d modified /etc/sysctl.conf for the HDHomeRun: &lt;code&gt;net.core.rmem_max=2097152&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The big issue was lirc - the StreamZap remote has been turned into a devinput device by default, meaning it behaves like a keyboard. I decided that I would rather have the old lircd behaviour where different apps could have different keys. Here&amp;rsquo;s what I had to do:&lt;/p&gt;
&lt;p&gt;1. Add a file /usr/share/X11/xorg.conf.d/90-streamzap.conf with the following contents: &lt;code&gt;Section &amp;quot;InputClass&amp;quot;  Identifier &amp;quot;Ignore Streamzap IR&amp;quot;  MatchProduct &amp;quot;Streamzap&amp;quot;  MatchIsKeyboard &amp;quot;true&amp;quot;  Option &amp;quot;Ignore&amp;quot; &amp;quot;true&amp;quot; EndSection&lt;/code&gt; This tells X not to treat the StreamZap remote as a keyboard. That means lirc has a shot at getting the keystrokes, and means that only one keystroke will be generated (rather than 2 - one from lirc and one from the devinput driver).&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t do this first, which led me to problems. (I ended up pushing the Mute button, which muted a bunch of my audio devices which I then had to undo.)&lt;/p&gt;
&lt;p&gt;2. sudo dpkg-reconfigure lirc&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not sure how often I did this (I did it more than once). I also made sure to select the Streamzap remote in the Mythbuntu Control Centre. At the end, here&amp;rsquo;s what my /etc/lirc/lircd.conf looked like:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;#This configuration has been automatically generated via
#the Ubuntu LIRC package maintainer scripts.
#
#It includes the default configuration for the remote and/or
#transmitter that you have selected during package installation.
#
#Feel free to add any custom remotes to the configuration
#via additional include directives or below the existing
#Ubuntu include directives from your selected remote and/or
#transmitter.
#Configuration for the Streamzap PC Remote remote:
include &amp;#34;/usr/share/lirc/remotes/streamzap/lircd.conf.streamzap&amp;#34;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Here&amp;rsquo;s what the first stanza of my /etc/lirc/hardware.conf looked like:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE=&amp;#34;Streamzap PC Remote&amp;#34;
REMOTE_MODULES=&amp;#34;lirc_dev streamzap&amp;#34;
REMOTE_DRIVER=&amp;#34;&amp;#34;
REMOTE_DEVICE=&amp;#34;/dev/lirc0&amp;#34;
REMOTE_SOCKET=&amp;#34;&amp;#34;
REMOTE_LIRCD_CONF=&amp;#34;streamzap/lircd.conf.streamzap&amp;#34;
REMOTE_LIRCD_ARGS=&amp;#34;&amp;#34;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;3. Save your existing ~/.lirc/mythtv files, and any others you don&amp;rsquo;t want to lose. (I didn&amp;rsquo;t do this, and regretted it later.)&lt;/p&gt;
&lt;p&gt;4. Run the following two lines:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;mythbuntu-lirc-generator
mythbuntu-lircrc-generator&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;This nukes your exsisting ~/.lirc/mythtv (and ~/.lircrc) and creates new ones based on Mythbuntu defaults.&lt;/p&gt;
&lt;p&gt;5. My mythtv file in the end (after putting my modifications back) looked like this:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# LIRCRC Auto Generated by Mythbuntu Lirc Generator
# Author(s): Mario Limonciello, Nick Fox, John Baab
# Created for use with Mythbuntu
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_0
config = 0
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_1
config = 1
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_2
config = 2
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_3
config = 3
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_4
config = 4
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_5
config = 5
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_6
config = 6
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_7
config = 7
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_8
config = 8
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_9
config = 9
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_MUTE
config = |
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_CHANNELUP
config = Up
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_VOLUMEUP
config = ]
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_CHANNELDOWN
config = Down
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_VOLUMEDOWN
config = [
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_UP
config = Up
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_LEFT
config = Left
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_OK
config = Return
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_RIGHT
config = Right
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_DOWN
config = Down
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_MENU
config = M
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_EXIT
config = Escape
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_PLAY
config = P
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_PAUSE
config = P
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_STOP
config = Escape
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_PREVIOUS
config = Q
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_NEXT
config = Z
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_RECORD
config = R
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_REWIND
config = PgUp
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_FORWARD
config = PgDown
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_POWER
config = Escape
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_BLUE
config = I
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_RED
config = D
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_YELLOW
config = A
repeat = 0
delay = 0
end
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_GREEN
config = W
repeat = 0
delay = 0
end&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I&amp;rsquo;ve got the blue button pushing I (for info), the red button pushing D (for delete), the green button pushing W (for width) and the yellow button pushing A (for playback speed).&lt;/p&gt;
&lt;p&gt;I also set the power button to be another Escape, and Forward to PgDown and Backwards to PgUp.&lt;/p&gt;
&lt;p&gt;You want to make sure the remote = Streamzap_PC_Remote, not the devinput remote.&lt;/p&gt;
&lt;p&gt;Edit: Ha, I spoke too soon. I&amp;rsquo;m troubled by endless &amp;ldquo;Sorry, Ubuntu 12.04 has experienced an internal error&amp;rdquo; passwords. Luckily, &lt;a href="http://www.webupd8.org/2012/06/how-to-get-rid-of-internal-system-error.html" target="_blank" rel="noreferrer"&gt;this post&lt;/a&gt; explains how to at least turn them off, if not fix the problems.&lt;/p&gt;</description></item><item><title>Connecting to HSMM-Mesh and the Internet from a laptop</title><link>https://andrewmemory.acornwall.net/blog/2013-08-03-connecting-to-hsmm-mesh-and-the-internet/</link><pubDate>Sat, 03 Aug 2013 17:39:03 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2013-08-03-connecting-to-hsmm-mesh-and-the-internet/</guid><description>&lt;p&gt;Note: This page does not discuss connecting HSMM mesh to the Internet. It&amp;rsquo;s just about talking to the mesh and the Internet from the same client device.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve been playing with &lt;a href="http://hsmm-mesh.org" target="_blank" rel="noreferrer"&gt;hsmm-mesh&lt;/a&gt; lately on my laptop. Up until now, when I&amp;rsquo;ve done this I could either view the HSMM mesh or the Internet, but not both. There were a couple of reasons:&lt;/p&gt;
&lt;p&gt;1. My routing tables didn&amp;rsquo;t know how to direct traffic to the HSMM mesh network.&lt;/p&gt;
&lt;p&gt;To solve this, I needed to tell the laptop to send traffic in the 10.*.*.* range to the HSMM mesh rather than to the default gateway:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;ip route add 10.0.0.0/8 via 172.27.0.1 dev eth0&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;2. I had to make sure things were resolving right for DNS (in my /etc/resolv.conf):&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;domain austin.tx.us.mesh
search austin.tx.us.mesh
nameserver 172.27.0.1
nameserver 192.168.1.1&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;DNS is still a bit of an issue. 172.27.0.1 resolves anything in *.austin.tx.us.mesh, so my local network is never found. But at least I can browse the web and HSMM.&lt;/p&gt;</description></item><item><title>Ubuntu number key weirdness</title><link>https://andrewmemory.acornwall.net/blog/2011-06-30-ubuntu-number-key-weirdness/</link><pubDate>Thu, 30 Jun 2011 21:54:43 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2011-06-30-ubuntu-number-key-weirdness/</guid><description>&lt;p&gt;My Ubuntu 10.04 install was behaving weirdly when I used the numeric keypad. The keys would never generate numbers; rather, they would move the mouse cursor.&lt;/p&gt;
&lt;p&gt;Luckily, I found this post: &lt;a href="http://eric.biven.us/2009/02/03/ubuntu-and-the-number-pad-that-wont-work/" target="_blank" rel="noreferrer"&gt;eric.biven.us/2009/02/03/ubuntu-and-the-number-pad-that-wont-work/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In short, the solution to turning off this feature is to go into System-&amp;gt;Preferences-&amp;gt;Assistive Technologies, press &amp;ldquo;Keyboard Accessibility&amp;rdquo;, then under &amp;ldquo;Mouse Keys&amp;rdquo; uncheck &amp;ldquo;Pointer can be controlled using the keypad.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;My KVM switch often leaves the shift state down - and the keyboard shortcut for this is Shift + NumLock.&lt;/p&gt;</description></item><item><title>Setting up soundmodem on Ubuntu 10.04</title><link>https://andrewmemory.acornwall.net/blog/2011-06-29-setting-up-soundmodem-on-ubuntu-10-04/</link><pubDate>Wed, 29 Jun 2011 22:23:42 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2011-06-29-setting-up-soundmodem-on-ubuntu-10-04/</guid><description>&lt;p&gt;After a long delay, I finally decided to upgrade to 10.04 LTS and get soundmodem running again.&lt;/p&gt;
&lt;p&gt;Luckily, there was help this time. I started with my config, and merged with this post: &lt;a href="http://ubuntuforums.org/showthread.php?p=10864691" target="_blank" rel="noreferrer"&gt;ubuntuforums.org/showthread.php?p=10864691&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the config I ended up using:&lt;/p&gt;
&lt;p&gt;Configuration: AX.25 IO: Mode: soundcard Audio Driver: /dev/dsp Half Duplex: selected PTT Driver: none&lt;/p&gt;
&lt;p&gt;Channel Access: TxDelay: 150 Slot Time: 100 P-Persistence: 40 Full Duplex: not selected TxTail: 10&lt;/p&gt;
&lt;p&gt;Channel 0: Modulator: Mode: afsk Bits/s: 1200 Freq 0: 1200 Freq 1: 2200 Differential: selected&lt;/p&gt;
&lt;p&gt;Demodulator: Mode: afsk Bits/s: 1200 Freq 0: 1200 Freq 1: 2200 Differential: selected&lt;/p&gt;
&lt;p&gt;Packet IO: Mode: MKISS Interface: sm0 Callsign: mycall IP address: 10.0.0.1 Network mask: 255.255.255.0 Broadcast addr: 10.0.0.255&lt;/p&gt;
&lt;p&gt;I also set up /etc/ax25/axports to have:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sm0 mycall 1200 255 7 144.39 APRS (1200 bps)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Finally, I made sure Avahi was set to ignore sm0. This is easier than it was &lt;a href="https://andrewmemory.acornwall.net/blog/2009-10-17-radio-packet-soundmodem-losing-the-squeaks/" &gt;prevously&lt;/a&gt; - now you just add:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;deny-interfaces=sm0&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;to /etc/avahi/avahi-daemon.conf&lt;/p&gt;
&lt;p&gt;Once that&amp;rsquo;s done, don&amp;rsquo;t forget to chmod 4755 /usr/bin/xastir so it can open sm0 and things are good.&lt;/p&gt;</description></item><item><title>Intel can't do video</title><link>https://andrewmemory.acornwall.net/blog/2011-06-12-intel-cant-do-video/</link><pubDate>Sun, 12 Jun 2011 03:35:44 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2011-06-12-intel-cant-do-video/</guid><description>&lt;p&gt;I recently upgraded my Ubuntu installation from 9.10 (with the old 8.10 video drivers that didn&amp;rsquo;t crash) to 10.04. I immediately began seeing the video crash, especially when there was a lot of activity.&lt;/p&gt;
&lt;p&gt;It turns out I have an Intel Corporation 82845G/GL&lt;/p&gt;
\[Brookdale-G\]&lt;p&gt;/GE Chipset Integrated Graphics Device (rev 01). This is one of the many Intel video cards that have trouble.&lt;/p&gt;
&lt;p&gt;I applied workaround F from here: &lt;a href="https://wiki.ubuntu.com/X/Bugs/Lucidi8xxFreezes" target="_blank" rel="noreferrer"&gt;https://wiki.ubuntu.com/X/Bugs/Lucidi8xxFreezes&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That led me to here: &lt;a href="http://www.ubuntugeek.com/intel-graphics-performance-guide-for-ubuntu-904-jaunty-users.html" target="_blank" rel="noreferrer"&gt;http://www.ubuntugeek.com/intel-graphics-performance-guide-for-ubuntu-904-jaunty-users.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After applying the Method 2 fix from there, things seem to be a little more stable. Time will tell.&lt;/p&gt;</description></item><item><title>Brother printer disappeared</title><link>https://andrewmemory.acornwall.net/blog/2011-05-31-brother-printer-disappeared/</link><pubDate>Tue, 31 May 2011 23:21:42 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2011-05-31-brother-printer-disappeared/</guid><description>&lt;p&gt;After a while, my Brother MVC 9840 CDW printer (which I installed using &lt;a href="https://andrewmemory.acornwall.net/blog/2011-01-02-installing-the-brother-mfc-9840cdw-driver-on-ubuntu" &gt;this method&lt;/a&gt;) disappeared.&lt;/p&gt;
&lt;p&gt;No idea why. So I deleted it and reinstalled it. When I went to reinstall it, the original IP-address method wasn&amp;rsquo;t available. Instead I picked: Network Printer -&amp;gt; Brother MFC-9840CDW and accepted the host and queue as filled in by the configuration dialog. When I did that, no luck.&lt;/p&gt;
&lt;p&gt;Instead, I selected AppleTalk/HP Jet Direct since I knew the printer supported that protocol as well. Then I had to enter the IP address of the printer and accepted the default port (9100). Once that was done, I could again print a test page and use up all my ink.&lt;/p&gt;</description></item><item><title>Failed while running mythtranscode to cut commercials</title><link>https://andrewmemory.acornwall.net/blog/2011-02-27-failed-while-running-mythtranscode-to-cut-commercials/</link><pubDate>Sun, 27 Feb 2011 16:50:51 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2011-02-27-failed-while-running-mythtranscode-to-cut-commercials/</guid><description>&lt;p&gt;For a long time I&amp;rsquo;ve had the error message &amp;ldquo;failed while running mythtranscode to cut commercials&amp;rdquo; on my MythTV box. Today I did some searching to find out more about it.&lt;/p&gt;
&lt;p&gt;It turns out the error is caused by the existence or permissions of .ICEauthority.&lt;/p&gt;
&lt;p&gt;I nuked ~/.ICEauthority and was able to mythtranscode. Apparently this file is recreated occasionally, so if I see this again I&amp;rsquo;ll check permissions.&lt;/p&gt;</description></item><item><title>Configuring a website on Apache2 with server-side includes</title><link>https://andrewmemory.acornwall.net/blog/2011-01-22-configuring-a-website-on-apache2-with-server-side-includes/</link><pubDate>Sat, 22 Jan 2011 14:37:23 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2011-01-22-configuring-a-website-on-apache2-with-server-side-includes/</guid><description>&lt;p&gt;I recently got myself involved in helping with a website for a local club. In order to maintain it, I wanted to set up an Apache instance at home as well.&lt;/p&gt;
&lt;p&gt;Luckily, in Ubuntu 9.10, it&amp;rsquo;s almost all set up by default. The only changes I had to make were to change the DocumentRoot directory and enable server-side includes. Here&amp;rsquo;s what I did:&lt;/p&gt;
&lt;h2 class="relative group"&gt;Changing the document root
&lt;div id="changing-the-document-root" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#changing-the-document-root" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;First I edited /etc/apache2/sites-available/default to put my document root in DocumentRoot, and also changed the two directory references that did point to /var/www to my new document root. Then I made sure all the parents of my document root had r+x permission for the Apache user.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Turning on server-side includes
&lt;div id="turning-on-server-side-includes" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#turning-on-server-side-includes" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;My hosting facility has server-side includes turned on for .html. This is not the best use of resources, but this website doesn&amp;rsquo;t get enough traffic to make a difference. So I added: &lt;code&gt;AddType text/html .html AddHandler server-parsed .html Option Include (plus whatever options were there before)&lt;/code&gt; to the two directories that used to be /var/www and /. After that, I had to enable mod_include with: &lt;code&gt;cd /etc/apache2/mods-enabled sudo ln -s ../mods-available/include.load include.load&lt;/code&gt; Then restart apache with sudo /etc/init.d/apache2 restart&lt;/p&gt;</description></item><item><title>Creating thumbnail images with convert</title><link>https://andrewmemory.acornwall.net/blog/2011-01-02-creating-thumbnail-images-with-convert/</link><pubDate>Sat, 01 Jan 2011 17:32:26 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2011-01-02-creating-thumbnail-images-with-convert/</guid><description>&lt;p&gt;A little while ago, I found I had a bunch of images that needed thumbnails that were 100×75. This isn&amp;rsquo;t hard to do - I used convert and a pair of bash for loops.&lt;/p&gt;
&lt;p&gt;The core was a call to convert, which is part of ImageMagick.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;convert -thumbnail 100x75 input.jpg thumbnail.jpg&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;All of my images happened to be 4:3 - if they hadn&amp;rsquo;t, I might have used &lt;code&gt;100x75!&lt;/code&gt; or rotated/resized them.&lt;/p&gt;
&lt;p&gt;Next, all my files had numbers of the form file01..file09 file10 file11&amp;hellip; etc. If you&amp;rsquo;re nuts, you try to figure out how to do this in a single for-loop with a condition for the first 9 elements that start with 0.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re lazy like me, you use two loops, with a cursor-up in bash so you don&amp;rsquo;t have to type as much:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;export INFILEPREFIX=file
export OUTFILEPREFIX=file
for i in {1..9}; do convert -thumbnail 100x75 ${INFILEPREFIX}0${i}.jpg ${OUTFILEPREFIX}0${i}t.jpg; done
for i in {10..25}; do convert -thumbnail 100x75 ${INFILEPREFIX}${i}.jpg ${OUTFILEPREFIX}${i}t.jpg; done&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;For the non-thumbnails, I resized as well, using -resize 800x600.&lt;/p&gt;</description></item><item><title>Installing the Brother MFC 9840cdw driver on Ubuntu</title><link>https://andrewmemory.acornwall.net/blog/2011-01-01-installing-the-brother-mfc-9840cdw-driver-on-ubuntu/</link><pubDate>Sat, 01 Jan 2011 17:13:51 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2011-01-01-installing-the-brother-mfc-9840cdw-driver-on-ubuntu/</guid><description>&lt;p&gt;When I had Ubuntu 8.04, I&amp;rsquo;d struggled my way through installing the official Brother driver from the &lt;a href="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html" target="_blank" rel="noreferrer"&gt;Brother Linux site&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Since then I&amp;rsquo;ve upgraded a couple of times to 9.10, and had not reinstalled my printer. It turns out Ubuntu has made life much easier for us Brother printer owners - so these days there&amp;rsquo;s no reason not to install the printer driver, especially if the printer is networked.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s how to do it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open Synaptic Package Manager&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Search for 9840. You should see two packages:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;brother-cups-wrapper-ac
brother-lpr-driver-ac&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select those for installation (along with their required packages).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to System-&amp;gt;Administration-&amp;gt;Printing and press the &amp;ldquo;New Printer&amp;rdquo; button.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After a &amp;ldquo;Search for new printers&amp;rdquo; message comes up and goes away, expand &amp;ldquo;Network Printers&amp;rdquo;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you&amp;rsquo;re lucky like me, you&amp;rsquo;ll see your printer there. I chose to use the one that was found by IP address (LPD Network Printer via DNS-SD).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then I printed a test page, which shot a bunch of colour toner out. (If I had to do it over again, I would have just printed from Firefox to save toner.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, I did System-&amp;gt;Preferences-&amp;gt;Default Printer to set the new printer as the default.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That does the printer; next you&amp;rsquo;ll want the scanner. This isn&amp;rsquo;t quite as straightforward, since the scanner stuff isn&amp;rsquo;t in Synaptic. Again I&amp;rsquo;m assuming it&amp;rsquo;s set up on a network:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Make sure you&amp;rsquo;ve already installed xsane and its requirements.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download the .deb for brscan3 from the &lt;a href="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_scn.html#brscan3" target="_blank" rel="noreferrer"&gt;Brother web site&lt;/a&gt;. If you&amp;rsquo;re like me, you want the 32-bit version.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the driver with:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo dpkg -i --force-all brscan3-0.2.11-2.i386.deb&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the scanner:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ brsaneconfig3 -a name=SCANNER model=MFC-9840CDW ip=aaa.bbb.ccc.ddd&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;(where aaa.bbb.ccc.ddd is your MFC-9840&amp;rsquo;s IP address).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify the driver installed:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ brsaneconfig3 -q | grep SCANNER
0 SCANNER &amp;#34;MFC-9840CDW&amp;#34; I:aaa.bbb.ccc.ddd&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run xsane and it should find the scanner.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Converting audio files under Linux</title><link>https://andrewmemory.acornwall.net/blog/2010-12-29-converting-audio-files-under-linux/</link><pubDate>Wed, 29 Dec 2010 23:14:27 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-12-29-converting-audio-files-under-linux/</guid><description>&lt;p&gt;Linux has mplayer, an excellent audio player. It&amp;rsquo;s also handy when you want to convert a sound file from one format to another. The secret is to use .wav as an intermediate conversion, since most audio converters know how to handle that.&lt;/p&gt;
&lt;p&gt;Here is the magic incantation for mplayer:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;mplayer -quiet -vo null -vc dummy -ao pcm:waveheader:file=&amp;#34;output.wav&amp;#34; input.rm&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;This takes the input file and creates output.wav from it. Once you have that, it&amp;rsquo;s a simple matter of&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;oggenc output.wav&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;to get output.ogg (don&amp;rsquo;t forget to install vorbis-tools) or&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;lame output.wav&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;if MP3s are your bag.&lt;/p&gt;
&lt;p&gt;Linux Review has a good &lt;a href="http://en.linuxreviews.org/HOWTO_Convert_audio_files" target="_blank" rel="noreferrer"&gt;article on converting&lt;/a&gt; using this technique&lt;/p&gt;</description></item><item><title>Speed up those boring meeting replays with mplayer</title><link>https://andrewmemory.acornwall.net/blog/2010-12-29-speed-up-those-boring-meeting-replays-with-mplayer/</link><pubDate>Wed, 29 Dec 2010 23:14:27 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-12-29-speed-up-those-boring-meeting-replays-with-mplayer/</guid><description>&lt;p&gt;It&amp;rsquo;s been a while since I looked at the man page for mplayer. Ubuntu has finally included something I&amp;rsquo;ve wanted for a long time.&lt;/p&gt;
&lt;p&gt;Every now and then I have to listen to pre-recorded meetings. Since I usually think faster than the speakers can talk (&amp;ldquo;umm, uhh&amp;hellip; could you go to the next slide please?&amp;rdquo;) I like to speed things up.&lt;/p&gt;
&lt;p&gt;I used to have to use sox to change the playback speed without changing the pitch, but now it appears it&amp;rsquo;s built into mplayer, which makes it much easier.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s how to do it:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;mplayer -af scaletempo -speed 1.3 boringmeeting.mp3&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;This plays back at 1.3 times the usual speed, which is good for most speakers. Really slow ones will benefit from -speed 1.5.&lt;/p&gt;
&lt;p&gt;When I was young, I had an LP with the song &amp;ldquo;Twilight Zone&amp;rdquo; by Golden Earring on it. I used to listen to that at 45 rpm instead of 33 rpm because it made it sound more urgent. That would be -speed 1.363 if you&amp;rsquo;re playing at home.&lt;/p&gt;</description></item><item><title>Disabling the Ubuntu auto update dialog</title><link>https://andrewmemory.acornwall.net/blog/2010-10-21-disabling-the-ubuntu-auto-update-dialog/</link><pubDate>Thu, 21 Oct 2010 01:41:03 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-10-21-disabling-the-ubuntu-auto-update-dialog/</guid><description>&lt;p&gt;I&amp;rsquo;ve lived with the Ubuntu auto-update dialog on my MythTV box for quite a while. Tonight I did a quick search to see how to disable it.&lt;/p&gt;
&lt;p&gt;Thanks to this link: &lt;a href="http://maketecheasier.com/remove-the-annoying-update-manager-pop-up-in-ubuntu-jaunty" target="_blank" rel="noreferrer"&gt;maketecheasier.com/remove-the-annoying-update-manager-pop-up-in-ubuntu-jaunty&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;hellip; I discovered that turning off the update dialog was quick and easy. Just do:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;gconftool -s --type bool /apps/update-notifier/auto_launch false&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;You don&amp;rsquo;t even need a sudo, since it&amp;rsquo;s just changing your user&amp;rsquo;s config.&lt;/p&gt;
&lt;p&gt;No more popups obscuring MythTV! When something is annoying, a ten second web search can be a good thing.&lt;/p&gt;</description></item><item><title>Installing ntpd on Ubuntu</title><link>https://andrewmemory.acornwall.net/blog/2010-09-01-installing-ntpd-on-ubuntu/</link><pubDate>Wed, 01 Sep 2010 02:29:28 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-09-01-installing-ntpd-on-ubuntu/</guid><description>&lt;p&gt;I was surprised to see that my installs of Ubuntu 9.10 and Ubuntu 10.04 server didn&amp;rsquo;t have ntpd in them. This meant that nothing was correcting my drifting time. One machine was off by five minutes.&lt;/p&gt;
&lt;p&gt;So I installed OpenBSD&amp;rsquo;s ntpd: &lt;code&gt;sudo aptitude install openntpd&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And then started it: &lt;code&gt;sudo service openntpd start&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The /etc/openntpd/ntpd.conf shows that I&amp;rsquo;m polling from the Debian NTP server pool. I guess that&amp;rsquo;s good enough. When I need an NTP server and can&amp;rsquo;t remember, I use time-a.timefreq.bldrdoc.gov.&lt;/p&gt;</description></item><item><title>Hiding a user in GDM</title><link>https://andrewmemory.acornwall.net/blog/2010-09-01-hiding-a-user-in-gdm/</link><pubDate>Wed, 01 Sep 2010 02:14:06 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-09-01-hiding-a-user-in-gdm/</guid><description>&lt;p&gt;A while back, I was playing with Joomla, and I created a joomla user. That was fine, but then I noticed that GDM (the login screen) was offering me the chance to select that user to log in. That was not my intent.&lt;/p&gt;
&lt;p&gt;A quick search revealed this useful post: &lt;a href="http://ubuntuforums.org/showthread.php?t=1321845" target="_blank" rel="noreferrer"&gt;http://ubuntuforums.org/showthread.php?t=1321845&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;GDM will show you every user with a user ID of 1000 or higher. I changed my joomla user&amp;rsquo;s user ID to 987, and voilà - no more prompt.&lt;/p&gt;
&lt;p&gt;Luckily, the user I modified didn&amp;rsquo;t own much - and everything it did own was in a group that also owned the files. If that hadn&amp;rsquo;t been the case, I would have had to change ownership of the files as well.&lt;/p&gt;</description></item><item><title>Reading fonts from a Mac CDROM and converting them to TrueType</title><link>https://andrewmemory.acornwall.net/blog/2010-08-06-reading-fonts-from-a-mac-cdrom-and-converting-them-to-truetype/</link><pubDate>Fri, 06 Aug 2010 23:13:11 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-08-06-reading-fonts-from-a-mac-cdrom-and-converting-them-to-truetype/</guid><description>&lt;p&gt;A few years back, I bought a bunch of Macintosh fonts on a CD-ROM. Recently, I decided I wanted to use them with Ubuntu. Since the Mac CD was HPFS only and very scratched, here&amp;rsquo;s what I ended up doing.&lt;/p&gt;
&lt;p&gt;First, I installed the Ubuntu utilities for Mac HPFS: &lt;code&gt;sudo aptitude install macutils hfs&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Then I tried just mounting the file system: &lt;code&gt;sudo mount -thfs /dev/cdrom /mnt/cdrom/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That probably would have worked, but my CD was so scratched that it kept dying. (Also, I don&amp;rsquo;t know if copying from a mounted HFS file system copies both forks of the Apple file.)&lt;/p&gt;
&lt;p&gt;Luckily, I was able to use the mounted file system to get a ls -lR listing of the files on the disk. That made it easier to use the excellent hfs utils:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo aptitude install hftutils&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Then I could: &lt;code&gt;hmount /dev/cdrom hcd TRUETYPE hcopy -b MyFont.suit /tmp/MyFont.hqx&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I wrote a script to copy the files over. Once I had the files over, I could convert them manually using fontforge (from &lt;a href="http://fontforge.sourceforge.net/" target="_blank" rel="noreferrer"&gt;fontforge.sourceforge.net&lt;/a&gt;). Basically, you do: &lt;code&gt;sudo aptitude install fontforge fontforge MyFont.hqx&lt;/code&gt; and then File -&amp;gt; Generate Fonts -&amp;gt; Save (after making sure TTF is selected).&lt;/p&gt;
&lt;p&gt;It turns out fontforge is overkill - and also harder to script - than fondu.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo aptitude install fondu fondu *.hqx&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Here are some useful sources of information:&lt;/p&gt;
&lt;p&gt;A discussion of font utilities: &lt;a href="http://ubuntuforums.org/showthread.php?t=314837" target="_blank" rel="noreferrer"&gt;ubuntuforums.org/showthread.php?t=314837&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The easy way: using fondu: &lt;a href="http://ubuntu-tutorials.com/2006/12/13/convert-mac-based-fonts-for-use-on-ubuntu-ubuntu-6061-610/" target="_blank" rel="noreferrer"&gt;ubuntu-tutorials.com/2006/12/13/convert-mac-based-fonts-for-use-on-ubuntu-ubuntu-6061-610/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Converting from one outline font (e.g. PostScript) to another (e.g. TrueType): &lt;a href="http://fontforge.sourceforge.net/faq.html#outline-conversion" target="_blank" rel="noreferrer"&gt;fontforge.sourceforge.net/faq.html#outline-conversion&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once you have the fonts in TTF format, you can copy them to ~/.fonts/ (or use the File Browser to open the Font Viewer and then press the Install button if you&amp;rsquo;re GUI) to install on Ubuntu.&lt;/p&gt;
&lt;p&gt;For Windows, just drag &amp;amp; drop the font to C:\WINNT\Fonts or C:\WINDOWS\Fonts depending on your system.&lt;/p&gt;
&lt;p&gt;Incidentally, if you&amp;rsquo;re looking for a particular font or lookalike, you&amp;rsquo;ll probably find it here: &lt;a href="http://www.fonts101.com/" target="_blank" rel="noreferrer"&gt;www.fonts101.com&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Batch-converting images</title><link>https://andrewmemory.acornwall.net/blog/2010-06-29-batch-converting-images/</link><pubDate>Tue, 29 Jun 2010 19:15:53 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-06-29-batch-converting-images/</guid><description>&lt;p&gt;I had a wad of images that I needed to resize from 300dpi and high-resolution jpg to 4.5x6 (or 6x4.5) low resolution at 72 dpi.&lt;/p&gt;
&lt;p&gt;First, I installed ImageMagick: &lt;code&gt;sudo aptitude install imagemagick&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Then I opened GIMP and determined the pixel width and height of one image. (Image -&amp;gt; Canvas Size). In my case, it was 3264x2448.&lt;/p&gt;
&lt;p&gt;Next, I resized the image to the size I wanted. That turned out to be 432x324.&lt;/p&gt;
&lt;p&gt;In other words, I wanted my new images to be 0.132352941 of the original image. A quick test told me I was on the right track: &lt;code&gt;convert P4250049.JPG -resize 13.2352941% test.jpg&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The first time I did this I forgot the % sign and got a 13x10 pixel image - not exactly what I wanted.&lt;/p&gt;
&lt;p&gt;So, on to batch-converting everything in a directory: &lt;code&gt;mkdir ./resized for i in *.JPG; do echo $i convert $i -resize 13.235941% -quality 20 ./resized/$i done&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And all my resized images were in the resized directory below the image directory. (Did I mention I wanted to reduce the quality so my images would be smaller too? Yep, that&amp;rsquo;s what the -quality line does.)&lt;/p&gt;</description></item><item><title>Setting disk labels in Linux</title><link>https://andrewmemory.acornwall.net/blog/2010-06-05-setting-disk-labels-in-linux/</link><pubDate>Sat, 05 Jun 2010 22:00:16 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-06-05-setting-disk-labels-in-linux/</guid><description>&lt;p&gt;&lt;a href="https://andrewmemory.acornwall.net/blog/2009-12-15-setting-disk-uuids" &gt;Back in December&lt;/a&gt;, I wrote about setting UUIDs so multiple disks could be mounted in the same place using /etc/fstab.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve since decided that was dumb. Disks should have unique UUIDs - Linux may use that for more than just mounting the file system. Luckily, there is a better option: the disk label.&lt;/p&gt;
&lt;p&gt;Mounting a disk using the disk label is very similar to mounting using UUIDs. First, you need to give the disk a label. I think you can do that when you mkfs, but it&amp;rsquo;s pretty cheap to do it after you&amp;rsquo;ve already bulit the file system using: &lt;code&gt;e2label /dev/sdb1 mylabel&lt;/code&gt; (substituting whatever device you want for /dev/sdb1 and whatever label you want for mylabel. This will work for ext2, ext3 and ext4 - if you&amp;rsquo;re using another file system, it should have its own label utility.)&lt;/p&gt;
&lt;p&gt;Then, rather than specifying UUID= in /etc/fstab, specify: &lt;code&gt;LABEL=mylabel&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Your disk will mount automatically, but still have a unique ID. Sounds better to me.&lt;/p&gt;
&lt;p&gt;Sun has a useful tutorial at: &lt;a href="http://wikis.sun.com/display/BigAdmin/Using&amp;#43;Disk&amp;#43;Labels&amp;#43;on&amp;#43;Linux&amp;#43;File&amp;#43;Systems" target="_blank" rel="noreferrer"&gt;http://wikis.sun.com/display/BigAdmin/Using+Disk+Labels+on+Linux+File+Systems&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Straightening pictures with Gimp</title><link>https://andrewmemory.acornwall.net/blog/2010-04-15-straightening-pictures-with-gimp/</link><pubDate>Thu, 15 Apr 2010 22:17:34 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-04-15-straightening-pictures-with-gimp/</guid><description>&lt;p&gt;A while back, I discovered a very useful tool in Gimp to straighten images. This is useful if you have a bunch of scanned text (its advertised usage) or if you have what I have: a group of pictures that were scanned in on a flatbed scanner and all 2-3 degrees off of horizontal.&lt;/p&gt;
&lt;p&gt;Since upgrading Ubuntu, I&amp;rsquo;d lost track of that plugin. I started by searching for &amp;ldquo;straighten picture&amp;rdquo; and that led me to the Straighten and Crop plugin: &lt;a href="http://registry.gimp.org/node/18821" target="_blank" rel="noreferrer"&gt;http://registry.gimp.org/node/18821&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s a useful tool, but not what I wanted. (It lets you pick two points on an image&amp;ndash;say, the leftmost and rightmost horizon lines&amp;ndash;and rotate the image so those two points are even.)&lt;/p&gt;
&lt;p&gt;Eventually I figured out the tool I wanted was Deskew (aka auto-straighten). It can be found here: &lt;a href="http://registry.gimp.org/node/2958" target="_blank" rel="noreferrer"&gt;http://registry.gimp.org/node/2958&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I downloaded the .deb for 1.1 and installed it in my Ubuntu 9.10 with:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo dpkg -i gimp-deskew-plugin_1.1_i386.deb &lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Once it&amp;rsquo;s installed, it&amp;rsquo;s not immediately obvious where in Gimp it goes. (And of course the web page is no help.) The secret location is:&lt;/p&gt;
&lt;p&gt;Filters -&amp;gt; Misc -&amp;gt; Deskew&lt;/p&gt;
&lt;p&gt;Load an image, select that, and the image will be straightened. Then you can crop it and save it; nobody will ever know it wasn&amp;rsquo;t straight on your scanner.&lt;/p&gt;</description></item><item><title>Exposing the Firefox Location Bar behaviour</title><link>https://andrewmemory.acornwall.net/blog/2010-02-19-exposing-the-firefox-location-bar-behaviour/</link><pubDate>Fri, 19 Feb 2010 00:13:42 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-02-19-exposing-the-firefox-location-bar-behaviour/</guid><description>&lt;p&gt;On several machines, I&amp;rsquo;ve got Seamonkey 2.0.2 installed. It has some very nice fine-grained preferences to control what shows up in the location bar.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve also got a netbook where I put Firefox 3.6 because I didn&amp;rsquo;t need everything that&amp;rsquo;s in Seamonkey. Firefox has really limited preferences to control what shows up in the location bar.&lt;/p&gt;
&lt;p&gt;Luckily, both browsers behave the same way using about:config. So it&amp;rsquo;s possible to get Seamonkey&amp;rsquo;s fine-grained control on Firefox, as long as you don&amp;rsquo;t care about a UI to do it.&lt;/p&gt;
&lt;p&gt;A very useful article can be found here: &lt;a href="http://kb.mozillazine.org/Browser.urlbar.default.behavior" target="_blank" rel="noreferrer"&gt;http://kb.mozillazine.org/Browser.urlbar.default.behavior&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I read that article, and was about to calculate the value I wanted, when I realized the simplest way to do it is to go to the Seamonkey install, set up the preferences the way you want (&amp;ldquo;Autocomplete from your browsing history as you type&amp;rdquo;, &amp;ldquo;Match only websites you&amp;rsquo;ve typed previously&amp;rdquo;, &amp;ldquo;Only match locations, not website titles&amp;rdquo;, &amp;ldquo;Match anywhere but preferring word boundaries&amp;rdquo;, &amp;ldquo;Automatically prefill the best match&amp;rdquo;, &amp;ldquo;Show list of matching results&amp;rdquo;).&lt;/p&gt;
&lt;p&gt;Then look at the values on Seamonkey for&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;browser.urlbar.default.behavior&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;using about:config, and enter that value (and any others you care about) in Firefox using about:config on that browser.&lt;/p&gt;
&lt;p&gt;In my case, I set browser.urlbar.default.behavior to 49 to get what I wanted.&lt;/p&gt;</description></item><item><title>Monitoring hard disk health with smartmontools</title><link>https://andrewmemory.acornwall.net/blog/2010-01-23-monitoring-hard-disk-health-with-smartmontools/</link><pubDate>Sat, 23 Jan 2010 23:50:21 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-01-23-monitoring-hard-disk-health-with-smartmontools/</guid><description>&lt;p&gt;I always install smartmontools when I use SMART-enabled hard drives. It wasn&amp;rsquo;t until recently, though, that I started automating the tests.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a link that explains it: &lt;a href="http://www.captain.at/howto-linux-smartmontools-smartctl.php" target="_blank" rel="noreferrer"&gt;http://www.captain.at/howto-linux-smartmontools-smartctl.php&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Based on that, here&amp;rsquo;s the code I added to my /etc/smartd.conf: &lt;code&gt;# Per http://www.captain.at/howto-linux-smartmontools-smartctl.php DEVICESCAN -d sat -a -o on -S on -s (S/../.././19|L/../../3/21|C/../.././20) -m root # -d sat because /dev/sdX doesn't seem to run without it # S/../.././19 = short test every day at 19:00 # C/../.././20 = conveyance test every day at 20:00 # L/../../3/21 = long test every wednesday (3) at 21:00 # -m root = root will be emailed if anything strange occurs&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Note that this has to come before any other DEVICESCAN (apparently the first one takes priority). Don&amp;rsquo;t forget to kill -HUP the smartd process so the new config will take effect, and make sure /etc/default/smartmontools has uncommented: &lt;code&gt;start_smartd=yes&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;After this, you can get useful info with: &lt;code&gt;sudo smartctl -l selftest /dev/sda&lt;/code&gt; (or whatever drive you care about).&lt;/p&gt;
&lt;p&gt;A very good description of the output of smartctl can be found at: &lt;a href="http://www.cyberciti.biz/tips/linux-find-out-if-harddisk-failing.html" target="_blank" rel="noreferrer"&gt;www.cyberciti.biz/tips/linux-find-out-if-harddisk-failing.html&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Adding fldigi from the Berlios repository</title><link>https://andrewmemory.acornwall.net/blog/2010-01-15-adding-fldigi-from-the-berlios-repository/</link><pubDate>Fri, 15 Jan 2010 00:32:30 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2010-01-15-adding-fldigi-from-the-berlios-repository/</guid><description>&lt;p&gt;The version of fldigi that&amp;rsquo;s built for Ubuntu 9.10 is a bit out of date. Luckily, the Berlios repository has a more recent version, and you can install that.&lt;/p&gt;
&lt;p&gt;The instructions are &lt;a href="https://fedorahosted.org/fldigi/wiki/Packages" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;. In short form (specific to Ubuntu 9.10):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Edit /etc/apt/sources.list and add the following lines:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# Berlios repository for updated FLDigi
deb http://download2.berlios.de/pub/fldigi/binaries karmic main&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Get the key for fldigi&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo apt-key adv --recv-keys --keyserver http://fldigi.berlios.de/binaries/fldigi-pkg-key.asc 8E7306F5&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install fldigi&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo aptitude update; sudo aptitude install fldigi&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Setting disk UUIDs</title><link>https://andrewmemory.acornwall.net/blog/2009-12-14-setting-disk-uuids/</link><pubDate>Mon, 14 Dec 2009 20:41:03 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-12-14-setting-disk-uuids/</guid><description>&lt;p&gt;After setting up mounting by UUID as described &lt;a href="https://andrewmemory.acornwall.net/blog/2009-12-07-automatically-mounting-drives-with-uuids" &gt;here&lt;/a&gt;, I realized I had a problem.&lt;/p&gt;
&lt;p&gt;I wanted to swap disks out (that is, have multiple versions of my backup drive). However, since the drives are being mounted by UUID, I wanted to have only one entry in /etc/fstab for all my &amp;ldquo;backup&amp;rdquo; drives.&lt;/p&gt;
&lt;p&gt;It appears that dd would work, but that seemed inelegant, especially if future drives are different sizes. So I did a bit of searching and found the discussion &lt;a href="http://nixcraft.com/shell-scripting/948-change-uuid-ext3-partition.html" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In short, I could use &lt;code&gt;sudo tune2fs /dev/sdb1 -U new-uuid-number&lt;/code&gt; to set the UUID of a file system to whatever I want.&lt;/p&gt;
&lt;p&gt;After I&amp;rsquo;d done that, I couldn&amp;rsquo;t figure out how to refresh the UUID in /dev/disk/by-uuid/ - even after ejecting and re-inserting the SATA disk, the old UUID still showed up. I ended up rebooting (sigh) and now I can swap drives out with abandon. I probably should have specified the UUID when I did the mkfs. This looks like &lt;a href="https://bugs.launchpad.net/ubuntu/&amp;#43;source/debian-installer/&amp;#43;bug/234920" target="_blank" rel="noreferrer"&gt;this bug&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I haven&amp;rsquo;t tried it, but I would guess having two disks with the same UUID in the machine at the same time would be a Bad Thing.&lt;/p&gt;
&lt;p&gt;In retrospect, it would probably have been better if I&amp;rsquo;d used disk labels instead of UUIDs.&lt;/p&gt;</description></item><item><title>Changing Unix/Linux filenames to handle DOS conventions</title><link>https://andrewmemory.acornwall.net/blog/2009-12-12-changing-unixlinux-filenames-to-handle-dos-conventions/</link><pubDate>Sat, 12 Dec 2009 15:24:20 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-12-12-changing-unixlinux-filenames-to-handle-dos-conventions/</guid><description>&lt;p&gt;Recently, I had a bunch of files with characters in their names that made them hard to handle under Windows. Although Unix has no problems with :, ? and others, DOS / Windows doesn&amp;rsquo;t handle them well. This made using them on my CIFS share a bit of a pain.&lt;/p&gt;
&lt;p&gt;To rename them, I hacked up a quick Groovy script. It maps all &amp;ldquo;weird&amp;rdquo; characters to _, which is pretty much universal.&lt;/p&gt;
&lt;p&gt;Note that this script doesn&amp;rsquo;t currently handle the case where two files map to the same name. If you have :foo and ?foo, they&amp;rsquo;ll both get mapped to _foo and you&amp;rsquo;ll lose one of them.&lt;/p&gt;
&lt;p&gt;I called it dosname because it was late and I wasn&amp;rsquo;t feeling creative.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;#!/usr/bin/groovy -
if(args.length == 0) {
printArgs()
System.exit(0);
}
dirName = args[0];
new File(dirName).eachFile() { file -&amp;gt;
def matcher = (file.getName() =~ /[\?\:\&amp;#34;\\]/)
def newName = matcher.replaceAll(&amp;#34;_&amp;#34;)
File newFile = new File(dirName &amp;#43; &amp;#34;/&amp;#34; &amp;#43; newName.toString())
println file.getName() &amp;#43; &amp;#34; -&amp;gt; &amp;#34; &amp;#43; newFile.getName()
file.renameTo(newFile)
}
System.exit(0);
def printArgs() {
println(&amp;#34;Usage: dosname [dirname]&amp;#34;)
println(&amp;#34; Note: I don&amp;#39;t handle the case where two files map to the same filename yet!&amp;#34;)
}&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;The interesting bit is in the line&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;def matcher = (file.getName() =~ /[\?\:\&amp;#34;\\]/)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;That line defines the regular expression which contains a group of characters which will be replaced by _. Right now it&amp;rsquo;s &lt;/p&gt;
\[?:"\\\]&lt;p&gt; (all quoted with \ because that&amp;rsquo;s what you have to do in regex).&lt;/p&gt;
&lt;p&gt;Run it with &amp;ldquo;dosname &lt;em&gt;directoryname&lt;/em&gt;&amp;rdquo;. There&amp;rsquo;s no way to reverse its effects, so try not to use it on useful directories like /etc/.&lt;/p&gt;
&lt;p&gt;Also, I needed to install OpenJDK6 JDK (not just the runtime) in order to run Groovy on Ubuntu 9.04. Go figure.&lt;/p&gt;
&lt;p&gt;Since I don&amp;rsquo;t know Groovy, I stole most of this code from &lt;a href="http://www.rossenstoyanchev.org/write/prog/java/groovy1.html" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Using rsync to back up a Windows box to Ubuntu Server 8.04</title><link>https://andrewmemory.acornwall.net/blog/2009-12-10-using-rsync-to-back-up-a-windows-box-to-ubuntu-server-8-04/</link><pubDate>Thu, 10 Dec 2009 23:49:53 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-12-10-using-rsync-to-back-up-a-windows-box-to-ubuntu-server-8-04/</guid><description>&lt;p&gt;After getting rsync working so well for backing up hard drive to hard drive, I naturally wanted to back up from my Windows box to my Ubuntu server. Luckily, &lt;a href="http://www.cygwin.com" target="_blank" rel="noreferrer"&gt;Cygwin&lt;/a&gt; has an rsync for Windows - so I started by installing that. (I actually already had it installed - Cygwin is nice.)&lt;/p&gt;
&lt;p&gt;I found some good instructions &lt;a href="http://a1979shakedown.wordpress.com/2009/01/19/set-up-an-rsync-server-in-ubuntu-for-file-syncing-between-machines/" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;, and used them as the basis for what I did.&lt;/p&gt;
&lt;p&gt;The steps I went through:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;First I created /etc/rsyncd.conf. I wanted to share a single directory called shared, so I had just one entry:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;[shared]
path=/data/shared
comment=Shared directory
uid=andrew
gid=sambashare
read only=false
auth users=rsyncuser
secrets file=/etc/rsyncd.secret&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I picked group sambashare just to be consistent with my Samba configuration. rsyncuser does not exist on the machine; it is instead mapped to andrew (uid)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next I created /etc/rsyncd.secret:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;rsyncuser:secretrsyncpassword&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After that, I needed to enable rsync (both right now and after reboot). First, I edited /etc/default/rsync and changed RSYNC_ENABLE to true:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;RSYNC_ENABLE=true&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Next I started the rsync daemon:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo /etc/init.d/rsync restart&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The /etc/inetd.conf of a plain Ubuntu 8.04 Server install was empty, which was a surprise to me. There appears to be a utility called &amp;ldquo;update-inetd&amp;rdquo; to update the file and then restart inetd. Because I couldn&amp;rsquo;t be bothered to find out the syntax, I just edited /etc/inetd.conf and put in:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;rsync stream tcp nowait root /usr/local/bin/rsync rsyncd --daemon&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Then I used update-inetd from the command line to restart inetd for me:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo update-inetd --disable rsync
sudo update-inetd --enable rsync&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;At this point, I could telnet to port 873 (the rsync port) and see a connection, but rsync itself still didn&amp;rsquo;t want to run. Instead, it failed (even when I entered the correct password) with this message:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;@ERROR: auth failed on module shared
rsync error: error starting client-server protocol (code 5) at main.c(1383)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Andrew Tridgell has awesome utilities, but he really has a problem with displaying meaningful messages.&lt;/p&gt;
&lt;p&gt;It turns out that rsync really wants the secrets file (in my case /etc/rsyncd.secret) to be readable only by the rsync user. There is a global option &amp;ldquo;strict modes&amp;rdquo; that can be set to false to allow you to get around this, but I decided why not just do the right thing:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo chown root.root /etc/rsyncd.secret
sudo chmod 400 /etc/rsyncd.secret&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, I needed a command for the rsync on my Windows box. Here was one I came up with: &lt;code&gt;@echo off set RSYNC_PASSWORD=secretrsyncpassword rsync -vrtz --delete --delete-excluded --exclude &amp;quot;Temp/&amp;quot; --exclude &amp;quot;*.tmp&amp;quot; --exclude &amp;quot;parent.lock&amp;quot; --exclude &amp;quot;UsrClass.dat*&amp;quot; --exclude &amp;quot;NTUSER.DAT&amp;quot; --exclude &amp;quot;ntuser.dat.LOG&amp;quot; --exclude &amp;quot;Cache/&amp;quot; &amp;quot;/cygdrive/c/Documents and Settings/&amp;quot; &amp;quot;rsyncuser@myserver::shared/win2k-backup/Documents and Settings&amp;quot;&lt;/code&gt; This command preserves timestamps (t) and prints out what it&amp;rsquo;s doing (v) as it recursively (r) goes through Documents and Settings and backs up the files, using compression so it&amp;rsquo;s faster over the net (z). It excludes a bunch of things.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I should probably have used a file to specify what&amp;rsquo;s excluded (&amp;ndash;exclude-from), but I was lazy and just kept adding to the command line. I&amp;rsquo;m excluding cache files, as well as lock/log files that are kept open by Windows 2000 (they report as errors if you try to back them up).&lt;/p&gt;
&lt;p&gt;At some point I&amp;rsquo;ll probably add a &amp;ldquo;hosts allow&amp;rdquo; line to my /etc/rsyncd.conf, as soon as I decide which machines I want to let backup to the server.&lt;/p&gt;</description></item><item><title>Automatically mounting drives with UUIDs</title><link>https://andrewmemory.acornwall.net/blog/2009-12-06-automatically-mounting-drives-with-uuids/</link><pubDate>Sun, 06 Dec 2009 21:28:42 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-12-06-automatically-mounting-drives-with-uuids/</guid><description>&lt;p&gt;Until now, I&amp;rsquo;ve always mounted drives by accessing their devices. However, I ran into a situation where this wouldn&amp;rsquo;t work. Luckily, Ubuntu has the ablility to access drives by UUID - which solved my problem.&lt;/p&gt;
&lt;p&gt;I have a drive that holds networked data, which I mount on Ubuntu 8.04 Server as /data/. I also back that drive up to a drive which is normally read-only as /databackup/.&lt;/p&gt;
&lt;p&gt;Both of these drives are SATA - meaning they could be unplugged at any time. If both are unplugged, whichever drive gets plugged in first becomes /dev/sda1 - and the other becomes /dev/sdb1. This means I can&amp;rsquo;t rely on mounting /dev/sda1 on /data and /dev/sdb1 on /databackup.&lt;/p&gt;
&lt;p&gt;To get around this, I mounted the drives using UUID in /etc/fstab. First, I had to figure out what the UUIDs of the drives were. To start with, I killed Samba and unmounted both - I knew /dev/sda1 was /data and /dev/sdb1 was /databackup. Then I obtained the UUIDs of both drives:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo vol_id --uuid /dev/sda1
7b932326-717b-4ba6-bef2-fedfbafcabe6
$ sudo vol_id --uuid /dev/sdb1
94efd7bd-8498-46f3-ab6d-cb706c413567&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Next, I replaced the device mounts (/dev/sda1 and /dev/sdb1) in /etc/fstab with:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;UUID=7b932326-717b-4ba6-bef2-fedfbafcabe6 /data ext3...
UUID=94efd7bd-8498-46f3-ab6d-cb706c413567 /databackup ext3...&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Under Ubuntu 9.10, it appears that vol_id has merged into blkid - so now you would use:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo blkid /dev/sda1
/dev/sda1: UUID=&amp;#34;f30ba2a3-9da6-48b1-8ab5-75952ef26cc4&amp;#34; TYPE=&amp;#34;ext3&amp;#34;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;to determine the UUID, and then update /etc/fstab as you&amp;rsquo;d do for 8.04.&lt;/p&gt;</description></item><item><title>Simple backup using rsync</title><link>https://andrewmemory.acornwall.net/blog/2009-12-03-simple-backup-using-rsync/</link><pubDate>Thu, 03 Dec 2009 23:46:20 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-12-03-simple-backup-using-rsync/</guid><description>&lt;p&gt;A simple way to back up your data from one drive to another is rsync. The magical incantation (assuming the data drive is /dev/sda1 mounted on /data and the backup drive is /dev/sdb1 mounted on /databackup, and you normally keep the backup drive mounted read-only):&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo mount -o remount,rw /dev/sdb1 /databackup
sudo rsync -a --delete --progress /data/ /databackup
sudo mount -o remount,ro /dev/sdb /databackup&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;</description></item><item><title>Setting up Samba on Ubuntu Server 8.04</title><link>https://andrewmemory.acornwall.net/blog/2009-11-27-setting-up-samba-on-ubuntu-server-8-04/</link><pubDate>Fri, 27 Nov 2009 00:43:59 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-11-27-setting-up-samba-on-ubuntu-server-8-04/</guid><description>&lt;p&gt;It&amp;rsquo;s been a few years since I last set up a Samba system, and the process is still as painful as ever. A lot of this pain comes from multiple authentication systems, which all have to be in sync for things to work.&lt;/p&gt;
&lt;p&gt;I started out with the link here: &lt;a href="http://ubuntuforums.org/showthread.php?t=202605" target="_blank" rel="noreferrer"&gt;http://ubuntuforums.org/showthread.php?t=202605&lt;/a&gt; and pretty much ignored all of it. In the end, I took the default 8.04.3 /etc/samba/smb.conf, and made the following changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Set the workgroup in the global stanza&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Added stanzas like the following:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;[music]
path = /music
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = andrew
force group = sambashare&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note that I&amp;rsquo;m using user permissions, not share permissions. So I had to add and enable the Samba user:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo smbpasswd -L -a andrew
sudo smbpasswd -L -e andrew&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Originally, I had force group = andrew. When I tried to mount using this option, I&amp;rsquo;d see:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo mount -a
mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;What lovely error messages. I found a semi-useful diagnostic tool, smbclient:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;smbclient //server/music -U andrew
Enter andrew&amp;#39;s password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.28a]
tree connect failed: NT_STATUS_NO_SUCH_GROUP&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I did have an andrew group, but the user andrew wasn&amp;rsquo;t in that group according to /etc/group, so I switched to sambashare (which does have andrew as a member). Then it worked. Just adding andrew as a member of the group andrew in /etc/group was not sufficient. No idea why, but probably Samba has some concept of groups that needs to be set up too.&lt;/p&gt;
&lt;p&gt;Next, I tried to connect again:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;smbclient //server/music -U andrew
Enter andrew&amp;#39;s password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.28a]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME &lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;This let me search on NT_STATUS_BAD_NETWORK_NAME and discover that, gee, that means permissons are bad for the directory that is being shared. Nothing better than helpful error messages.&lt;/p&gt;
&lt;p&gt;A final /etc/init.d/samba restart and I could connect.&lt;/p&gt;</description></item><item><title>Creating credential files for automatic Samba mounts in /etc/fstab</title><link>https://andrewmemory.acornwall.net/blog/2009-11-26-creating-credential-files-for-automatic-samba-mounts-in-etcfstab/</link><pubDate>Thu, 26 Nov 2009 23:55:28 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-11-26-creating-credential-files-for-automatic-samba-mounts-in-etcfstab/</guid><description>&lt;p&gt;It&amp;rsquo;s handy to have credentials for each Samba server so you don&amp;rsquo;t have public passwords in /etc/fstab for the Samba file systems you want to mount on boot. Here&amp;rsquo;s how I do it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a directory /etc/samba/credentials&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a file /etc/samba/credentials/myserver&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the myserver file, put the credentials for that server:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;username=myusername
password=mypassword&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; spaces are important here - don&amp;rsquo;t use “ = ”, use &amp;ldquo;=&amp;rdquo;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;chown -R root.root /etc/samba/credentials&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;chmod 700 /etc/samba/credentials&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;chmod 600 /etc/samba/credentials/myserver&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once this is done, you can add lines for each mount of that server to your /etc/fstab:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;//myserver/music /music smbfs credentials=/etc/samba/credentials/myserver 0 0
//myserver/shared /shared smbfs credentials=/etc/samba/credentials/myserver 0 0&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Note that the file in /etc/samba/credentials doesn&amp;rsquo;t have to be named the same thing as the server name - it just makes it easier.&lt;/p&gt;
&lt;p&gt;This also survives the Ubuntu upgrade process, so you just have to update /etc/fstab if you upgrade to a new release, and can keep the same credentials files.&lt;/p&gt;</description></item><item><title>Compiling soundmodem-0.14 on Ubuntu 9.10</title><link>https://andrewmemory.acornwall.net/blog/2009-11-21-compiling-soundmodem-0-14-on-ubuntu-9-10/</link><pubDate>Sat, 21 Nov 2009 00:00:47 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-11-21-compiling-soundmodem-0-14-on-ubuntu-9-10/</guid><description>&lt;p&gt;The soundmodem that ships with Ubuntu 9.10 is not the latest. The latest is available here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.baycom.org/~tom/ham/soundmodem/" target="_blank" rel="noreferrer"&gt;http://www.baycom.org/~tom/ham/soundmodem/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In order to compile it, you need to install a bunch of development packages. Here&amp;rsquo;s what I did:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo aptitude install libasound2-dev
sudo aptitude install libxml2-dev
sudo aptitude install libgtk2.0-dev
sudo aptitude install libaudiofile-dev&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Also, if you don&amp;rsquo;t have the compiler already you&amp;rsquo;ll need:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo aptitude install g&amp;#43;&amp;#43;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Then:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;tar xzvf soundmodem-0.14.tar.gz
cd soundmodem-0.14
sh ./configure
make&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;To test it, go to the configapp/src directory and run&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo ./soundmodemconfig&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;to set up the configuration. Finally, go to the soundcard directory and run:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo ./soundmodem -v5&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Assuming you&amp;rsquo;ve configured everything correctly, you should see something like:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sm[10093]: mkiss: ifname sm0 mtu 256 hwaddr CALLSIGN-0 ipaddr 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255
sm[10093]: unknown node &amp;#34;text&amp;#34;
ALSA: Using sample rate 9600, sample format 2, significant bits 16, buffer size 4800, period size 150
ALSA: Using sample rate 9600, sample format 2, significant bits 16, buffer size 4800, period size 150
sm[10093]: audio: starting &amp;#34;plughw:0,0&amp;#34;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;In a different terminal, you can then ifconfig sm0 to see that it&amp;rsquo;s there.&lt;/p&gt;</description></item><item><title>Tuning X video with modeline</title><link>https://andrewmemory.acornwall.net/blog/2009-10-30-tuning-x-video-with-modeline/</link><pubDate>Fri, 30 Oct 2009 14:40:09 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-10-30-tuning-x-video-with-modeline/</guid><description>&lt;p&gt;After setting my monitor up, I found it didn&amp;rsquo;t exactly match the other devices on my kvm switch. I could get around this by pressing the &amp;ldquo;Auto Adjust&amp;rdquo; button on the monitor, but that meant I&amp;rsquo;d have to adjust again when I switched to a different machine.&lt;/p&gt;
&lt;p&gt;Usually, what I do in these cases is to use xvidtune to fine-tune things. Unfortunately, that didn&amp;rsquo;t work - it would always fail with &amp;ldquo;Unable to query monitor info&amp;rdquo; even when I disconnected the kvm switch and went directly into the monitor.&lt;/p&gt;
&lt;p&gt;What that meant is that I&amp;rsquo;d have to hack the modeline manually. I found a good discussion of modelines &lt;a href="http://howto-pages.org/ModeLines/" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A modeline has the following format:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;name dotclock hsize hsyncstart hsyncend htotal vsize vsyncstart vsyncend vtotal hsyncpol vsyncpol&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I needed to move the image on my monitor to the right (I had a black bar on the right hand side, and the left hand side was clipped off). To move the monitor right, I needed to DECREASE hsyncstart and hsyncend by the same amount. (Then I logged out and logged back in to restart X so the new settings were being used.)&lt;/p&gt;
&lt;p&gt;Once the screen was more or less centred, I DECREASED htotal to make the display wider. (And then logged out and logged in again&amp;hellip;.)&lt;/p&gt;
&lt;p&gt;After that, the image was still a little further right than I wanted, so I DECREASED hsyncstart and hsyncend again to get the wider display centered again. One more restart of X and things were groovy.&lt;/p&gt;
&lt;p&gt;My current modeline is: &lt;code&gt;Section &amp;quot;Monitor&amp;quot; Identifier &amp;quot;Configured Monitor&amp;quot; # 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz # Modeline &amp;quot;1280x1024_60.00&amp;quot; MHz HSize HTotal HSyncEnd HSyncDelay VSize VSyncStart VSyncEnd VTotal HSyncPol VSyncPol Modeline &amp;quot;1280x1024_60.00&amp;quot; 109.00 1280 1322 1450 1700 1024 1027 1034 1066 -hsync +vsync EndSection&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now things are automatically adjusted when I switch from one box to another.&lt;/p&gt;
&lt;p&gt;Note: This won&amp;rsquo;t work if you aren&amp;rsquo;t currently displaying &lt;em&gt;something&lt;/em&gt; in the mode you want to use. Also, keep a copy of your original values in your xorg.conf file just in case things go awry - it&amp;rsquo;s possible to put all your controls offscreen, which can make things challenging.&lt;/p&gt;</description></item><item><title>Modeline for Samsung LN32A450C</title><link>https://andrewmemory.acornwall.net/blog/2009-10-25-modeline-for-samsung-ln32a450c/</link><pubDate>Sun, 25 Oct 2009 14:28:51 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-10-25-modeline-for-samsung-ln32a450c/</guid><description>&lt;p&gt;When I switched my video card after the capacitors burnt out on the old one, I found I could no longer do 1366x768 video on a Samsung LN32A450C. Most frustrating was the fact that I&amp;rsquo;d see the video for about four seconds, before the TV decided it didn&amp;rsquo;t want to display it and showed &amp;ldquo;Mode not supported&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Apparently, this is a common problem with Samsung TVs - and cvt was no help.&lt;/p&gt;
&lt;p&gt;Luckily, I found &lt;a href="http://thecosmotron.com/2008/11/05/samsung-ln32a450-nvidia-drivers-and-ubuntu/" target="_blank" rel="noreferrer"&gt;this post&lt;/a&gt; - so here is the modeline for the Samsung LN32A450C&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Modeline &amp;quot;1360x768&amp;quot; 85.500 1360 1440 1552 1792 768 771 777 795 +hsync +vsync&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I just had to add that to my Monitor section of /etc/X11/xorg.conf and the autodetection on Ubuntu 9.04 did the rest. This is actually 1360x768, not the specified 1366x768 that Samsung is supposed to support - but I don&amp;rsquo;t miss the few pixels on either side.&lt;/p&gt;</description></item><item><title>Ubuntu 9.04 setup - fixing the scroll wheel</title><link>https://andrewmemory.acornwall.net/blog/2009-10-21-ubuntu-9-04-setup-fixing-the-scroll-wheel/</link><pubDate>Wed, 21 Oct 2009 23:00:41 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-10-21-ubuntu-9-04-setup-fixing-the-scroll-wheel/</guid><description>&lt;p&gt;In Ubuntu with a PS/2 mouse, the scroll wheel stops working when you switch away with a KVM switch. I found some good instructions for fixing the problem on 8.04 &lt;a href="http://ramblings.gibberishcode.net/archives/getting-mouse-wheel-to-work-with-kvm-and-ubuntu/20" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are a few minor changes for 9.04. Here are the steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add the following to /etc/modules&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;psmouse&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create /etc/modprobe.d/psmouse.conf and give it the following contents:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt; # Make my mouse work with KVM
options psmouse proto=imps&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, reload the mouse module:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt; # sudo modprobe -r psmouse
# sudo modprobe -a psmouse&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Setting up the Sharp LL-172C-B Monitor on Ubuntu 9.04</title><link>https://andrewmemory.acornwall.net/blog/2009-10-21-setting-up-the-sharp-ll-172c-b-monitor-on-ubuntu-9-04/</link><pubDate>Wed, 21 Oct 2009 22:51:36 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-10-21-setting-up-the-sharp-ll-172c-b-monitor-on-ubuntu-9-04/</guid><description>&lt;p&gt;Here&amp;rsquo;s the magic to get the video mode set right for the Sharp LL-172C-B monitor (1280x1024) on Ubuntu 9.04:&lt;/p&gt;
&lt;p&gt;First, run CVT to get the modeline:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ cvt 1280 1024&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Copy the output from that into the Screen section of /etc/X11/xorg.conf&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;Section &amp;#34;Monitor&amp;#34;
Identifier      &amp;#34;Configured Monitor&amp;#34;
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
Modeline &amp;#34;1280x1024_60.00&amp;#34;  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync &amp;#43;vsync
EndSection&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Restart X and you&amp;rsquo;re in business.&lt;/p&gt;
&lt;p&gt;Update: I found I needed to tune the values a little bit. See the post &lt;a href="https://andrewmemory.acornwall.net/blog/2009-10-30-tuning-x-video-with-modeline/" &gt;here&lt;/a&gt; for more details.&lt;/p&gt;</description></item><item><title>Stopping the squeaks with soundmodem as ax.25</title><link>https://andrewmemory.acornwall.net/blog/2009-10-17-radio-packet-soundmodem-losing-the-squeaks/</link><pubDate>Sat, 17 Oct 2009 07:23:59 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2009-10-17-radio-packet-soundmodem-losing-the-squeaks/</guid><description>&lt;p&gt;I tried to set up soundmodem as an AX.25 device in order to run xastir on my machine. Unfortunately, Ubuntu by default has a bunch of services installed that prevent this. (Not so much prevent it as try to shove 100k of data through the 1200-baud soundmodem, which kills it and drives you nutty if the audio is turned up.)&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s what I did to get around this:&lt;/p&gt;
&lt;p&gt;1. Change /etc/samba/smb.conf to include only the eth0 interface.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;interface = eth0&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;2. Go into /etc/cups/cupsd.conf and turn off broadcasting (instructions &lt;a href="http://lists.pdxlinux.org/pipermail/plug/2007-February/052881.html" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;):&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;# Browsing was on.
#Browsing On
Browsing Off
BrowseInterval 0
# end trying to get around sm0 problem&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;3. Stop the AVAHI daemon by moving /etc/rc5.d/S18avahi-daemon to /etc/rc5.d/K18avahi-daemon and running /etc/rc5.d/K18avahi-daemon stop&lt;/p&gt;
&lt;p&gt;Note that on Ubuntu 9.10, avahi has been moved into Upstart. Stop it with&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;sudo stop avahi-daemon&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;then edit /etc/init/avahi-daemon.conf and comment out the&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;#start on (filesystem
# and started dbus)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;#respawn&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;</description></item></channel></rss>