Aug 132020
 

Working from home (henceforth “WfH”) has cropped up in my Twitter feed lately and this is my “response” to some of the issues raised.

Now don’t get me wrong – there are all sorts of issues related to WfH – some people can’t, some people don’t like it, companies are getting offices for “free”, some companies not realising that they need to provide equipment, and that health and safety requirements apply to the home worker too.

And probably a whole lot more.

But some of the complaints seem to be coming from people who have never even looked at WfH advice, or who have ignored that advice.

If your work life and your home life seem to be merging, do something about it. Clearly distinguish between work time and home time with a “going to work ritual” and a “coming home ritual”. It doesn’t matter what they are as long as they clearly mark the start and end of the working day.

For example, I always take a morning walk to start the working day, and make a ceremonial cup of coffee at the end (I don’t usually drink coffee whilst working or I end up fizzing).

Find yourself slogging away at the computer non-stop? Well don’t do that then. You’re supposed to take a break away from the computer regularly anyway, so do so. Get up and wander around a bit – make a coffee, look out the front window to see if it’s raining, check the postbox, do some stretching, etc.

Stuck in non-stop meetings? Call a comfort break every hour then – even if you don’t need a pee. Do you really care if your co-workers think you have a weak bladder? Especially when they’re more likely to think you’re a hero for giving them an excuse for a comfort break.

Missing out on the social life of the office? Set up social meetings then – perhaps for lunchtimes when you can eat your meals “together”.

Lastly, ergonomics. That laptop you took back home with you in the spring isn’t the right equipment for a long-term workstation. Get yourself a decent desk, chair, monitor, external keyboard and mouse. That sounds expensive, and yes your employer should (at the very least) be helping out, but it needn’t be that expensive.

Into The Water; Stillness and Motion
Jul 112020
 

So I am currently messing around with a tiling window manager on my laptop – I prefer tiling window managers in general (I use Awesome on my main desktops). These are (in general) not “desktop environments” but just manage windows (and sometimes a “status bar”).

As it happens the window manager I’m messing with doesn’t come as part of a distribution package with a pre-prepared file for GDM3 to use. So I created a ~/.xsession file – something that has worked since display managers first arrived.

Didn’t work.

Turns out that I need to “hack” GDM3 to make a long standard bit of functionality functional again. As an aside (and especially to the GNOME people), all you had to do to keep this functional was detect if someone had a ~/.xsession file and then offer that up as a menu option. Not that difficult to do and even if it isn’t your preferred way of doing things, it’s a nice thing to do for us old-timers.

Anyway, to restore this functionality all it took was to create a file in //usr/share/xsessions/ called xsession.desktop with the following contents :-

[Desktop Entry]
Name=XSession
Comment=This session uses the custom xsession file
Exec=/etc/X11/Xsession
Type=Application
DesktopNames=GNOME-Flashback;GNOME;
X-Ubuntu-Gettext-Domain=gnome-flashback

Dead simple.

And yes I stole this and adapted it myself – I’m putting this up here so that I know where to look when I need it again.

Jun 272020
 

So Apple has announced that it is replacing Intel processors with ARM processors in its Mac machines. And as a result we’re going to be plagued with awful puns endlessly until we get bored of the discussion. Sorry about that!

This is hardly unexpected – Apple has been using ARM-based processors in its iThingies for years now, and this is not the first time they have changed processor architectures for the Mac. Apple started with the Motorola 68000, switched to the Motorola/IBM Power architecture, and then switched to Intel processors.

So they have a history of changing processor architectures, and know how to do it. We remember the problems, but it is actually quite an accomplishment to take a macOS binary compiled for the Power architecture and run it on an Intel processor. It is analogous to taking a monolingual Spanish speaker, providing them with a smartphone based translator and dropping them into an English city.

So running Intel binary macOS applications on an ARM-based system will usually work. They’ll be corner cases that do not of course, but these are likely to be relatively rare.

But what about performance? On a theoretical level, emulating a different processor architecture is always going to be slower, but in practice you probably won’t notice.

First of all, most macOS applications very often consist of a relatively small wrapper around Apple-provided libraries of code (although that “wrapper” is the important bit). For example, the user interface of any application is going to be mostly Apple code provided by the base operating system – so the user interface is going to feel as snappy as any native ARM macOS application.

Secondly, Apple knows that the performance of macOS applications originally compiled for Intel is important and has Rosetta 2 to “translate” applications into instructions for the ARM processors. This will probably work better than the doom-sayers expect, but it will never be as fast as natively compiled code.

But it will be good enough especially as most major applications will be made ARM natively relatively quickly.

But there is another aspect of performance – are the ARM processors fast enough compared with the Intel processors? Well, the world’s fastest supercomputer runs on the ARM processors, although Intel fanboys will quite rightly point out that a supercomputer is a special case and that a single Intel core will outperform a single ARM core.

Except that with the exception of games, and specialised applications that have not been optimised for parallel processing, more cores beats faster single cores.

And a single ARM core will beat a single Intel core if the later is thermally throttled. And thermals has been holding back the performance of Apple laptops for quite a while now.

Lastly, Apple knows that ARM processors are slower than Intel processors in single core performance and is likely pushing ARM and themselves to solve this. It isn’t rocket science (if anything it’s thermals), and both have likely been working on this problem in the background for a while.

Most of us don’t really need ultimate processor speed; for most tasks merely the appearance of speed is sufficient – web pages loading snappily, videos playing silkily, etc.

Ultimately if you happen to run some heavy-processing application (you will know if you do) whose performance is critical to your work, benchmark it. And keep benchmarking it if the ARM-based performance isn’t all that good to start with.

And most of these tasks can be performed fine with a relatively modest modern processor and/or can be accelerated with specialised “co-processors”. For example, Apple’s Mac Pro has an optional accelerator card that offloads video encoding and makes it much faster than it would otherwise be.

Apple has a “slide” :-

That implies that their “Apple silicon” processors will contain not just the ordinary processor cores but also specialised accelerators to improve performance.

Jun 222020
 

I have a problem with serial ports (usually “virtual ones” or USB←→serial port dongles) – I have too many of them, and I usually end up with the wrong one. And selecting a TrueRNG serial port and connecting a terminal emulator to it gets very messy very quickly.

So I was searching around, semi-idly wondering if I could somehow build a device name to USB name mapping that I could stuff into rofi (or dmenu) and I discovered the /dev/serial/by-id/ which did 99% of the work for me.

So yes, I can invoke kermit and up will pop a menu allowing me to select which serial port to connect to :-

ls /dev/serial/by-id |\
  rofi -dmenu -l 20 -p "Pick a serial device" -font "mono 20"

That is the core of it, but to make it functional I need to embed it into a command line argument to kermit :-

alias kermit='kermit -C "set line /dev/serial/by-id/$(ls /dev/serial/by-id | rofi -dmenu -l 20 -p "Pick a serial device" -font "mono 20"),set carrier-watch off"'

Which is admittedly a bit of a mouthful!

But so useful if you have two or three USB to serial adopters plugged in plus a switch’s console port and a Linux widget that provides a serial console.

Jun 222020
 

Unfortunately, the serial communication program I tend to use (kermit) appears to have not been updated in quite a while. Which in some ways is reasonable (it’s a very old program and probably does not need much work), understandable (the main developer is no longer employed to make it work), but is somewhat frustrating when it no longer compiles.

To get it to work on my latest system :-

  1. Download the cku302.tar.gz source code and unpack.
  2. Try the first compile with make linux KFLAGS=-DNOARROWKEYS (losing the arrow keys is unfortunate but not fatal unless you’re in command mode far too long).
  3. If that doesn’t compile with zillions of undefined references to curses sounding functions (printw, stdscr, wmove, etc.) then scroll up to the top of the errors where the final command to “compile” all the objects into a final binary is available. Paste that command and add a “-lncurses” :-
$ gcc  -o wermit \
      ckcmai.o ckclib.o ckutio.o ckufio.o \
      ckcfns.o ckcfn2.o ckcfn3.o ckuxla.o \
      ckcpro.o ckucmd.o ckuus2.o ckuus3.o \
      ckuus4.o ckuus5.o ckuus6.o ckuus7.o \
      ckuusx.o ckuusy.o ckuusr.o ckucns.o \
      ckudia.o ckuscr.o ckcnet.o ckusig.o \
      ckctel.o ckcuni.o ckupty.o ckcftp.o \
      ckuath.o ck_crp.o ck_ssl.o -lutil -lresolv -lcrypt -lncurses -lm

The final output of “wermit” just needs to be stripped, moved to a proper location, and renamed :-

$ strip wermit
$ sudo mv wermit /opt/bin/kermit

And there it seems to work fine.

Of course this is not a proper fix, and we are missing a lot of features but it is at least working. And saves me from having to struggle with minicom, screen, or cu.

WP2Social Auto Publish Powered By : XYZScripts.com