Router Security

Apple has a useful page on how to set up your routers securely. They don’t currently have a router product so this isn’t about how to configure an Apple product. The advice applies to any router. The page is advertised as a way to configure the “settings for Wi-Fi routers, base stations, or access points used with Apple products” but the advice is good regardless of what devices you’re using.

The TL;DR is

  • Use WPA3 Personal for the routers security setting
  • Set the SSID to a unique name
  • Disable the hidden network setting
  • Disable MAC filtering
  • Enable automatic firmware updates
  • Configure Radio Mode to All or Wi-Fi 2 through Wi-Fi 6
  • Enable all bands supported by the router
  • Set Channel selection to Auto
  • Set channel width to 20 MHz for the 2.4GHz band and Auto for the 5GHx band
  • Enable DHCP unless some other devices on the network is providing this service
  • Set the DHCP lease time to 8 hours for home & office networks
  • Enable NAT unless some other device is providing the NAT service
  • Enable WMM

The above is just a précis of the advice on the page. Read the article for the details on the advice and what the various settings mean. Again, even though this is an Apple page, the advice is applicable even if there are no Apple products on your network. There is a bit of advice and corresponding settings for a Mac, iPhone, or iPad but that’s in a separate section and can be ignored if you don’t have one of those devices.

Update [2022-08-23 Tue 15:37]: Added link to Apple article.

Posted in General | Tagged | Leave a comment

More On the Brailsford-Kernighan Video

The video chat between David Brailsford and Brian Kernighan has sparked a lot of interest and commentary among the Unix faithful. Dough McIlroy offered this story concerning egrep to the conversation. The egrep connection is that it was egrep’s regex technology that powered AWK.

McIlroy explains that for years he thought he was responsible for getting Ken Thompson to cut the regex code from ed and turn it into grep. He learned much later—through the THUS mailing list—that, in fact, Thompson had already done that to make a tool for his own use and all that really happened was that McIlroy’s urging got him to make it publicly available.

McIlroy goes on to say that he used egrep as an integral part of his calendar program but that it painfully slow. Al Aho, the developer of egrep was mortified and introduced lazy state building to egrep to make it faster. That worked but now McIlroy wonders whether he really inspired Aho to make the change or whether it was something he had already planned.

A bit later Mohamed Akram sent a message saying that he had written a blog post about calendar that explains what it does and how it does it. The TL;DR is that it’s a simple script that calls a C program to build a regex and then uses that regex in an egrep call to extract the desired information from the calendar file. Read Akram’s post for the details and the code.

McIlroy is a master at this sort of thing and calendar is a nice example of the way he leveraged existing tools tied together with a shell script to get things done.

Posted in General | Tagged , | Leave a comment

Unicode in AWK

A few days ago I wrote about the excellent video of David Brailsford and Brian Kernighan discussing AWK and its history. In the video, Kernighan mentions that he’s been working on enabling Unicode in the One True AWK. Here’s a pull request from Kernighan showing that he’s mostly accomplished that goal.

At one level, it’s easy to believe that it’s basically a trivial change but as AWK demonstrates it’s not always so easy. Probably the hardest thing is fixing AWK’s regex parser to accept and deal with Unicode. But even simple things like calculating the length of strings can be a problem.

When AWK was first developed—and long afterwards—ASCII was sufficient. These days, it’s a real imposition to deal with an app that doesn’t support Unicode. Kernighan’s porting AWK to support it will ensure that AWK will continue to be a useful tool not only for English people speaking people but for those who speak languages with non-ASCII characters as well.

If you’re a young engineer, the idea of open source and having access to the source code to your tools seems unexceptional. That’s just the way it is. But AWK comes from a time when that wasn’t true. It’s great to see the original AWK still available and still under development. AWK and its developers are a national treasure that we should all be thankful for.

Posted in General | Tagged | Leave a comment

Shouting at Disks

Recently, I wrote about a Janet Jackson song that could cause laptops to crash. That turned out to involve frequencies from the song that resonated with a critical frequency in the disk subsystem and was solved simply by installing a filter to damp out the offending frequency.

Right after I published that story, I stumbled upon a video from 14 years ago of someone shouting at a disk array. It didn’t cause a crash but monitoring software clearly showed that disk latency went up when the disk was shouted at.

The engineers doing the demonstration explained this as having to do with vibration so perhaps it’s different from the Janet Jackson menace but it’s surprising how unexpected things can affect disk performance.

Posted in General | Tagged | Leave a comment

Emacs and the Unix Philosophy

Ramin Honary has a six part series of posts that presses the claim that Emacs does, in fact, adhere to the Unix Philosophy that a program should do one thing and do it well. Almost everyone else’s opinion is that that makes no sense at all. Emacs, after all, is famous—or infamous, depending on your sensibilities—for its Borg-like assimilation of any computer task that wanders into its event horizon.

But Honary makes the case that Emacs is not (merely) an editor but should thought of as in Elisp interpreter. In that sense, the one thing it does well is to run Elisp functions. He goes further and claims that Unix and the Bourne shell are really a sort of proto-functional programming.

It’s an interesting post although Honary gets a few historical facts wrong. Philip Kaludercic has a post, Notes on “Emacs fulfills the UNIX Philosophy” that helps fill in the blanks.

None of this really matters, of course. If you use Emacs, you don’t care if it adheres to the Unix Philosophy or not. If you don’t use Emacs, you don’t care if it adheres to the Unix Philosophy or not. Still, it’s an interesting idea and worth discussing for its own sake.

One thing Honary says that I absolutely agree with is that Emacs doesn’t have extensions; it has apps. I’ve objected before to referring to Emacs packages as extensions and saner heads told me to relax. Honary provides a logical reason for my more emotional response.

Posted in General | Tagged , | Leave a comment

Janet Jackson and Crashing Laptops

Raymond Chen occasionally posts interesting stories from his (long) time at Microsoft. His latest offering tells the story of how Janet Jackson used to have the power to crash laptops. It turned out that playing Jackson’s Rhythm Nation on certain laptops would cause them to crash. A little experimentation showed that playing the music on one laptop could even cause another nearby laptop that wasn’t playing the music to crash.

I’ll let you read Chen’s post to see what was happening and how they fixed it but the interesting thing is that Chen speculates that the fix may still be in place even though the hardware involved is no longer used. It was one of those things were the fix was installed with instructions that it should not be removed and years later no one knew why it was there but were afraid to remove it.

It’s a real problem. Sometimes, like in this case, the fix is no longer doing anything useful but sometimes removing it without a thorough understanding of what it was doing could lead to disaster. Things like this are what make our industry so endlessly engaging.

Posted in General | Tagged | Leave a comment

Brailsford & Kernighan on AWK

Computerphile has a another wonderful discussion between David Brailsford and Brian Kernighan. We are quickly reaching the time when all the original Unix people will be gone (Kernighan is 79 or 80) so these chats are our last chance to get an oral history of what it was like in the beginning.

This particular chat is about AWK. I thought that by now everyone knew that the K in AWK stands for Kernighan but judging from the comments, apparently not. AWK dates back to the 1970s and is still maintained—even the original AWK—as well as the GNU version GAWK. It’s my favorite scripting language and tremendously powerful for problems in its domain.

One of the things Kernighan revealed in the video is that he’s recently spent some time in making (the original) AWK work with Unicode and that his summer vacation project is to update the AWK Book, which if you follow the video link you’ll learn is from 1988. It’s still available but at a outrageous price so a new version would be very welcome, especially to younger engineers who may not have access to the original.

I always enjoy these Brailsford/Kernighan chats and inevitably come away from them knowing something I didn’t know before. In an age where many people in the field don’t know that Kernighan is the K in AWK or even that he’s the K in K&R, these videos become more important than ever.

Posted in General | Tagged | Leave a comment

Keeping Data and Code in the Same File

John D. Cook has another post in his series on coding in Org-mode. The latest emphasizes how you can keep data, code, and documentation in a single (Org) file.

There’s nothing new in that idea for most Irreal readers, of course, but there is one new thing I didn’t know. When you use a table as input data for a code block, the header is not part of the data by default. You can get Org-mode to pass the header too by specifying the unintuitive parameter :colnames no on the source block line. Cook also gives some Python code that shows how to print the table along with the header and also do some calculations on the data.

Cook is a consulting mathematician and I view this series of posts as him documenting his evolving use of Org-mode in his work. The whole series is worth a look.

Posted in General | Tagged , | Leave a comment

More dwim-shell-command

Álvaro Ramírez continues his roll with yet another function for his dwim-shell-command framework. This time, it’s a function to combine several .png files into a single .pdf file. As with the other functions, the point is not to enable new functionality but to make complicated invocations of existing programs easy to remember and use.

As Ramírez says, while it can be hard to remember the command to use for some action, dwim-shell-command lets you name the task, which is easier is to remember, and capture complicated parameters for the process.

As I’ve written before, the dwim-shell-command package is now available on Melpa and Ramírez has broken out the framework code from the individual shell commands that he’s written. That makes it a bit easier if you’re not interested in his functions but want to write your own.

If you frequently invoke commands from the shell with hard to remember names and complex calling sequences, you should definitely take a look at this package.

Posted in Blogging | Tagged | Leave a comment

Tenacity!

Apropos of nothing, this story really appealed to me. I admire cranky guys like Chaturvedi who just resist being pushed around no matter how small the stakes are. The story doesn’t make clear his motivation but I’d guess it’s less principle than a desire not to suffer what he feels was an injustice.

For Westerners like me who don’t have such facts at their fingertips, 20 rupees is approximately 25 cents (US). That means he worked 22 years at a yearly rate of about a penny just to prove he was right.

The whole story is weird but the weirdest part is why Indian Railways didn’t pay Chaturvedi his quarter and make the whole thing go away years ago.

Update [2022-08-14 Sun 15:25]: principal → principle

Posted in General | Leave a comment