Skip to content

Instantly share code, notes, and snippets.

View lelegard's full-sized avatar

Thierry Lelegard lelegard

  • Paris, France
View GitHub Profile
@lelegard
lelegard / win10-sshd.md
Last active May 19, 2024 09:16
Installing Windows 10 "built-in" SSH Server

Installing Windows 10 "built-in" SSH Server

Starting with Windows 10 build 1709, Windows integrates a port of OpenSSH, client and server.

This note describes how to install and configure the OpenSSH server sshd and run PowerShell scripts on a remote Windows server, from a Unix system, using SSH and public key authentication (no password).

Note: The way OpenSSH has been integrated in Windows 10 has changed a lot between versions 1709 and 21H2 of Windows 10. The Gist was updated several times to reflect the changes. This version applies to Windows 10 21H2.

OpenSSH server installation

@lelegard
lelegard / win-home-gpedit.md
Last active April 25, 2024 17:36
Enabling the Group Policy Editor on Windows 10 Home

Enabling the Group Policy Editor on Windows 10 Home

On Windows 10 Home edition, there is no Local Group Policy Editor (gpedit.msc) and no Local Security Policy Editor (secpol.msc). These tools are reserved to Professional editions of Windows.

It is however possible to install them on Windows 10 Home if you need them.

Open a PowerShell window as administrator and run the following command:

@lelegard
lelegard / gentoo-install.md
Last active February 1, 2024 22:13
My Gentoo Linux Installation

My Gentoo Linux Installation

As the title implies, this is "my" experience of Gentoo Linux Installation on a virtual machine. There are too many ways to install Gentoo. This Gist is only designed as a reminder if I need to do this again...

Target configuration:

  • English language, French keyboard, located in France.
  • Init system: openrc, old but default one on Gentoo.
  • Desktop: Gnome.

Installation guides

@lelegard
lelegard / purging-old-artifacts-with-github-api.md
Last active January 18, 2024 07:19
Purging old artifacts with GitHub Actions API

With GitHub Actions, a workflow can publish artifacts, typically logs or binaries. As of early 2020, the life time of an artifact is hard-coded to 90 days (this may change in the future). After 90 days, an artifact is automatically deleted. But, in the meantime, artifacts for a repository may accumulate and generate mega-bytes or even giga-bytes of data files.

It is unclear if there is a size limit for the total accumulated size of artifacts for a public repository. But GitHub cannot reasonably let multi-giga-bytes of artifacts data accumulate without doing anything. So, if your workflows regularly produce large artifacts (such as "nightly build" procedures for instance), it is wise to cleanup and delete older artifacts without waiting for the 90 days limit.

Using the Web page for the "Actions" of a repository, it is possible to browse old workflow runs and manually delete artifacts. But the procedure is slow and tedious. It is fine to delete one selected artifact. It is not for a regular cleanup. We need

@lelegard
lelegard / ubuntu-risvc-qemu.md
Last active January 16, 2024 14:37
Installing Ubuntu for RISC-V on Qemu

Installing Ubuntu for RISC-V on Qemu

This note is a summary of my experience of installing Ubuntu for RISC-V on Qemu on a macOS host. This is just a personal experience. There may be other ways.

For simplicity, all files will be copied in one single dedicated directory and all commands will be run from that current directory.

Initial reference: https://wiki.ubuntu.com/RISC-V/QEMU

Prerequisites

@lelegard
lelegard / ubuntu-s390x-qemu.md
Created January 15, 2024 10:28
Installing Ubuntu for IBM s390x on Qemu

Installing Ubuntu for IBM s390x on Qemu

This note is a summary of my experience of installing Ubuntu for IBM s390x on Qemu on a macOS host. This is just a personal experience. There may be other ways.

If you wonder why I had the silly idea of installing an IBM s390x virtual machine on macOS, 1) because it is possible, 2) because it is a big endian system which can be useful to test the portability of some applications.

For simplicity, all files will be copied in one single dedicated directory and all commands will be run from that current directory.

Initial reference: https://community.ibm.com/community/user/ibmz-and-linuxone/blogs/timothy-sipples1/2020/04/28/run-ubuntu-z-linuxone

@lelegard
lelegard / pdf-booklet.sh
Created August 29, 2022 21:11
Reorder pages in a PDF file to print a booklet
#!/usr/bin/env bash
# Reorder pages in a PDF file to print a booklet.
# Then, print the output PDF in duplex mode, short-edge binding, 2 pages per sheet.
SCRIPT=$(basename "$BASH_SOURCE")
INFILE=
OUTFILE=
VERBOSE=false
SYSTEM=$(uname -s)
@lelegard
lelegard / arm64e-on-macos.md
Last active February 27, 2023 13:43
Apple architectures arm64 and arm64e on macOS
@lelegard
lelegard / arch-linux-install.md
Last active December 3, 2022 13:08
My Arch Linux Installation

My Arch Linux Installation

As the title implies, this is "my" experience of Arch Linux Installation on a virtual machine. There are many (too many) ways to install Arch Linux. This Gist is only designed as a reminder if I need to do this again...

Target configuration: use English language, French keyboard, located in France.

Installation guides

@lelegard
lelegard / create-blank-pdf.sh
Last active August 29, 2022 14:39
Create a one-page blank PDF file, optionally with same page size as an existing reference PDF file
#!/usr/bin/env bash
# Create a one-page blank PDF file.
# Optionally with same page size as an existing reference PDF file (default size: A4).
SCRIPT=$(basename "$0")
usage() { echo >&2 "usage: $SCRIPT output-file [reference-file]"; exit 1; }
error() { echo >&2 "$SCRIPT: error: $*"; exit 1; }
warning() { echo >&2 "$SCRIPT: warning: $*"; }
# Find various tools.