<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>O Frabjous Day!</title>
    <description>David Wales&apos; Website and Blog — In which he records various conundrums and their solutions for future reference.
</description>
    <link>https://daviewales.com/</link>
    <atom:link href="https://daviewales.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Sun, 19 Oct 2025 08:17:43 +1100</pubDate>
    <lastBuildDate>Sun, 19 Oct 2025 08:17:43 +1100</lastBuildDate>
    <generator>Jekyll v4.3.3</generator>
    
      <item>
        <title>Launch World of Goo on Arch Linux</title>
        <description>&lt;p&gt;I recently installed the Arch Linux based
&lt;a href=&quot;https://omarchy.org/&quot;&gt;Omarchy&lt;/a&gt; on my Laptop, replacing Linux Mint which I’ve
used for the last year or so. As you can see, I haven’t posted for over two
years, which is a testament to how completely boring (in a good way!) Linux
Mint is. I’ve been running Omarchy for about a week now, and I’m already
writing a blog post…&lt;/p&gt;

&lt;h2 id=&quot;the-problem&quot;&gt;The Problem&lt;/h2&gt;

&lt;p&gt;As I was migrating my files, I found the GoG installer for &lt;a href=&quot;http://2dboy.com/&quot;&gt;World of
Goo&lt;/a&gt;, which is a very old game from 2008. I had it working
on Linux Mint (which is officially supported by GoG), and also on Pop!OS, which
is similarly Ubuntu-based. The installer completed successfully, and that’s
when the problems started.&lt;/p&gt;

&lt;p&gt;When I tried to run the game, I was greeted with the following inscrutable
error message:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Aborted                    (core dumped) ./WorldOfGoo.bin.x86_64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Cue several days of rabbit holes trying to understand &lt;em&gt;why&lt;/em&gt; it didn’t work!&lt;/p&gt;

&lt;p&gt;If you’re here because &lt;em&gt;you&lt;/em&gt; got the same error message, and you want to jump
to the solution, &lt;a href=&quot;#the-solution&quot;&gt;click here for the TL;DR&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;rabbit-holes&quot;&gt;Rabbit Holes&lt;/h2&gt;

&lt;p&gt;On the other hand, if you’re here for the rabbit holes, here are a few things
I tried.&lt;/p&gt;

&lt;h3 id=&quot;inspecting-the-core-file&quot;&gt;Inspecting the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;core&lt;/code&gt; file&lt;/h3&gt;

&lt;p&gt;To see all &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;core&lt;/code&gt; files (essentially a full dump of the program state at the
time of the crash), run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;coredumpctl&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To view the latest &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;core&lt;/code&gt; dump, run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;coredumpctl info&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To start the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gdb&lt;/code&gt; debugger on the latest &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;core&lt;/code&gt; file, run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;coredumpctl gdb&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you want to do the above for a core dump &lt;em&gt;other&lt;/em&gt; than the latest one, simply
append the process ID (PID) the commands above. (You can find the PID in the
list of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;core&lt;/code&gt; files from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;coredumpctl&lt;/code&gt;)&lt;/p&gt;

&lt;h3 id=&quot;inspecting-the-linked-libraries&quot;&gt;Inspecting the Linked Libraries&lt;/h3&gt;

&lt;p&gt;Inspect the linked libraries for an executable with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ldd name-of-executable&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;See lots of details about how the program looks up and uses the linked
libraries by setting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LD_DEBUG=all&lt;/code&gt; while running the program. For example:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;LD_DEBUG=all ./WorldOfGoo.bin.x86_64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;view-the-linux-system-calls&quot;&gt;View the Linux System Calls&lt;/h3&gt;

&lt;p&gt;Run the program with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;strace&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;strace ./WorldOfGoo.bin.x86_64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;the-solution&quot;&gt;The Solution&lt;/h2&gt;

&lt;p&gt;The solution turned out to be surprisingly easy, and didn’t involve any of the
tricks above. I still don’t understand &lt;em&gt;why&lt;/em&gt; this was the solution. But I
stumbled onto it reading &lt;a href=&quot;https://forums.opensuse.org/t/world-of-goo-opensuse/37280/14&quot;&gt;this forum post from
2010&lt;/a&gt;…&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Check which dependencies are required by listing the files in
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/GOG Games/world of goo/game/lib64/&lt;/code&gt;
In my case, these were the following:
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libogg.so.0&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libSDL2-2.0.so.0&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libSDL2_mixer-2.0.so.0&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libvorbisfile.so.3&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libvorbis.so.0&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Install the dependencies listed above as &lt;em&gt;system&lt;/em&gt; libraries. For example,
the following command should do the trick on Arch Linux:
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pacman -S libogg sdl2-compat sdl2_mixer libvorbis&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Finally, rename the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;world of goo&lt;/code&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lib64&lt;/code&gt; directory to something else. For
example:
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd ~/GOG Games/world of goo/game/lib64/&lt;/code&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mv lib64 lib64.bak&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And, you’re done! Moving the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lib64&lt;/code&gt; directory prevents &lt;em&gt;World of Goo&lt;/em&gt; from
finding the bundled dependencies, so it falls back to the system libraries. And
somehow, that’s all that’s needed to make it work!&lt;/p&gt;
</description>
        <pubDate>Sat, 18 Oct 2025 18:15:00 +1100</pubDate>
        <link>https://daviewales.com/2025/10/18/launch-world-of-goo-on-arch-linux.html</link>
        <guid isPermaLink="true">https://daviewales.com/2025/10/18/launch-world-of-goo-on-arch-linux.html</guid>
        
        
      </item>
    
      <item>
        <title>Booting Alpine on a Very Old iMac 8,1</title>
        <description>&lt;p&gt;I’ve tried a few times without success to boot Alpine Linux images on very old
Intel Macs. Following the standard instructions, I download the ISO, then image
it directly to a USB flash drive. Using this process, the standard x86_64 image
boots fine on my more recent MacBook Pro 11,2, but crashes the bootloader on
older Macs. (I’ve also confirmed it crashes the bootloader on a 2010 model
MacBook.)&lt;/p&gt;

&lt;p&gt;Recently, I installed Alpine on an original Raspberry Pi, and I noticed that
the instructions were a bit different. Instead of flashing an ISO image, I had
to create a blank FAT 32 disk, and copy the files into, rather than copying
a disk image. I wondered if this process would make any difference to the boot
process on my old iMac. Turns out it does! It booted successfully first try!&lt;/p&gt;

&lt;h2 id=&quot;steps&quot;&gt;Steps&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;On my Mac, reformat the USB drive as FAT 32, with a Master Boot Record
partition table. I’m not sure how necessary it is to configure it with
Master Boot Record, but that’s what I did.&lt;/li&gt;
  &lt;li&gt;On a Linux PC, download the Alpine x86_64 standard ISO, and mount it. Then
copy the files to the USB. NOTE: Copy, from the mounted image, don’t flash
the ISO. (This needs to be done on Linux so we can mount the ISO, as Mac
won’t be able to mount a Linux ISO.)&lt;/li&gt;
  &lt;li&gt;Reboot holding the Option key to enter the bootloader, select the USB disk,
and boot!&lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Thu, 30 Nov 2023 23:47:18 +1100</pubDate>
        <link>https://daviewales.com/2023/11/30/booting-alpine-on-a-very-old-imac8,1.html</link>
        <guid isPermaLink="true">https://daviewales.com/2023/11/30/booting-alpine-on-a-very-old-imac8,1.html</guid>
        
        
      </item>
    
      <item>
        <title>Cross-compiling unrtf for Android Termux</title>
        <description>&lt;p&gt;Recently I received some RTF files via email.
I wanted to read them on my phone, but I didn’t have any apps installed which understood RTF.
I thought it would be nice to have a tool in Termux which would dump nicely formatted RTF to the terminal.
At first I thought I might write something to do this myself, but then I discovered &lt;a href=&quot;https://www.gnu.org/software/unrtf/&quot;&gt;unrtf&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;unrtf will read an RTF file and can output plaintext or html, among other formats.
This sounded like exactly what I was looking for.
However, it was not available in the Termux repositories.
Never fear! I’ll build it from source I thought.
However, I couldn’t install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;clang&lt;/code&gt; on in Termux because my phone didn’t have enough storage space.&lt;/p&gt;

&lt;p&gt;This brought me to cross-compiling, which I haven’t done much (any?) of before.
I started to look into cross compiling with clang, which might have worked,
but then I remembered reading an article about how
&lt;a href=&quot;https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html&quot;&gt;zig cc&lt;/a&gt; 
could be used for cross-compiling.
I also learnt that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;zig&lt;/code&gt; has a built-in musl libc, and supports multiple target architectures out of the box.&lt;/p&gt;

&lt;p&gt;It took me a bit of time to figure out the correct invocation to run the build, but it ended up quite simple:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget https://ftp.gnu.org/gnu/unrtf/unrtf-0.21.10.tar.gz
tar -xf unrtf-0.21.10.tar.gz
cd unrtf-0.21.10
./configure CC=&quot;zig cc -target arm-linux-musleabi -D_GNU_SOURCE&quot; --host=arm-linux-musleabi
make
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After this, I had a 32 bit arm &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unrtf&lt;/code&gt; binary on my computer at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;src/unrtf&lt;/code&gt;.
I created an archive containing this and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;outputs/&lt;/code&gt; directory and copied it to my phone.
(The outputs directory is required, and must be specified when running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unrtf&lt;/code&gt; if it is not installed
to the standard location.)
I then ran the executable as follows, which by default outputs HTML to stdout:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;unrtf -P outputs file.rtf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, I piped the output to the &lt;a href=&quot;https://lynx.invisible-island.net/&quot;&gt;lynx&lt;/a&gt; CLI browser:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;unrtf -P outputs file.rtf | lynx -stdin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This produced very readable output!&lt;/p&gt;
</description>
        <pubDate>Wed, 12 Jul 2023 23:20:00 +1000</pubDate>
        <link>https://daviewales.com/2023/07/12/cross-compiling-unrtf-for-android.html</link>
        <guid isPermaLink="true">https://daviewales.com/2023/07/12/cross-compiling-unrtf-for-android.html</guid>
        
        
      </item>
    
      <item>
        <title>Missing Microphone on MX Linux 21.3 on iMac 8,1</title>
        <description>&lt;p&gt;This is a quick one. I installed MX Linux 21.3 on an old iMac 8,1 for use as
a general purpose living room PC. It’s mainly used for streaming videos and
music. However, sometimes it would be nice to use it for Skype. It’s got
a built-in webcam which worked out of the box, but for some reason the
microphone was not detected.&lt;/p&gt;

&lt;p&gt;Strangely, I could record audio using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arecord&lt;/code&gt; as root (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo su&lt;/code&gt;), but not as
a regular user. (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo arecord&lt;/code&gt; didn’t work either.) Although the audio
recorded as root was very crackly.&lt;/p&gt;

&lt;p&gt;After chasing a bunch of dead-ends, I found the answer on the Arch Linux wiki:
&lt;a href=&quot;https://wiki.archlinux.org/title/PulseAudio/Troubleshooting#Microphone_not_detected_by_PulseAudio&quot;&gt;Microphone not detected by PulseAudio&lt;/a&gt;
(This is becoming a bit of a theme for this blog.)&lt;/p&gt;

&lt;p&gt;The solution was exactly as described in the link above, but I’ll record it
here for posterity (copied from the Arch wiki, loosely edited):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Determine the card and device number of your mic:&lt;/p&gt;

  &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC889A Analog [ALC889A Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC889A Digital [ALC889A Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: ALC889A Alt Analog [ALC889A Alt Analog]
Subdevices: 2/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;  &lt;/div&gt;
  &lt;p&gt;Choose a device and specify it in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hw:CARD,DEVICE&lt;/code&gt; notation. In this case,
the first device is represented as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hw:0,0&lt;/code&gt;.&lt;/p&gt;

  &lt;p&gt;Edit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/pulse/default.pa&lt;/code&gt; and insert a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;load-module&lt;/code&gt; line specifying your
device as follows:&lt;/p&gt;

  &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;load-module module-alsa-source device=hw:0,0
# This line should be somewhere before the line
.ifexists module-udev-detect.so
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;  &lt;/div&gt;
  &lt;p&gt;Restart pulseaudio to apply the new settings:&lt;/p&gt;

  &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pulseaudio -k &amp;amp;&amp;amp; pulseaudio -D
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;After this, the microphone appeared in PulseAudio Volume Control.
I also selected the ‘Set as fallback’ option in PulseAudio Volumne Control.&lt;/p&gt;

&lt;p&gt;After this, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arecord&lt;/code&gt; worked without root, and Skype could find the microphone!
And the recorded audio was crystal clear, which was an improvement over the
crackly audio when recording as root.&lt;/p&gt;

</description>
        <pubDate>Mon, 03 Jul 2023 22:17:00 +1000</pubDate>
        <link>https://daviewales.com/2023/07/03/missing-microphone-on-mx-linux-21.3-on-imac8,1.html</link>
        <guid isPermaLink="true">https://daviewales.com/2023/07/03/missing-microphone-on-mx-linux-21.3-on-imac8,1.html</guid>
        
        
      </item>
    
      <item>
        <title>Almost Mac-like touchpad scrolling in Firefox and Thunderbird on Ubuntu 22.04</title>
        <description>&lt;p&gt;Some time ago, I spent some time trying to &lt;a href=&quot;/2020/04/27/macbook-pro-ubuntu-20-04-post-install.html&quot;&gt;configure scrolling in Firefox on
Ubuntu 20.04&lt;/a&gt;.
At the time I discovered &lt;a href=&quot;https://pavelfatin.com/scrolling-with-pleasure/#linux&quot;&gt;Pavel Fatin’s
recommendation&lt;/a&gt; to
launch Firefox with the environment variable &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MOZ_USE_XINPUT2=1&lt;/code&gt; set. This was
a good start, but scroll acceleration was still wonky, and kinetic scrolling
was non-existant.&lt;/p&gt;

&lt;p&gt;Recently, I updated to Ubuntu 22.04 on Wayland, and discovered a couple of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;about:config&lt;/code&gt; tweaks which render the previous workaround redundant,
and result in a much closer approximation of Mac-like scrolling, including both smooth scrolling and kinetic (inertial) scrolling.
The one missing feature is a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hold&lt;/code&gt; gesture to instantly stop the inertial scrolling, but a quick scroll in the opposite direction works almost as well.&lt;/p&gt;

&lt;p&gt;There is one caveat: This only works in the traditional &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.deb&lt;/code&gt; package version of Firefox.
If you’re using snaps, you can have the smooth scrolling, but not the kinetic scrolling. :(&lt;/p&gt;

&lt;h2 id=&quot;show-me-the-configs-already&quot;&gt;Show me the configs already!&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Make sure you’re using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.deb&lt;/code&gt; version of Firefox. (Instructions adapted from &lt;a href=&quot;https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04&quot;&gt;OMGUbuntu&lt;/a&gt;:&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; sudo snap remove firefox
 sudo add-apt-repository ppa:mozillateam/ppa

 echo &apos;
 Package: *
 Pin: release o=LP-PPA-mozillateam
 Pin-Priority: 1001
 &apos; | sudo tee /etc/apt/preferences.d/mozilla-firefox

 distro_codename=$(grep UBUNTU_CODENAME /etc/os-release | cut -d = -f 2)

 echo &apos;Unattended-Upgrade::Allowed-Origins:: &quot;LP-PPA-mozillateam:${distro_codename}&quot;;&apos; | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Go to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;about:config&lt;/code&gt; in Firefox and enable the following options:&lt;/p&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apz.gtk.kinetic_scroll.enabled=true&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apz.overscroll.enabled=true&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;em&gt;And&lt;/em&gt;… one more setting that I don’t recall, because Firefox restarted when I installed the deb version, and I lost all my recent tabs!
It was something that encouraged Firefox to use the built-in GTK scrolling, rather than reinventing the (scroll)wheel.
I think it might have been:&lt;br /&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apz.gtk.pangesture.enabled=true&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And… I think that’s it!
If &lt;a href=&quot;https://gitlab.freedesktop.org/libinput/libinput/-/issues/298&quot;&gt;three-finger drag gets implemented in libinput&lt;/a&gt;, I’ll be running out of excuses for staying on Mac!&lt;/p&gt;

&lt;h2 id=&quot;update-2022-11-22&quot;&gt;Update 2022-11-22:&lt;/h2&gt;

&lt;p&gt;The following tweaks make it even better:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;general.smoothScroll.mouseWheel.durationMaxMS=500&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;general.smoothScroll.mouseWheel.durationMinMS=250&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mousewheel.acceleration.start=1&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mousewheel.default.delta_multiplier_x=10&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mousewheel.default.delta_multiplier_y=10&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mousewheel.default.delta_multiplier_z=10&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks to Nitesh Kumar from Linux Hint for the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;general.smoothScroll.mouseWheel.duration*&lt;/code&gt; &lt;a href=&quot;https://linuxhint.com/fix-mouse-wheel-scrolling-sensitivity-in-latest-version-of-firefox/&quot;&gt;suggested values&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;thunderbird&quot;&gt;Thunderbird&lt;/h2&gt;

&lt;p&gt;You can also set most of these tweaks in Thunderbird using the &lt;a href=&quot;https://support.mozilla.org/en-US/kb/config-editor&quot;&gt;Config Editor&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Tue, 01 Nov 2022 02:33:00 +1100</pubDate>
        <link>https://daviewales.com/2022/11/01/almost-mac-like-touchpad-scrolling-in-firefox-on-ubuntu-22-04.html</link>
        <guid isPermaLink="true">https://daviewales.com/2022/11/01/almost-mac-like-touchpad-scrolling-in-firefox-on-ubuntu-22-04.html</guid>
        
        
      </item>
    
      <item>
        <title>Jailbreak an iPhone 3G running iOS 4.2.1 in 2021</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;“And some things that should not have been forgotten were lost. History became legend. Legend became myth. And for two and a half thousand years, the ring passed out of all knowledge.” ― Galadriel in The Fellowship of the Ring&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Big thanks to Lace Querux from the &lt;a href=&quot;https://discord.gg/bhDpTAu&quot;&gt;LegacyJailbreak community on Discord&lt;/a&gt; for patiently guiding me through the steps below. Also check out &lt;a href=&quot;https://www.reddit.com/r/LegacyJailbreak/&quot;&gt;r/LegacyJailbreak&lt;/a&gt; on reddit.&lt;/p&gt;

&lt;p&gt;The biggest challenge for legacy jailbreaking is that many of the old sources no longer exist.
It’s also hard to know exactly which version of which tool to use for your device just by searching the internet.
The aim of this post is to document the process in 2021 for an iPhone 3G running 4.2.1,
and to include some hopefully long-lasting Internet Archive links to everything you need.&lt;/p&gt;

&lt;h2 id=&quot;downloads&quot;&gt;Downloads&lt;/h2&gt;

&lt;p&gt;Note: I’ve included working Internet Archive links below in an attempt to future-proof this post.
However, you should also be able to get everything you need from the &lt;a href=&quot;https://mega.nz/folder/k4FAXCIB#Fk7pxs6ikYzL3YBvAGX5ig&quot;&gt;LegacyJailbreak Mega site&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You’ll need redsn0w. Version 0.9.6b4 is recommended. Why this particular version?&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I think the future versions have USB communication issues with first gen devices.
Or at least ones after the redesign might (0.9.9, where it doesn’t ask you for an IPSW whilst giving you more options).
0.9.6b4 is just a sure fire version, considering it came out with iOS 4.2.1 support in mind
— Lace Querux, LegacyJailbreak Discord&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s an Internet Archive link to an &lt;a href=&quot;https://web.archive.org/web/20101220134740/http://osxdaily.com/2010/11/23/redsn0w-0-9-6b4-download/&quot;&gt;OS X Daily article about redsn0w 0.9.6b4&lt;/a&gt;. And here are the Internet Archive versions of the links within that article to the redsn0w downloads:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://web.archive.org/web/20110124083230/http://www.iphone-storage.de/redsn0w_mac_0.9.6b4.zip&quot;&gt;redsn0w 0.9.6b4 for Mac&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://web.archive.org/web/20110124083228/http://cdn.nspwn.com//redsn0w_win_0.9.6b4.zip&quot;&gt;redsn0w 0.9.6b4 for Windows&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You’ll also need the iOS IPSW file for your specific device and version. At the moment, the best place to find this is the &lt;a href=&quot;https://ipsw.me/&quot;&gt;IPSW Downloads&lt;/a&gt; site, which provides a friendly user interface, and provides official Apple links to IPSW files.&lt;/p&gt;

&lt;p&gt;Alternatively, here is the direct Apple link for the &lt;a href=&quot;http://appldnld.apple.com/iPhone4/061-9853.20101122.Vfgt5/iPhone1,2_4.2.1_8C148_Restore.ipsw&quot;&gt;iPhone 3G iOS 4.2.1 IPSW&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;jailbreak&quot;&gt;Jailbreak&lt;/h2&gt;

&lt;p&gt;In theory, you should be able to do this from either Mac or Windows.
In practice, I couldn’t get it to work on my Mac. This could possibly be because my Mac has USB 3, and I have heard rumours that this causes issues. Instead, I got it working on my wife’s Windows laptop using her USB 2 port.&lt;/p&gt;

&lt;p&gt;In &lt;em&gt;theory&lt;/em&gt;, all you need to do now is launch redsn0w and follow the instructions. In practice, I had a bit of trouble getting into DFU mode. (More on that later…)&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Browse and select the IPSW file.&lt;/li&gt;
  &lt;li&gt;Select that you want to install Cydia. (I chose not to select any of the other options to keep things simple)&lt;/li&gt;
  &lt;li&gt;Follow the instructions in redsn0w to put the device in DFU mode.&lt;/li&gt;
  &lt;li&gt;redsn0w detects the device in DFU mode, jailbreaks it and installs Cydia.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Unfortunately, my power and home buttons are not 100%, and my phone kept either just rebooting, or entering recovery mode. (Recovery mode is when your phone has a picture of the iTunes logo on the screen. DFU is a black screen, but it’s still detected by redsn0w and iTunes.)&lt;/p&gt;

&lt;p&gt;Thankfully, Lace Querux was able to give me some tips, so here’s what worked for me to get the device in DFU mode.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;First get the device into recovery mode.
    &lt;ul&gt;
      &lt;li&gt;Start with the device connected to the computer and turned off.&lt;/li&gt;
      &lt;li&gt;Press the power button to start the device booting.&lt;/li&gt;
      &lt;li&gt;As soon as the device starts booting, release the power button and hold the home button until you see the iTunes logo on the screen.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Now that the device is in recovery mode, follow the steps in redsn0w for entering DFU, but &lt;strong&gt;skip the first step&lt;/strong&gt;:
    &lt;ol&gt;
      &lt;li&gt;Don’t do anything for step 1 where is says to just hold down the power button.&lt;/li&gt;
      &lt;li&gt;Hold down the home and power buttons together for the number of seconds specified in redsn0w (10 seconds)&lt;/li&gt;
      &lt;li&gt;Keep holding the home button, but release the power button for the number of seconds specified in redsn0w (15 seconds)&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At this point, redsn0w should detect that your device is in recovery mode and start the jailbreak!
Just sit back and watch the progress bars.&lt;/p&gt;

&lt;p&gt;However, on my Mac I got to this point and it got stuck. redsn0w detected the device in recovery mode, progress bars progressed on screen, but nothing happened on the device, and redsn0w got stuck “waiting for the device to reboot”. This is where I switched to my wife’s Windows computer and used her USB 2 port.&lt;/p&gt;

&lt;p&gt;This time it worked! A pineapple and a progress bar appeared on the iPhone screen and it’s jailbreaked!&lt;/p&gt;
</description>
        <pubDate>Sun, 11 Jul 2021 23:28:00 +1000</pubDate>
        <link>https://daviewales.com/legacyjailbreak/2021/07/11/jailbreak-iphone-3g-running-4.2.1-in-2021.html</link>
        <guid isPermaLink="true">https://daviewales.com/legacyjailbreak/2021/07/11/jailbreak-iphone-3g-running-4.2.1-in-2021.html</guid>
        
        
        <category>legacyjailbreak</category>
        
      </item>
    
      <item>
        <title>Twitch chat on original iPad in 2021</title>
        <description>&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: The following is almost certainly the WRONG way to do this. The right way is almost certainly to install &lt;a href=&quot;https://github.com/theos/theos&quot;&gt;Theos&lt;/a&gt; and create a custom Theos based Makefile to link everything together. (I’ll probably try to do this next)&lt;/p&gt;

&lt;h2 id=&quot;aim&quot;&gt;Aim&lt;/h2&gt;

&lt;p&gt;To get the Twitch chat to appear on the screen of my brother’s &lt;a href=&quot;https://en.wikipedia.org/wiki/IPad_(1st_generation)&quot;&gt;original iPad&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;obstacles&quot;&gt;Obstacles&lt;/h2&gt;

&lt;p&gt;iOS 5.1.1 is the latest version of iOS which runs on the original iPad. It was released in 2012.
In 2021, this is what Twitch looks like in Safari on iOS 5.1.1:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/twitch-on-original-ipad.png&quot; alt=&quot;Twitch on original iPad in 2021&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Safari just doesn’t know what to do with the modern web.&lt;/p&gt;

&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Twitch has an &lt;a href=&quot;https://dev.twitch.tv/docs/irc/guide&quot;&gt;IRC interface&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;You can easily jailbreak the original iPad with the Absinthe jailbreak.&lt;/li&gt;
  &lt;li&gt;You can get iOS Terminal from the BigBoss Cydia repo.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://rcr.io/rirc/&quot;&gt;rirc&lt;/a&gt; is an open source Terminal IRC client written in C.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;plan&quot;&gt;Plan&lt;/h2&gt;

&lt;p&gt;Could we get a terminal based IRC client running in the iOS Terminal on a jailbroken iPad?
And if so, could we connect it to Twitch to get the Twitch chat?&lt;/p&gt;

&lt;p&gt;Spoilers: YES.&lt;/p&gt;

&lt;h2 id=&quot;method&quot;&gt;Method&lt;/h2&gt;

&lt;p&gt;Note: I’m going to assume you know some basic things about a *nix terminal environment,
such as navigating to different directories, running commands, etc.
If not, there are plenty of tutorials waiting for you!&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Add some essential Cydia repos:
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://cydia.akemi.ai/&quot;&gt;Karen’s Repo&lt;/a&gt; (Needed to install AppSync Unified)&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;http://repo.bingner.com/&quot;&gt;Sam Bingner’s Repo&lt;/a&gt; (Needed for Theos dependencies)&lt;/li&gt;
      &lt;li&gt;BigBoss (Should be pre-installed with Cydia) (Needed for a bunch of things)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Install &lt;em&gt;iOS Terminal&lt;/em&gt;, &lt;em&gt;iOS Toolchain&lt;/em&gt; and &lt;em&gt;Theos Dependencies&lt;/em&gt; from BigBoss to get the basics installed.&lt;/li&gt;
  &lt;li&gt;Install &lt;em&gt;AppSync Unified&lt;/em&gt; from Karen’s repo. (Required to run apps which don’t have a valid Apple signature)&lt;/li&gt;
  &lt;li&gt;Get a copy of the iOS 5.1 SDK. (I extracted it from a copy of Xcode 4.3.1 which I downloaded from the Apple Developer portal using a free developer account. But there are also copies floating around on other websites.) It’s apparently possible to build for the original iPad using newer SDKs, but I wasn’t sure, so I went with the 5.1 SDK.&lt;/li&gt;
  &lt;li&gt;Copy the iOS 5.1 SDK to the iPad. I just zipped it and ran a local http server on my laptop with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3 -m http.server&lt;/code&gt;, then connected the iPad to it and downloaded the SDK. Then in the iOS Terminal I unzipped it with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unzip the-name-of-the-sdk.zip&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Download the rirc source code.
This is complicated by the fact that GitHub has dropped support for TLS 1.1, and so far as I can tell,
iOS 5.1.1 doesn’t have great support for TLS 1.2, which is the minimum required to talk to GitHub.
There are a couple of options.
The secure way is to download the code onto your computer, and then share it to the iPad
(e.g. using the python server method above.)
The lazy way is to use an unencrypted connection to GitHub.
GitHub automatically redirects HTTP to HTTPS, but you can still get an unencrypted connection by swapping to the git protocal.
So, instead of&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/rcr/rirc.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;you would use&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone git://github.com/rcr/rirc.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;This will be unencrypted, which is bad for security, but should still work perfectly on iOS 5.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Patch the Makefiles. Someone really needs to make a tweak for old iOS versions to upgrade them to TLS 1.3.
But until then, we’re going to keep hitting those TLS errors whenever we try to access modern secure sites.
There is a Makefile in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lib/mbedtls.Makefile&lt;/code&gt; which tries to download a compressed file from GitHub using HTTPS.
The smart thing to do would be to download the file ourselves and transfer it to the iPad,
then patch the Makefile to look for the file in a local directory.
The lazy way is to temporarily host the file on our trusty &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3 -m http.server&lt;/code&gt;,
and swap out the link in the Makefile. Here’s a very minimal diff:&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;-MBEDTLS_URL := https://github.com/ARMmbed/mbedtls/archive/v$(MBEDTLS_VER).tar.gz
+MBEDTLS_URL := http://10.1.1.2:8000/mbedtls-2.25.0.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;While we’re at it, we’re going to need to strip out the SHA hash checks, because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shasum&lt;/code&gt; didn’t want to work at all.
Here’s another very minimal diff:&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;-       @eval $(MBEDTLS_SHA_FILE)
-       @eval $(MBEDTLS_SHA_CHECK)
+       #@eval $(MBEDTLS_SHA_FILE)
+       #@eval $(MBEDTLS_SHA_CHECK)

-ifneq ($(shell command -v shasum 2&amp;gt;/dev/null),)
-MBEDTLS_SHA_FILE  := &apos;echo &quot;$(MBEDTLS_VER_SHA)  $(MBEDTLS_TAR)&quot; &amp;gt; $(MBEDTLS_SHA)&apos;
-MBEDTLS_SHA_CHECK := &apos;shasum -c $(MBEDTLS_SHA)&apos;
-endif
+#ifneq ($(shell command -v shasum 2&amp;gt;/dev/null),)
+#MBEDTLS_SHA_FILE  := &apos;echo &quot;$(MBEDTLS_VER_SHA)  $(MBEDTLS_TAR)&quot; &amp;gt; $(MBEDTLS_SHA)&apos;
+#MBEDTLS_SHA_CHECK := &apos;shasum -c $(MBEDTLS_SHA)&apos;
+#endif
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;Once again, this is terrible for security,
but if you’re motivated you can run these checks on your computer before you send the file to the iPad.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Copy the iOS SDK dylibs to where the build system expects to find them.
Note that I’m using $THEOS paths here, but you should be able to adapt this to wherever path you’ve saved the SDK:&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# switch to super user (root)
su
# create a symlink to the dylibs in the SDK.
# You could probably just copy instead of linking, but linking worked fine.
ln -s /var/mobile/theos/sdks/iPhoneOS5.1.sdk/usr/lib/system/* /usr/lib/system/
# switch back to regular user
exit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;BUILD THE THING!&lt;br /&gt;
Assuming you’ve done all of the above, and I haven’t missed any steps,
you should be able to build &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rirc&lt;/code&gt; by simply running the following in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rirc&lt;/code&gt; directory:&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;CC=clang CFLAGS=-I/var/mobile/theos/sdks/iPhoneOS5.1.sdk/usr/include LDFLAGS=-L/var/mobile/theos/sdks/iPhoneOS5.1.sdk/usr/lib/  make
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;You’ll get a bunch of warnings, because we’re building with a very outdated version of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;clang&lt;/code&gt;, but hopefully no errors.
After a few seconds, you should end up with a shiny new &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./rirc&lt;/code&gt; executable.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Fake sign the executable.&lt;br /&gt;
If you try to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./rirc&lt;/code&gt; now, you’ll get a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;killed: 9&lt;/code&gt; error.
This is because the iPad is unhappy that you’re running an unsigned app.
Assuming you’ve installed AppSync Unified (see step 1), you just need to fake sign the executable.
To do this, just run the following:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ldid -S rirc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Now you should be good to go! Try connecting to Libera Chat (or your favourite IRC server):
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./rirc -s irc.libera.chat -p 6697
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;To join a channel, type &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/join #channel-name&lt;/code&gt;.
You can use this to connect to Twitch chat over IRC.
Just use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rirc&lt;/code&gt; command from my
&lt;a href=&quot;https://daviewales.com/twitch/irc/cli/2021/07/05/twitch-chat-in-rirc-irc-client.html&quot;&gt;previous post&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;some-images&quot;&gt;Some images:&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;/images/rirc-libera-chat-ipad-1.png&quot; alt=&quot;Connected to Server&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/rirc-irc-join-channel-ipad-1.png&quot; alt=&quot;Input glitch&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/rirc-irc-channel-joined-ipad-1.png&quot; alt=&quot;Channel Joined&quot; /&gt;&lt;/p&gt;

</description>
        <pubDate>Mon, 05 Jul 2021 21:00:00 +1000</pubDate>
        <link>https://daviewales.com/twitch/irc/ipad/legacyjailbreak/2021/07/05/twitch-chat-on-original-ipad-in-2021.html</link>
        <guid isPermaLink="true">https://daviewales.com/twitch/irc/ipad/legacyjailbreak/2021/07/05/twitch-chat-on-original-ipad-in-2021.html</guid>
        
        
        <category>twitch</category>
        
        <category>irc</category>
        
        <category>ipad</category>
        
        <category>legacyjailbreak</category>
        
      </item>
    
      <item>
        <title>Twitch chat in rirc command-line IRC client</title>
        <description>&lt;p&gt;Today I got the Twitch chat running using the &lt;a href=&quot;https://github.com/rcr/rirc&quot;&gt;rirc&lt;/a&gt; command-line IRC client.&lt;/p&gt;

&lt;p&gt;Here are the steps so I remember next time I want to do this…&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Build rirc
The generic instructions are on the &lt;a href=&quot;https://rcr.io/rirc/&quot;&gt;rirc website&lt;/a&gt;. But I had some mac specific issues which are only solved in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dev&lt;/code&gt; branch as of this post. So, for me I needed to do the following:
    &lt;ul&gt;
      &lt;li&gt;Clone the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dev&lt;/code&gt; branch of rirc from &lt;a href=&quot;https://github.com/rcr/rirc&quot;&gt;GitHub&lt;/a&gt;:
        &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone git@github.com:rcr/rirc.git # The dev branch is currently the default branch
cd rirc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;Build:
        &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;make
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;I didn’t want to install it to the system, so I didn’t run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;make install&lt;/code&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Connect to Twitch over IRC using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rirc&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;Use this link to &lt;a href=&quot;https://twitchapps.com/tmi/&quot;&gt;get an authentication token&lt;/a&gt;. Twitch IRC uses this instead of a password.&lt;/li&gt;
      &lt;li&gt;Assuming you are still in the directory where you built &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rirc&lt;/code&gt;, there should be an executable called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rirc&lt;/code&gt;.
Run the following command, replacing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;authentication_token&amp;gt;&lt;/code&gt; with the token you got in the previous step, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;username&amp;gt;&lt;/code&gt; with your Twitch username:
        &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./rirc -s irc.chat.twitch.tv -p 6697 -w &amp;lt;authentication_token&amp;gt; -n &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
        &lt;p&gt;If it’s working, you should see something like this:&lt;/p&gt;

        &lt;p&gt;&lt;img src=&quot;/images/rirc-twitch-irc.png&quot; alt=&quot;Twitch IRC in rirc&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Join your desired channel
    &lt;ul&gt;
      &lt;li&gt;IRC commands are prepended by a forward slash (/). IRC channels are prepended by a hash (#).
So for example, to join the channel &lt;a href=&quot;https://www.twitch.tv/bandersaur&quot;&gt;bandersaur&lt;/a&gt;, you would type the following IRC command:
        &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/join #bandersaur
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
        &lt;p&gt;If it worked, you should see something like:&lt;/p&gt;

        &lt;p&gt;&lt;img src=&quot;/images/rirc-join-twitch-channel.png&quot; alt=&quot;Join Twitch Channel&quot; /&gt;&lt;/p&gt;

        &lt;p&gt;If it’s working you should now be able to send and receive messages!&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

</description>
        <pubDate>Mon, 05 Jul 2021 01:00:00 +1000</pubDate>
        <link>https://daviewales.com/twitch/irc/cli/2021/07/05/twitch-chat-in-rirc-irc-client.html</link>
        <guid isPermaLink="true">https://daviewales.com/twitch/irc/cli/2021/07/05/twitch-chat-in-rirc-irc-client.html</guid>
        
        
        <category>twitch</category>
        
        <category>irc</category>
        
        <category>cli</category>
        
      </item>
    
      <item>
        <title>Ratio of age in the limit</title>
        <description>&lt;p&gt;Have you ever noticed that for any two people with different ages,
you can always figure out a moment in time when the younger person was exactly half the age of the older person?&lt;/p&gt;

&lt;p&gt;Let’s say that you are \(18\) and your friend is \(23\), so there is a \(5\) year difference in your ages.
Then, when you were \(5\), your friend was \(10\), so that was the moment when the ratio of your ages was exactly half.&lt;/p&gt;

&lt;p&gt;Does this work for all age differences?&lt;/p&gt;

&lt;p&gt;Let the initial age of the younger person be \(0\), and the age of the older person be \(a\).
Then, at any time \(t\) after this, the age of the younger person is \(0 + t\)
and the age of the older person is \(a + t\).&lt;/p&gt;

&lt;p&gt;Hence the ratio of the ages of the two people at any time \(t\) is&lt;/p&gt;

&lt;p&gt;\[
  \frac{0 + t}{a + t}.
\]&lt;/p&gt;

&lt;p&gt;Let’s look at what happens when we substitute different values for \(t\).
We will also let \(a = 5\) to say that the second person is \(5\) years older than the first.
If we let &lt;math&gt; &lt;mi&gt;t&lt;/mi&gt; &lt;mo&gt;=&lt;/mo&gt; &lt;mn class=&quot;time&quot;&gt;0&lt;/mn&gt; &lt;/math&gt;, then&lt;/p&gt;

&lt;div class=&quot;mathml-display-outer&quot;&gt;
&lt;div class=&quot;mathml-display-inner&quot;&gt;
&lt;math&gt;
  &lt;mstyle displaystyle=&quot;true&quot;&gt;
  &lt;mfrac&gt;
    &lt;mrow&gt; &lt;mn&gt;0&lt;/mn&gt; &lt;mo&gt;+&lt;/mo&gt; &lt;mn class=&quot;time&quot;&gt;0&lt;/mn&gt; &lt;/mrow&gt;
    &lt;mrow&gt; &lt;mn&gt;5&lt;/mn&gt; &lt;mo&gt;+&lt;/mo&gt; &lt;mn class=&quot;time&quot;&gt;0&lt;/mn&gt; &lt;/mrow&gt;
  &lt;/mfrac&gt;
  &lt;mo&gt;=&lt;/mo&gt;
  &lt;mn id=&quot;ratio&quot;&gt;0&lt;/mn&gt;
  &lt;/mstyle&gt;
&lt;/math&gt;.
&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;mathml-display-outer&quot;&gt;
&lt;div class=&quot;mathml-display-inner&quot;&gt;
&lt;div class=&quot;slidecontainer&quot;&gt;
  &lt;input type=&quot;range&quot; min=&quot;0&quot; max=&quot;50&quot; value=&quot;0&quot; class=&quot;slider&quot; id=&quot;slider_value&quot; /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Note: If you are viewing this in Chrome and you can’t see the fraction,
you need to enable &lt;a href=&quot;https://www.w3.org/Math/&quot;&gt;MathML&lt;/a&gt; by pasting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chrome://flags/#enable-experimental-web-platform-features&lt;/code&gt;
into the address bar, enabling Experimental Web Platform features,
and restarting Chrome.&lt;/p&gt;

&lt;div id=&quot;canvas-container&quot;&gt;
  &lt;canvas id=&quot;plot&quot;&gt;HTML5 Canvas not supported in this browser&lt;/canvas&gt;
&lt;/div&gt;

&lt;p&gt;The graph above plots the ratio of the two ages over time. As you move the
slider, you can see that as time approaches infinity, the ratio of the two ages
approaches 1.&lt;/p&gt;

&lt;p&gt;(NOTE: The graph is very glitchy if you move the slider quickly, and it doesn’t
undo the plot when you slide back to the left. However, I’ve procrastinated
publishing this post for three years because I haven’t been motivated to create
a proper minimal plotting library for it, so I’m just publishing it as-is…)&lt;/p&gt;

&lt;p&gt;We can also prove this mathematically using the concept of a limit:&lt;/p&gt;

&lt;div class=&quot;mathml-display-outer&quot;&gt;
&lt;div class=&quot;mathml-display-inner&quot;&gt;
&lt;math display=&quot;block&quot;&gt;&lt;mtable columnalign=&quot;left&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;munder&gt;&lt;mi&gt;lim&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;→&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∞&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mi&gt;lim&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;→&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∞&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;/&lt;/mo&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;/&lt;/mo&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;/&lt;/mo&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mi&gt;lim&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;→&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∞&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;/&lt;/mo&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mi&gt;lim&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;→&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∞&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;style&gt;
.mathml-display-inner {
}

.mathml-display-outer {
    width: 100%;
    display: flex;
    justify-content: center;
}

math {
    font-family: KaTeX_Main, &quot;Times New Roman&quot;, serif;
    font-size: 1.21em;
}

#canvas-container {
    width: 100%;
    height: 300px;
}

&lt;/style&gt;

&lt;script&gt;
  // Fraction values
  let younger = 0
  let older = 5
  let y_max = 1
  //let y_max = 150
  let time_slider = document.getElementById(&quot;slider_value&quot;)
  let times = document.getElementsByClassName(&quot;time&quot;)

  function calculateRatio(younger, older, time) {
      return (younger + time) / (older + time)
  }

  function transform_axis(scale, translate) {
      return function(x) {
          return scale * x + translate
      }
  }

  function units_per_pixel(min_unit, max_unit, pixels) {
  // FIXME Not sure if we need this function?
      return (max_unit - min_unit) / pixels
  }

  function f(t) {return calculateRatio(younger, older, t)}

  function points(f, min_x, max_x, n) {
  // Evaluate the function f over n points between min_x and max_x
      scale = (max_x - min_x) / n

      // We generate integer values then scale them rather than generating
      // float values and incrementing by the size of the scale directly in
      // the loop in an attempt to avoid compounding floating point errors.
      // Not sure how necessary this is!
      x_values = []
      for (let i = 0; i &lt; n; i++) {
          x_values[i] = scale * i
      }

      y_values = x_values.map(f)
      return [x_values, y_values]
  }

  function plot(f, a, b, min_x_axis, max_x_axis, canvas) {
  // plot the function f over the interval [a,b]
  // on the axis bounded by min_x_axis and max_x_axis
  // e.g. plot(f, 0, 10, 0, 10) fits a plot of f exactly
  // within the axis boundaries.
  // plot(f, 0, 10, 0, 20) fits a plot of x such that the
  // plot goes from x=0 to x=10, but the canvas goes from
  // x=0 to x=20
  // The function is plotted on the given canvas

  // For maximum smoothness, we want to calculate as many points as
  // there are pixels in canvas.width
  // If we are plotting a domain over a subset of the horizontal axis,
  // we still want to calculate an x value for each pixel


  let y_max = 2 // Replace with actual range

  let x_scale_factor = canvas.width / max_x_axis
  let y_scale_factor = -1 * canvas.height / y_max
  let y_translation = canvas.height
  

  }

  // Canvas live plot
  let canvas = document.getElementById(&quot;plot&quot;)
  let rect = canvas.parentNode.getBoundingClientRect()
  canvas.width = rect.width
  canvas.height = rect.height
  let context = canvas.getContext(&quot;2d&quot;)

  let x_scale_factor = canvas.width / +time_slider.max
  let y_scale_factor = -1 * canvas.height / y_max
  let y_translation = canvas.height

  let X = transform_axis(x_scale_factor, 0)
  let Y = transform_axis(y_scale_factor, y_translation)

  //context.save()
  //context.translate(0, canvas.height)
  //context.scale(x_scale_factor, y_scale_factor)

  context.moveTo(X(0), Y(0));

  // Time Slider Callback
  time_slider.oninput = function() {
    for (let i = 0; i &lt; times.length; i++) {
        times[i].innerHTML = time_slider.value;
    }
    ratio = document.getElementById(&quot;ratio&quot;);
    var ratio_value = calculateRatio(younger, older, +time_slider.value)
    ratio.innerHTML = ratio_value.toFixed(2);

    console.log({
      width: canvas.width,
      height: canvas.height,
      slider: +time_slider.value,
      ratio: +ratio_value,
      x_slider: X(+time_slider.value),
      y_slider: Y(+ratio_value),
      x_scale_factor: x_scale_factor,
      y_scale_factor: y_scale_factor,
    })
    context.lineTo(X(+time_slider.value), Y(+ratio_value))
    context.stroke()
  }

&lt;/script&gt;

</description>
        <pubDate>Fri, 04 Sep 2020 07:22:00 +1000</pubDate>
        <link>https://daviewales.com/2020/09/04/ratio-of-age-in-the-limit.html</link>
        <guid isPermaLink="true">https://daviewales.com/2020/09/04/ratio-of-age-in-the-limit.html</guid>
        
        
      </item>
    
      <item>
        <title>Troubleshooting Ubuntu 20.04 on a 2014 MacBook Pro 11,2</title>
        <description>&lt;p&gt;I recently installed Ubuntu 20.04 on my mid 2014 MacBook Pro 11,2.
Most things worked out of the box, but there were a few things which required tweaking.
The following post records these tweaks. The most useful sources for this post were the Arch wiki pages, specifically the &lt;a href=&quot;https://wiki.archlinux.org/index.php/MacBookPro11,x&quot;&gt;MacBookPro11,x page&lt;/a&gt; and the &lt;a href=&quot;https://wiki.archlinux.org/index.php/Mac&quot;&gt;general Mac page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;My first impression of Ubuntu 20.04 was that it was extremely slow. It was slow to login, slow to launch applications, slow to scroll in Firefox, slow to register keyboard input.
My second impression was that my laptop was much hotter than usual. After resolving these issues, I realised that the webcam was also non-functional. Additionally, audio playback through my Bluetooth speaker was stuttery. Fortunately, all these issues can be resolved!&lt;/p&gt;

&lt;h2 id=&quot;problem-1-high-laptop-temperature&quot;&gt;Problem 1: High laptop temperature&lt;/h2&gt;

&lt;p&gt;Firstly, we need to install a better fan control daemon to get the CPU temperature under control.
There are two options here:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/linux-on-mac/mbpfan&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mbpfan&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/MikaelStrom/macfanctld&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;macfanctld&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I installed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mbpfan&lt;/code&gt; which appears to be more actively maintained:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;mbpfan
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;problem-2-high-cpu-usage&quot;&gt;Problem 2: High CPU usage&lt;/h2&gt;

&lt;p&gt;Secondly, we need fix the high CPU usage.
According to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;top&lt;/code&gt;, the process &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kworker&lt;/code&gt; was consistently using more than 50% of one of the CPU cores. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;htop&lt;/code&gt; appears to hide kernel processes by default, so it’s easier just to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;top&lt;/code&gt; here.
Searching this issue led to a section of the Arch wiki Mac page helpfully titled &lt;a href=&quot;https://wiki.archlinux.org/index.php/Mac#kworker_using_high_CPU&quot;&gt;kworker using high CPU&lt;/a&gt;. According to the wiki, this is ‘sometimes the result of runaway ACPI interrupts’. This appears to be generally true for the MacBook Pro 11,2. To check if an ACPI interrupt is causing problems, run the following:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; /sys/firmware/acpi/interrupts/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Look for an interrupt with hundreds of thousands of interrupts. For a MacBook Pro 11,2, it’s probably &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpe06&lt;/code&gt;. (Don’t be fooled by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpe_all&lt;/code&gt;; I’m pretty sure it includes the total number of interrupts from all the numbered &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpexx&lt;/code&gt;, including &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpe06&lt;/code&gt;.)&lt;/p&gt;

&lt;p&gt;On my system, I found the following output:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/sys/firmware/acpi/interrupts/gpe06:38821921
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Check that this is the problem by manually disabling it (you might need to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo&lt;/code&gt;):&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;disable&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /sys/firmware/acpi/interrupts/gpe06
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Checking &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;top&lt;/code&gt;, you should notice that CPU usage has dropped to somewhere close to 2%.
You should also notice that that entire system is rapidly becoming more responsive.&lt;/p&gt;

&lt;p&gt;If disabling &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpe06&lt;/code&gt; resolved the issue, we need to make sure that it permanently disabled.
Some have suggested creating a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd&lt;/code&gt; script or a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cron&lt;/code&gt; job to run the command above on boot. However, &lt;a href=&quot;https://bugzilla.kernel.org/show_bug.cgi?id=117481&quot;&gt;the official solution&lt;/a&gt; is to add the following kernel boot parameter to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grub&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;acpi_mask_gpe=0x06
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For example, I edited the file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/default/grub&lt;/code&gt; and added &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;acpi_mask_gpe=0x06&lt;/code&gt; to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GRUB_CMDLINE_LINUX_DEFAULT&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;GRUB_CMDLINE_LINUX_DEFAULT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;quiet splash acpi_mask_gpe=0x06&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Apparently you can also just add it to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GRUB_CMDLINE_LINUX&lt;/code&gt;.
Don’t forget to update &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grub&lt;/code&gt; with the new settings by running:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;update-grub
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;problem-3-webcam-doesnt-work&quot;&gt;Problem 3. WebCam doesn’t work&lt;/h2&gt;

&lt;p&gt;The MacBook Pro 11,2 has a Broadcom 1570 720p FaceTime HD Camera.
There is no official kernel support for this device, nor are there any official drivers available.
However, there is a third party reverse engineered driver called &lt;a href=&quot;https://github.com/patjak/bcwc_pcie&quot;&gt;bcwc_pcie&lt;/a&gt;. I followed the &lt;a href=&quot;https://github.com/patjak/bcwc_pcie/wiki/Get-Started&quot;&gt;installation instructions&lt;/a&gt; on the wiki, but initially I encountered a known issue where &lt;a href=&quot;https://github.com/patjak/bcwc_pcie/issues/49&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/video&lt;/code&gt; is not created&lt;/a&gt;. Strangely, after &lt;a href=&quot;https://github.com/patjak/bcwc_pcie/issues/49#issuecomment-277579201&quot;&gt;following some steps involving &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;insmod&lt;/code&gt;&lt;/a&gt; everything worked. I’m not sure whether simply &lt;a href=&quot;https://github.com/patjak/bcwc_pcie/wiki/Get-Started#make-driver-load-correctly-on-startup&quot;&gt;adding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;facetimehd&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/modules&lt;/code&gt;&lt;/a&gt; and restarting would have worked too.&lt;/p&gt;

&lt;h2 id=&quot;problem-4-bluetooth-audio-stutters&quot;&gt;Problem 4. Bluetooth audio stutters&lt;/h2&gt;

&lt;p&gt;I was able to connect to my bluetooth speaker without issue, but audio playback stuttered so much that it was unusable.
After looking at a few possible fixes, the &lt;a href=&quot;https://askubuntu.com/a/1231049&quot;&gt;simplest&lt;/a&gt; was to install Pulseaudio Volume Control, and change the the latency offset to 45 ms.&lt;/p&gt;

&lt;h2 id=&quot;problem-5-fix-smooth-scrolling-in-firefox&quot;&gt;Problem 5. Fix smooth scrolling in Firefox&lt;/h2&gt;

&lt;p&gt;After fixing all of the above, scrolling in Firefox was still the opposite of smooth. The solution is to force Firefox to use the high-precision touchpad events available in XInput 2.1 as described in Pavel Fatin’s blog post &lt;a href=&quot;https://pavelfatin.com/scrolling-with-pleasure/#linux&quot;&gt;Scrolling with pleasure&lt;/a&gt;. You need to ensure that Firefox launches with the environment variable &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MOZ_USE_XINPUT2=1&lt;/code&gt; set. For me, the simplest way to do this was to add the following line to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.profile&lt;/code&gt;, then logout and login again:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MOZ_USE_XINPUT2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After this, Firefox will scroll like you’re using a touchpad, not a scrollwheel with discrete clickpoints! (Still not quite as good as scrolling on Mac, but it’s a start!)&lt;/p&gt;
</description>
        <pubDate>Mon, 27 Apr 2020 06:19:00 +1000</pubDate>
        <link>https://daviewales.com/2020/04/27/macbook-pro-ubuntu-20-04-post-install.html</link>
        <guid isPermaLink="true">https://daviewales.com/2020/04/27/macbook-pro-ubuntu-20-04-post-install.html</guid>
        
        
      </item>
    
  </channel>
</rss>
