Understanding dynamic menubar menus in GNU Emacs

Suppose, not hypothetically, that you don't just want to add a newmenu to Emacs' menu bar ,but that you want to dynamically determine what's in this menu. Youhave two options, one simple to understand and use but involvingmagic and one complicated but with less magic. The simple optionis an easy menu with a :filter . An easy-menu filter function has a simple callingconvention and a simple usage. It's called with a list of the menuentries you initially


Changing the menu bar order of Emacs easy-menu menus

These days, Emacs has a menu bar ,theoretically in both graphical and text modes (I turn it off in terminals). One of the things that you (I) can want to do aspart of customizing things like MH-E isto add additional menu-bar menus with your own convenient entries.The easiest and most obvious way to define a new menu-bar menu inEmacs Lisp is with Easy Menu 's easy-menu-define . Easy-menu-define is both easy to use


Using extra Firefox profiles to make my life better

At the moment I have two main browser instances, both using Firefox . My primary browsing is in my customizedFirefox , with assorted strict settings andextensions that result in it mostly notrunning JavaScript, being logged in to places , andso on. Since browsing with JavaScript off can be annoying , I have a second Firefox instance that'smy 'just make it work' browser; it runs JavaScript, accepts andgives back all of those cookies, and so on, and then it throwscookies and everything away


WireGuard is pleasantly easy to set up on smartphones (if you're experienced)

For reasons beyond the scope of this entry, we recently got newAndroid smartphones at work. In the process of setting mine up, I(re)discovered that from Android 12 onward, there's no native wayto set up either of our types of VPNs (OpenVPN andL2TP). Since I was going to need a client and go through extrahassle, I decided to try to make WireGuard work, since I likeWireGuard better than OpenVPN. The experience was so pleasantlyeasy that I


(Minibuffer) completion categories in GNU Emacs and forcing them

Minibuffer completion is the mostcommon type of completion in Emacs and it's invoked in all sortsof situations and thus to complete all sorts of different things.As part of this, Emacs completion has the concept of a completioncategory that can be used to customize aspects of completion inboth basic Emacs ( eg , also )and in and for third party packages like vertico ( eg )and orderless . My personalexperience is that this customization can be very useful to make mehappy with third party packages; the default


The two places firewall NAT can happen in our network

In our network setup , we have internal'sandbox' networks in RFC 1918 IP address space, then our publicnetworks that can talk directly to these sandbox networks, and thenthe university's broader networks and the Internet. In order totalk to these outside networks, the sandbox networks must be NAT 'd topublic IP addresses (in our public networks). There are firewallsdirectly in front of each sandbox, and a further perimeter firewallbetween all of our networks and the outside. In


Finally noticing a quiet speedup in my environment

One thing that mail clients almost universally want is a full listof all of your mail folders. Often getting this list is consideredexpensive, so the mail client will cache this information somehowonce it asks for it. (N)MH and thefrontends for it are no exception to this, with (N)MH providing thebasic commands to list all folders on demand (such as folder ).

As an (N)MH frontend, exmh ( also ) is no exception to this. In fact,when


Stateful versus stateless firewalls, and why stateful is attractive

One of the distinctions in network firewalls is betweenones that primarily operate with state entries for connections andones that are primarily stateless. Somewhat famously, OpenBSD'sPF packet filter wants to be stateful , although youcan coerce it to operate in a stateless mode. This stateful modecan create problems with things like denial of service attacks , so you might ask why OpenBSD prefersstateful operation. The simple answer is that a stateful packetfilter will often perform better, although this depends on whatsort of traffic it sees.


OpenBSD PF-based firewalls suffer differently from denial of service attacks

Suppose, hypothetically, that you have some DNS servers that areexposed to the Internet behind an OpenBSD PF-based firewall. Sinceyou're a sensible person, you have various rate limits set in yourDNS servers to prevent or at least mitigate various forms of denialof service attacks. One day, your DNS servers become extremelypopular for whatever reason, your rate limits kick in, and yourfirewall abruptly stops allowing new connections in or out. Whaton earth happened?

The answer is that you ran out of


Getting the active network interface(s) in a script on Ubuntu 22.04

Suppose, not entirely hypothetically, that we want to start usingsystemd-resolved on our Ubuntu 22.04 machines . One of the challenges of thisis that the whole networking environment is configured through netplan , and in order for systemd-resolvedto work well this means that your netplan configuration must haveyour full list of DNS resolvers and DNS search domains. We don'tnormally set these in netplan, because it's kind of a pain; insteadwe copy in an /etc/resolv.