Skip to content

Instantly share code, notes, and snippets.

View alanbchristie's full-sized avatar

Alan B. Christie alanbchristie

View GitHub Profile
@alanbchristie
alanbchristie / cmdline.txt
Last active May 25, 2022 08:15
Raspberry Pi OS - installing k3s
# You'll need to patch the Pi's `/boot/cmdline.txt`
# by adding `cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1`
# to the end of the existing line (see https://github.com/k3s-io/k3s/issues/2067)
#
# i.e. `/boot/cmdline.txt` should look like something like this: -
console=serial0,115200 console=tty1 root=PARTUUID=b9075e12-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
# Reboot and you should be able to install k3s
# and its agents: -
@alanbchristie
alanbchristie / fixed-ip.sh
Last active December 15, 2023 07:26
Raspberry Pi OS - setting a fixed IP4 address
# Fixed IP4 address are handy.
# To avoid DHCP you can set a fixed address
# by editing '/etc/dhcpcd.conf'.
#####
# 0 #
#####
# For newer RPi operatign systems (like Debian Bookworm)
# you might need to use this method: -
#
@alanbchristie
alanbchristie / first-actions.sh
Last active July 30, 2023 09:54
Raspberry Pi OS - first headless actions
# (Notes written from an OSX host)
# Assuming you've...
#
# - Done 'touch ssh' on the SSD before instering it into the Pi
# - Added a suitable `wpa_supplicant.conf` (if relying on WiFi)
#
# ...here are the first important actions on first boot of the OS.
# Login to the Pi, using the default password 'raspberry': -
@alanbchristie
alanbchristie / clubhouse-label-update.sh
Created November 10, 2020 09:46
Changing Clubhouse Labels
# A simple example using the Clubhouse API
# to get exiting labels and update them -
# in this case, change their colour.
#
# You'll need: -
#
# curl
# jq
# List labels
@alanbchristie
alanbchristie / create-os-server.py
Last active June 26, 2019 10:58
A Python module to create OpenStack server instances (trying again if they fail).
#!/usr/bin/env python
# A create-server utility as it would have been written by 'Robert I'.
# A wrapper around the OpenStack SDK to try (and try again) to create
# OpenStack server instances.
#
# Note: This module DOES NOT provide all the functionality of
# ---- the underlying API, just those bits I need for my work.
#
# You will need your OpenStack environment variables defined
@alanbchristie
alanbchristie / yum-lock-wait.yaml
Created May 30, 2019 15:52
Task for the yum lockfile error in Ansible 2.8.0
---
# A work-around for the Ansible 2.8.0 error: -
#
# yum lockfile is held by another process
#
# This is seen during yum/package operations. An error not seen
# in Ansible 2.7 and the problem appears to be caused by one of these
# lingering processes...
#
# The following is the result of running 'heketi-cli topology info'
# from the 'heketi-storage' pod on a functional OpenShift/Gluster deployment.
# It shows one cluster the volumes and devices.
# Taken on 14th May 2019 at arount 1pm
Cluster Id: 6e06c34748400f660b4cac621ac479a7
File: true
Block: true
@alanbchristie
alanbchristie / heketi-db.json
Last active May 14, 2019 13:41
An example (ORD Development) Heketi Database export
{
"clusterentries": {
"6e06c34748400f660b4cac621ac479a7": {
"Info": {
"id": "6e06c34748400f660b4cac621ac479a7",
"nodes": [
"3f06d6b371256b1e851d46a22185613c",
"7a10c940a9b5ecb446a6cc3eab02b618",
"c35cb2562cdb0abba4179c83b4eb75a9"
],
@alanbchristie
alanbchristie / topo.json
Created May 14, 2019 13:36
An example (ORN-Development) Heketi topology file
{
"clusters": [
{
"nodes": [
{
"node": {
"hostnames": {
"manage": [
"orn-glusterfs-01.openstacklocal"
],
@alanbchristie
alanbchristie / get-pvc-volumes.sh
Created May 3, 2019 14:20
List OKD PV volumes (paths)
#!/bin/bash
#
# Use the oc-command-set to get persistent volume paths.
# Useful in correlating PV to underlying gluster volume.
#
# Alan Christie
# May 2019
for pvc in $(oc get pv | grep pvc- | cut -f1 -d" ")
do