Skip to content

Instantly share code, notes, and snippets.

@jDmacD
jDmacD / instructions.md
Last active May 26, 2023 14:56
instructions on how to configure a CM4 to boot the root filesystem over pcie/sata. This is geared to work with a turingpi2, but would probably work with other CM4 carrier boards

Boot from SD / EMMC with root filesystem on SATA SSD

CM4s will not boot directly from an SSD over SATA, but you can boot from SD / EMMC and mount the root filesystem from an external disk.

  • This does not apply to you if you are using NVME
  • This does not apply to you if you are using USB

Requirements

  • A Turingpi2
  • A CM4 module (lite or with EMMC)
@jDmacD
jDmacD / 0_Nomad.MD
Last active April 21, 2023 19:36
Hashicorp Nomad Examples

A few Nomad examples. Nomad is great and is worth considering as an alternative to k3s and docker compose.

@jDmacD
jDmacD / README.MD
Last active March 30, 2023 17:24
Raspberry Pi OS kernel compile for envoy support

These playbooks are for compiling the Pi OS kernel to make it compatible with Envoy which is used under the hood of Cilium, Consul Connect and maybe Istio. Enyoy will refuse to start on Pi OS due to a memory allocation error. Long discussion here. The two options are

  • Building Envoy from source (not fun)
  • Compile the Pi OS kernel with some extra flags (not fun, but doable)
  • Use Ubuntu or maybe Debian built for the Pi (not fun either)

Pi OS needs to be compiled with the following options:

CONFIG_ARM64_VA_BITS_39=n
CONFIG_ARM64_VA_BITS_48=y
CONFIG_ARM64_VA_BITS=48
#!/bin/bash
apt update
apt install python3-pip python3.10-venv -y
cat << EOF > /var/run/ops_pull_rsa
-----BEGIN OPENSSH PRIVATE KEY-----
<GITHUB DEPLOY KEY>
-----END OPENSSH PRIVATE KEY-----
EOF
- hosts: k3s-rancher-0
gather_facts: false
vars:
config:
type: server
hostname: k3s-rancher-0
tasks:
- name: etract config
tags:
- never
@jDmacD
jDmacD / pull.yml
Last active January 17, 2022 11:41
- hosts: localhost
tasks:
- debug:
msg: "hello"
@jDmacD
jDmacD / stickyanimate.js
Created September 30, 2018 18:11
javascript function to animate sticky header
updateStickyText: function() {
var t = this
if (!this.ignoreStickyTitleChange) {
var e = document.body.getBoundingClientRect()
, r = this.querySelectorAllCached(".sticky-change, .sticky-stop")
, n = document.querySelector(".sticky-stop")
, o = this.getScrollElement().scrollTop
, i = this.querySelectorCached("h1.sticky")
if (null !== i) {
var a = i.getBoundingClientRect()
task printProps {
doFirst {
println src
println dest
}
}
task movDir {
import docker, sys
client = docker.from_env()
container_name = sys.argv[1]
container = client.containers.get(container_name)
print(container.status)
import qb
import sys
supervisor_ip = str(sys.argv[1])
res = qb.ping(supervisor=supervisor_ip, asDict=True)
if bool(res) == False:
sys.exit("Qube Supervisor is down")
else: