Daily blurbs Apr. 2021


daily blurbs

29 Apr 2021 (Thu)

09:23:22 # Life Surrounding a region with Emacs lisp. I wanted to surround a region with HTML tags and here's what I learnt today. Specifying "r" in interactive gives two numbers, begin and end. When I want to obtain multiple kinds of values in interactive, I can use newlines to delimit. set-marker is an api to keep a marker at relative position even after edits, API needs making make-marker to create an empty marker first, and seems like the number of markers affects editing speed so the API is made to allow reuse of markers. After I got these going I could now write.

(defun dancer-region-tag (begin end tag)
  "Surround region with TAG"
  (interactive "r\nsTag:")
  (goto-char end)
  (insert tag)
  (let* ((real-end (set-marker (make-marker) (point))))
    (goto-char begin)
    (insert tag)
    (goto-char real-end)))

10:42:10 # Life Setting wake-on-lan in Debian way. There's several ways that your network interfaces can be configured. The Debian way is to use ifup/ifdown. Make sure your network is configured with it by checking ifquery. nmcli d and networkctl list are NM and systemd equivalents of commands. After you know which one is managing your device you can go ahead and set up WoL configuration appropriately. Default Debian installation would probably start with a ifup/ifdown config.

$ nmcli d
eno1    ethernet  unmanaged  --         
lo      loopback  unmanaged  --

$ sudo ifquery -l --allow=hotplug
$ sudo ifquery -l

$ sudo networkctl list
WARNING: systemd-networkd is not running, output will be incomplete.

  1 lo   loopback n/a         unmanaged
  2 eno1 ether    n/a         unmanaged

2 links listed.

If your network configuration is managed with ifup, then refer to /usr/share/doc/ethtool/README.Debian for configuration. ethernet-wol g line allows enabling waking from magic packet. My configuration added a line and looks like this now:

# The primary network interface
allow-hotplug eno1
iface eno1 inet dhcp
# This is an autoconfigured IPv6 interface
iface eno1 inet6 auto
        ethernet-wol g


28 Apr 2021 (Wed)

15:01:31 # Life Swapping caps and control in X11. The configuration is at /etc/default/keyboard, and both virtual console and X11 use that configuration in Debian. For systemd users, systemd-localed.service can be used to configure using localectl(1) command, and Debian systemd has been patched to update /etc/default/keyboard (managed by keyboard-configuration package). Not sure where I find a documentation for this. systemd for Debian is patched with debian/patches/debian/Use-Debian-specific-config-files.patch to change /etc/X11/xorg.conf.d/00-keyboard.conf to /etc/default/keyboard.

	  $ sudo localectl set-x11-keymap us pc105 us ctrl:swapcaps
	  $ cat /etc/default/keyboard 

26 Apr 2021 (Mon)

08:40:36 # Life Got a new machine Lenovo ThinkCenter M75s gen2, and installed Debian on it. I wanted to try out the ryzen CPU. I haven't used a physical x86-64 Debian desktop machine since I threw away my Athlon 64 machine (dx5150), so that's like 15 years? Since then my main devices were macbooks and virtual machines (on GCE and Sakura) and raspberry pi. I got buster installed just fine. Finding the right keystrokes after boot was challenging because the graphical UI doesn't say anything. For BIOS set up to disable secure boot (F1 to enter set up: I wanted to play with kernel) and finding the keystroke to choose the boot disk (F10 to enter the dialog; I needed to choose the one labeled USB CD drive although I put in a USB SD card reader with installer image). The installation went fine for console, but getting X up was tricky, the support for the graphics (Renoir) part of the chip was added in kernel 5.5. Bullseye was 4.19 and I wasn't too comfortable with just updating the kernel. I ended up going for dist-upgrade to Bullseye. With Bullseye default kernel 5.10, X started without problems. So far I only tried out Emacs.

08:51:40 # Life wake on lan. I have not been able to get wake on lan working. I wonder if poweroff command is powering off the system too much and losing power on the ethernet too. Do I need to suspend?

18 Apr 2021 (Sun)

17:56:36 # Life Rewrote my pomodoro technique timer. I've been iterating on how I operate and focus. Too much focus exhausts me. I'm trying out Focusmate's method of 50 minutes of focus time and 10 minutes of break. Here is a web app that tries to start the timer at the hour and starts break at the last 10 minutes.

11 Apr 2021 (Sun)

11:06:56 # Life Wrote a timezone checker page. timezone. Shows the current time in blue line. I haven't made anything configurable but will think about it later.

1 Apr 2021 (Thu)

11:25:26 # Life April, new year for schools in Japan. What am I learning these days?

Junichi Uekawa