Skip to content

Instantly share code, notes, and snippets.

View tormath1's full-sized avatar

Mathieu Tortuyaux tormath1

View GitHub Profile
@tormath1
tormath1 / README.md
Last active April 18, 2024 07:41
Sway + titlebar

Configuration:

$ cat .config/sway/config | grep opa
# opacity
set $opacity 0.97
for_window [class=".*"] opacity $opacity
$ cat .config/sway/config | grep disable
disable_titlebar yes
$ sway --version
@tormath1
tormath1 / config.yaml
Created August 3, 2023 08:16
Minimal Kubernetes + Docker systemd sysext Butane configuration
# butane < config.yaml > config.json
# ./flatcar_production_qemu.sh -i ./config.json
variant: flatcar
version: 1.0.0
storage:
files:
- path: /opt/extensions/docker/docker-24.0.5.raw
contents:
source: https://github.com/flatcar/sysext-bakery/releases/latest/download/docker-24.0.5.raw
- path: /opt/extensions/kubernetes/kubernetes-v1.27.4.raw
@tormath1
tormath1 / README.md
Last active July 31, 2023 20:05
Update Kubernetes... Not Flatcar.

This is a demo of updating Kubernetes version on Flatcar without updating the OS leveraging Systemd sysext and Kured.

notes:

Boot an instance with the following Butane config.yaml:

variant: flatcar
@tormath1
tormath1 / README.md
Last active October 16, 2023 07:52
CAPO CI Flatcar update

[CAPO][capo] does test in its CI both Ubuntu and Flatcar. For Flatcar, the image still needs to be built via the image-builder and uploaded on CAPO GCS (Google Cloud Storage).

There is an open issue to bring some automation around this process: kubernetes-sigs/cluster-api-provider-openstack#1502 while it is not done, whether CAPO or Flatcar maintainers needs to do it manually.

  1. Once the release is announced
$ cd kubernetes-sigs/image-builder/images/capi
$ make OEM_ID=openstack build-qemu-flatcar
@tormath1
tormath1 / mpris-wrapper.py
Last active May 4, 2023 14:43
control spotify from firefox through mpris on sway
#!/usr/bin/env python
# goal of this script is to control (play / pause) multimedia played
# on a firefox tab through dbus
# requirements:
# * dbus (session)
import dbus
import sys
@tormath1
tormath1 / README.md
Last active April 28, 2024 11:30
Cluster API OpenStack using Flatcar
# butane < config.yml > ignition.json
---
variant: flatcar
version: 1.0.0
storage:
disks:
- device: /dev/vda
partitions:
- number: 9
label: ROOT
@tormath1
tormath1 / README.md
Last active March 10, 2022 12:22
Run a Tor bridge on Flatcar

The goal of this Gist is to run a Tor bridge from a Flatcar instance provisioned through Ignition - in this example, it's deployed locally with QEMU but it can be extend elsewhere (with Terraform and so on.)

Requirements:

  • ct
  • qemu setup

Pull the latest stable release of Flatcar:

# ct --platform custom < ./config.yml | jq > ignition.json
systemd:
units:
- name: update-engine.service
enable: true
- name: etcd-member.service
enable: true
- name: locksmithd.service
enable: true
dropins:
@tormath1
tormath1 / config.yaml
Created November 5, 2021 10:15
iptables restore
# ct --in-file ./config.yml --pretty > ./ignition.json
storage:
files:
- path: /var/lib/iptables/rules-save
filesystem: root
mode: 0644
contents:
inline: |
*filter
-A INPUT -p tcp --dport ssh -j ACCEPT