Skip to content

Instantly share code, notes, and snippets.

View codepope's full-sized avatar
:shipit:
London, Cor Blimey Guvn'r

Dj Walker-Morgan codepope

:shipit:
London, Cor Blimey Guvn'r
View GitHub Profile
sed -i -e "/cluster_tags: {}/a\ \n# Enabling static Docker IPs\ndocker_networks:\n- name: demonet\n ipam_config:\n - subnet: 172.18.37.0/24\n gateway: 172.18.37.1\n
s/ node: \([1-4]\)/&\n networks:\n - name: demonet\n ipv4_address: 172.18.37.1\1/g" democluster/config.yml

Keybase proof

I hereby claim:

  • I am codepope on github.
  • I am codepope (https://keybase.io/codepope) on keybase.
  • I have a public key ASBtlwWiGDyBLcJWd-7QqoW2oJqVY_VmnrQ8HiYOU_-oHQo

To claim this, I am signing this object:

@codepope
codepope / index.html
Last active July 5, 2021 15:51
Studio 3T Map Demo Page HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin="" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
@codepope
codepope / code.py
Created June 13, 2021 13:04
Lilygo clock from 12 Jun session at Makeroni
import struct
import board
import displayio
import terminalio
import wifi
import socketpool
import time
import rtc
from adafruit_bitmap_font import bitmap_font
from adafruit_display_text import label
@codepope
codepope / rgbkeypadcp.py
Created February 15, 2021 21:08
A class (and example) for the Pimoroni Pico RGB Keypad and CircuitPython
import board
import digitalio
import busio
import random
import time
class PicoRGBkeypad:
WIDTH=4
HEIGHT=4
NUM_PAD=WIDTH*HEIGHT
@codepope
codepope / pimoroni rgb keypad for circuitpython
Created February 13, 2021 17:44
pimoroni rgb keypad for circuitpython - wip
mport board
import digitalio
import busio
import random
import time
class RGBKeyPad:
WIDTH=4
HEIGHT=4
NUMPADS=WIDTH*HEIGHT
@codepope
codepope / lscpu
Created January 15, 2021 16:11
lscpu m1 vmcli
dj@ubuntu:~$ uname -a
Linux ubuntu 5.4.0-62-generic #70-Ubuntu SMP Tue Jan 12 12:50:33 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
dj@ubuntu:~$ lscpu
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
@codepope
codepope / cleanuppending.sh
Created August 24, 2020 12:10
Destroys all pending Fly instances (unused) using fly JSON and jq and xargs
fly list apps -o dj -s pending --json | jq ".[].Name" | xargs -I % fly destroy % -y
@codepope
codepope / reckoner.sh
Created August 24, 2020 12:07
Finds a Fly app name in the local directory's fly.toml and destroys without mercy
#!/bin/bash
regex='^app = "([^"]*)"'
while read line
do
if [[ $line =~ $regex ]]
then
appname="${BASH_REMATCH[1]}"
flyctl destroy $appname -y
exit
@codepope
codepope / showclue.py
Created March 21, 2020 18:02
A small snippet regarding getting the Clue and the Elecfreaks Joystick:Bit working together.
from adafruit_clue import clue
import board
from analogio import AnalogIn
clue.sea_level_pressure = 1020
ap0=AnalogIn(board.P0)
ap1=AnalogIn(board.P1)
ap2=AnalogIn(board.P2)
clue_data = clue.simple_text_display(title="CLUE Sensor Data!", title_scale=2)