Skip to content

Instantly share code, notes, and snippets.

View troglobit's full-sized avatar

Joachim Wiberg troglobit

View GitHub Profile
@troglobit
troglobit / ubuntu-server-setup-netplan.md
Created March 15, 2026 14:56 — forked from plembo/ubuntu-server-setup-netplan.md
Ubuntu Server Setup - with netplan

Ubuntu Server Setup - with netplan

Introduction

The assumption here is that you're now starting with a Ubuntu 22.04 LTS Server or newer, rather than Desktop, base (Ubuntu Desktop deploys NetworkManager rather than systemd-networkd by default). This box has an AMD Ryzen CPU.

The goal is networking configured for static addressing using systemd-networkd and netplan. Note that punctuation (including hypens, '-') and indentation are significant when working with netplan YAML files.

There are a lot good arguments against using netplan. I have tried NetworkManager (packages named "network-manager", but the service is "NetworkManager.service" -- go figure) on Ubuntu Server, and was

@troglobit
troglobit / ANSI.md
Created January 18, 2022 06:33 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@troglobit
troglobit / expecting.md
Created May 28, 2021 12:54 — forked from ksafranski/expecting.md
Basic principles of using tcl-expect scripts

Intro

TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

#!/usr/bin/expect
@troglobit
troglobit / Makefile
Created February 3, 2016 23:27 — forked from wkz/Makefile
flip:
@echo '\\/' | sed -e 's:\\/://\\:'
flip-adv:
@echo '\\/' | sed -e 's/\\\//\/\/\\/'
flip-evil:
@echo "\\\\\/" | sed -e "s/\\\\\\\\\//\/\/\\\/"