Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Saturday, 18 July 2026

Programming as Play

Shade Zahrai has noted that "play changes your brain". 

Stress drops (cortisol down, dopamine up) when something feels low-stakes and playful.

Daily light-hearted play can train your brain to get comfortable with taking risks, exploring and trying new stuff. It builds a sense of agency, a belief that action can make a difference.  

This concept is also explored in the context of programming specifically in an article on "Hunting the Wiley Hacker" which covers the joy of Linux.

Tuesday, 16 June 2026

Keeping Ubuntu Up to Date

Keeping Ubuntu up to date in WSL is a manual process (unless automated).

Even if automated, you may need a "revert to manual" process if automation breaks (for whatever reason).

Some points:
  • The /etc directory is your friend in all this
  • cat /etc/os-release - needs to be done before and after to check the release has been complete
  • You should upgrade regularly - not least because you need to get the latest security updates
To ensure the upgrade can happen successfully you need to check/edit the release-upgrades file.

sudo emacs -rv /etc/update-manager/release-upgrades

Change Prompt=never to Prompt=LTS (the latter checks to see if a new LTS release is available).

Useful commands:
  • sudo apt update
  • sudo apt full-upgrade
  • sudo do-release upgrade
Don't forget to check os-release for successful install.

Official documentation here.

Tuesday, 26 May 2026

What is iptables?

iptables is a command in Linux for maintenance of IP packet filter rules in the Linux kernel. It enables configuration of security policies, control of incoming and outgoing traffic and network address translation (NAT).

iptables is not available in cmd.exe but it is available in WSL2.

A Windows Joe may therefore not have much exposure to iptables in day-to-day administration but should nevertheless have a good working knowledge of NAT and its terminology, as it's a universal networking concept.

Thursday, 23 April 2026

The Apache Incubator

The Apache Incubator services projects seeking to enter the almighty Apache Software Foundation. Projects (called "podlings") are "ingested" and become subject to Apache-style governance and operation.

The name Apache was taken from the Apache Indian people, a Native American tribe known for their warrior spirit and inexhaustible endurance, and was first used in the context of the cross-platform Apache Web Server (launched in 1995; despite being cross-platform most instances run on Linux distributions).

Friday, 13 February 2026

Saturday, 13 December 2025

Risk Managing WSL

If you are manager of desktops and need to understand WSL risks, here is a summary.

WSL allows users root access inside their Linux instance with ability to install a host of useful software including compilers, packages etc. Linux binaries may be run which Windows Defender may not fully inspect.

However, users have no admin rights on Windows itself.

There are a number of risks which include unmonitored code execution and running unvetted network services as well as bringing unmanaged Linux tooling into the Windows estate.

It can be managed, but adds an additional complexity layer.

There is some degree of isolation between WSL and Windows but not completely. File systems are mutually accessible (from WSL, access Windows directories via /mnt/c, for example).

Note that Windows Defender scans WSL files.

batcat - a syntax highlighting version of cat

To install in ubuntu use:

sudo apt install bat

Then batcat the file you want to display.

If you want to look at the package in more detail, you can type:

apt show bat (don't need sudo for this)

You will see this is a Rust compiled file.

Thursday, 20 November 2025

Elliptic Curves Assert Presence on Linux

WinJoes may be surprised to see refs to elliptic curves appearing in their Linux VMs in their D2D Ops.

These appearances often reference EdDSA (e.g. in messages like "using EDDSA key 0327BE68.....").

EdDSA refers to the Edwards-curve Digital Signature Algorithm (EdDSA) in public key cryptography.

Edwards curves are an artefact of algebraic geometry and named after the American mathematician Harold Edwards.  The specific form of Edwards curves used in the algorithm are known as twisted Edwards curves, where the "twist" comes from a non-unitary coefficient (from some field F) in the curve equation. The twisted Edwards curve equation is an interesting equation and the first question when you see it is how did someone come up with it.

source command in Linux shell

 The source command in the Linux shell sources (loads) a script. Its short form is .

Tuesday, 18 November 2025

Microsoft's Big Bet on Rust

Microsoft is writing more code in Rust (a memory safe "cousin" of C++).  It is also investing time in developing the language ecosystem in its role as a founding member of the Rust Foundation.

This is due to 1) performance 2) memory safety and 3) developer mindshare.

Mark-R has called for a halting of new code in C and C++ and using Rust 

"for those scenarios where a non-GC language is required".

Linus has also confirmed Version 6.1 of the Linux kernel will use Rust.

Rust was created by Graydon Hoare in 2006 while working at Mozilla as a personal side project to solve memory safety and concurrency issues in systems languages like C and C++.

Other companies that have embraced Rust include Cloudflare who coded up Pingora in Rust to overcome limitations in nginx.

git add and git commit

The Mechanics of Commits 

You can add a new file to your repo doing:

git add <mynewfile>
git status (this will show any pending commits)
git commit -m "a little comment, if you please" <mynewfile>

Once you commit, you should get a message like:

[master (root-commit) strange_hexadecimal_code] comment from -m command line flag
 "1 file changed, X insertions(+)" 
create mode 100644 filename.xx

 If you didn't do a git add, it will say "nothing to commit, working tree clean".
The 100644 is Unix style permissions - 100 means regular file, 644 means read/write for owner and read-only for group and others.

Committing to Git is a Two-Step Process

Stating the obvious here, but as stated above, you need to git add before you git commit for new files.

The Semantics of Commits

When we commit, Git invokes an algorithm to create a "commit object", a binary object which it stores inside the .git folder.  A unique identifier is used to "stamp" the commit. Part of the "stamp" is shown in the git commit response message - and is computed from a bunch of metadata including the commiter's name, time of commit, commit message and information on the change.

The Index and the Object Database

When you do a git add, a copy is made of the file and put into the index. The index is like a "waiting room" where we put in our "candidate" objects until we are ready to commit them.  git commit takes the objects in the waiting room and puts them into the object database.

Allowing wsl.localhost in list of allowed hosts

When navigating to a directory in WSL from VS Code you may get the message:

The host 'wsl.localhost' was not found in the list of allowed hosts. Do you want to allow it anyway?

You will get the opportunity to hit Allow (because you trust the host, it is after all, your WSL installation) together with the option to flag: "Permanently allow host 'wsl.localhost'".

Accessing Linux Directories in WSL From Explorer

Directories in WSL can be accessed by navigating to your distribution and filesystem after opening \\wsl$ in File Explorer.

Linux VM Skills - The ls command

ls -a and ls -A will list all files including hidden files.

ls -A (capital A) will attempt to remove the . and .. directory (i.e. current and parent directories). 

Saturday, 15 November 2025

Canonical Snaps and Approach to Linux Packaging

Concept of Snaps and Why Its Useful

When running wsl in Windows (with Ubuntu) you will eventually come across the concept of snaps. 

Snaps are a package management feature that offer an alternative to the usual sudo apt-get (or sudo apt install, which is a wrapper over apt-get).

Snaps was developed by Canonical for security (via sandboxing, or in Canonical language "confinement") and convenience (an "all-in-one" snap removes the need to download and install individual dependencies).

The security side aims to guarantee safe execution of software by mandating packages abide by the principle of least privilege (this is diluted however by the option of classic confinement).

Concrete Example: Installing emacs edito

Trying to run emacs at the command line, you find it is not installed. You may see:

Command 'emacs' not found, but can be installed with
sudo snap install emacs # version 30.2

This is achieved by placing the package in a sandbox with snapd mediating all access to host system resources. 
The snap's confinement level controls the degree of isolation from the user's system.
  • Strict confinement - abide by sandbox rules
  • Classic confinement - liberal / "laissez-faire" (but needs explicit user approval on install)
Searching for Pre-Created Snaps using Canonical's Search Engine

There is a search engine for Snaps on Canonical's website. Canonical are calling it the "app store" for Linux.

Friday, 14 November 2025

Wayland for WinDevs Who May Not Know It

What is Wayland?

Wayland is intended as a replacement for the X Window system with the aim to make it easier to develop and maintain.

Specifically, Wayland is the protocol used to talk to the display server to render the UI and receive input from the user.  

Wayland also refers to a system architecture (more below), which will give you an understanding of how the protocol is used to build a working UI.

Wayland versus X Architecture?  Call it a "Simplified X".

In an X setup,  X clients talk to an X server and the server talks to a compositor. The comms between server an compositor is bidirectional.

The X Server also talks to the kernel. There is a critical interface called evdev (short for event device) which is the input event interface in the Linux kernel. 

In Wayland - the display server and the compositor are rolled into one. The architecture is thus simpler.

Tuesday, 28 January 2025

So-called "Safe" Kernel Programming with eBPF

eBPF technology has roots in the Linux kernel. It is software designed to run programs in a privileged context within an operating system kernel in a sandboxed environment.  This is done without touching kernel source code or loading kernel modules.  A more complete description can be found on ebpf.io.

The use of the acronym eBPF is historic. BPF stood for Berkeley Packet Filter and eBPF was the extended version. eBPF now does lots more than packet filtering so the appropriateness of this meaning is defunct. The original BPF, mostly obsolete, is sometimes now called cBPF (classic BPF) to distinguish it from the eBPF concept.

A more technical guide to the technology can be found here on the Cilium website. Cilium is a tool built on eBPF used in Google Kubernetes Engine (GKE) and in EKS Anywhere on AWS (for on premise container management).

Saturday, 11 September 2021

WineHQ

 Want to run Windows stuff on Linux? Try WineHQ.

Thursday, 24 June 2021

How Much is a Linux Box on Azure?

An Ubuntu Server D2S in Azure will cost around $70 a month. This is the same for SUSE Linux, or Windows 10 Pro, or Windows Server 2019 Datacenter - Gen1, with 2 vCPUs and 8 Gb memory.

Wednesday, 17 July 2019

Shedding OpenDaylight onto Linux Open-So for Future Win-Impact

As Microsoft increasingly embraces open source as a source of growth rather than as competition, Win Joes around the world are familiarising themselves rapidly and immersing themselves in core open source initiatives which may have future impact on the Windows World.

A short selection:

OpenDaylight
Open vSwitch
OPNFV
OpenStack
Open Container Initiative
Cloud Native Computing Foundation

OpenDaylight is a core component of projects such as ONAP (Open Networking Automation Platform) which in turn is a great example of open collaboration within the telecoms community.