Guix Migration

I made a dramatic move last weekend, switching my home desktop PC from Debian 9 to Guix System 1.0.1. The transition has been an ongoing process over the last week, with some challenges that I’m still working through, but Guix is so much fun to work with that I don’t mind.

Some of my preferred applications have not made it into Guix yet, or I could not get them to work under Guix, so I’ve been learning a few substitute applications. E.g., I couldn’t get Raptor chess client to work with Guix Java libraries (I think Raptor is too old) so I switched to Xboard to play FICS. Xboard in Guix seems to be a nice enough client for my needs.

In Guix, you can update the System separately from your user applications. It is kind of like the ability to have your System running from Debian 9 repository but all your applications running from Debian 10. So I’ve kept my System running Guix System 1.0.1 with the user applications running from the latest Guix pull. I actual tried to upgrade to a new version of System, but ran into trouble after a reboot logging into Gnome, so I just rolled back to 1.0.1, which is about a 1 second process in Guix, not counting the computer reboot.

One cool thing, aside from the ability to be running a very recent Emacs (26.3), is access to every Emacs package imaginable, including the emacs-guix package for managing your Guix system from Emacs.

I found out that Warzone2100 package works great in Guix, whereas it was pretty much half-broken in Debian 9. One of the problems with Warzone2100 in Debian is that the JavaScripts that ran a lot of the game logic broke in the transition from Debian 8 to Debian 9, and nobody wanted to invest the energy to fix it. But that sort of thing is not an issue in Guix because Guix allows every versions of every package to have unique versions of all their dependencies if needed.

Guix is basically a “have your cake and eat it too” distro with the ability to have the latest and greatest of everything (potentially) but also the ability to roll back at a moments notice, while cleanly dodging the bullet of dependency hell. I’m still working through some issues, for sure (e.g., a problem getting my cups printer to show up in Gnome dialog box). But Guix is truly the hacker’s distro.

Advertisement

Remote TCP Dump for Wireshark

ssh root@host.example.com 'tcpdump -i eth0 -c 1000 -w -' > host.pcap

This command logs into the remote system, captures 1000 packets with tcpdump, and saves them to local file host.pcap in pcap format for analysis by Wireshark.

This is a simple and quick command. If performance was a concern, e.g., if you needed to capture 10 billion packets per second, you might need to take a different approach.

Guile: (buffer repository)

In a step towards constructing my block-programming framework, I coded this (buffer repository) module:

(buffer repository)
(buffer repository tests)

(make-buffer-repository smallest-pwr largest-pwr)

 A procedure in module (buffer repository).
 Make a buffer repository instance. Parameters refer to the sizes of buffers
  stored in the repository. The smallest size is 2 to the smallest-pwr, the
  largest is 2 to the largest-pwr. 

(checkout-buffer! requested-bytes (buffer-repository) (#:spawn))

A procedure in module (buffer repository).

Checkout a buffer (bytevector) from the buffer-repository. If
 buffer-repository is not specified, parameter %buffer-repository is
 used. The default action, if a buffer is not available from the
 appropriate size bucket, is to generate a new buffer. If #:spawn #f is
 passed, checkout-buffer! will throw the 'empty-bucket exception
 instead. The buffer returned might be larger than the number of bytes
 requested. A 'no-match exception will be thrown if the size-requested
 is not in the range of buffer sizes stored by the buffer-repository.

(checkin-buffer! buffer (buffer-repository))

A procedure in module (buffer repository).

Return a buffer (bytevector) to the buffer-repository. If
 buffer-repository is not specified, parameter %buffer-repository is
 used. It is the responsibility of the calling code not to use the
 buffer after it has been checked in. Technically the buffer does not
 have to be one that was originally checked-out from the
 buffer-repository, but checkin-buffer will throw exceptions if the
 buffer is not the proper size to fit in a repository bucket.

git clone git://git.librehacker.com/pub/git/hackrf-rkt.git

Fun with wxMaxima: Semicircle Tangent

I have been working through some pre-calculus problems, and wxMaxima is a fun tool to play with:

wxMaxima provides a mathematical workbook environment. Maxima is a Computer Algebra System coded in Common Lisp back in the 80s.

In the screenshot you can see the semi-circle function f(x), and the function h(x, x_2) generates the tangent line for any point on the semicircle. The helpful feature exhibited here is partial application, allowing me to specify, e.g., h(x,20), to provide the graph with a new function, the tangent line attached to that point on the semi-circle. With a little more work, I could generalize h to allow passing in any semicircle function.

I wanted to upload the wxmx file, but wordpress.com does not permit upload that file type, for reasons that are beyond me.