Skip to content

Instantly share code, notes, and snippets.

@artbikes
artbikes / prometheus.yaml
Created June 18, 2020 20:47
prometheus traefik
# static configuration
global:
checkNewVersion: true
serversTransport:
insecureSkipVerify: true
entryPoints:
traefik:
# Infrafloss, a fairyfloss for the infra among us
# Intended for use with nopjmp's fairyfloss VS Code extention
# VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=nopjmp.fairyfloss
# Copy this file into your settings.json
"workbench.colorTheme": "fairyfloss",
"editor.tokenColorCustomizations":
{
"textMateRules":
[
@artbikes
artbikes / Makefile
Created May 19, 2020 13:52 — forked from kbingham/Makefile
My Generic Makefile.Useful for creating a simple build for a single target from a set of c files.This could extended to provide support for other languages, or cross compilations.Let me know if you find this useful, or make any useful (generic) updates that are worth sharing.
# Kierans Generic Makefile
# www.kieranbingham.co.uk
# Default to build with multiple instances for speed
MAKEFLAGS =+ -j
# Beware, This will create this application
# binary based on the current directory name.
TARGET := $(shell basename `pwd`)
@artbikes
artbikes / send2s3.sh
Created May 14, 2020 13:55 — forked from UnixSage/send2s3.sh
Simple shell script that uses curl to send a file to s3. Useful when you do not want to load the awscli for a simple job. May have to adjust mime types according to need.
#!/bin/sh
if [ $# -ne 1 ] ; then
echo "Need File Name"
exit
fi
s3AccessKey="##ACCESS##"
s3SecretKey="##SECRET##"
s3Bucket="data.example.com"
@artbikes
artbikes / traefik-compose
Created April 16, 2020 18:20 — forked from ivankatliarchuk/traefik-compose
traefik 2 with docker-compose
version: '3.7'
networks:
traefik:
external: true
volumes:
db_data:
secrets:
@artbikes
artbikes / hist.sh
Last active August 30, 2024 19:14
hist
hist () {
if [ "$#" -eq 1 ]; then
history | grep "$1" | tail
elif [ "$#" -eq 2 ]; then
history | grep "$1" | tail -n "$2"
else
history | tail
fi
}

Loading :advanced Code into an Unmodified WROVER running Espruino

You can load ClojureScript :advanced code directly into an ESP32 WROVER running Espruino for execution upon boot, by creating a binary and flashing it to the JavaScript "boot ROM" area. This has the same effect as when loading code via the Espruino Web IDE, in the "Direct to Flash (execute code at boot)" mode, but flashing is much quicker and more reliable.

Note: To do this, you'll need an ESP32 WROVER with SPI PSRAM, as opposed to just a WROOM, as the ClojureScript in this example uses more RAM than is available in the WROOM.

Create :advanced Code

Here is a small program that uses enough to pull in data structures, etc, leading to nearly 100 KiB:

set terminal pngcairo font "arial,10" size 500,500
set datafile separator ","
set output 'barchart.png'
set xtics rotate by 270
set key top left
set boxwidth 0.75
set style fill solid
set title "Age (In Days) of Presidential Candidates at Start of 2021 Term"
plot "ppdays.data" using 2:xtic(1) notitle with boxes, 14050 title "Millenial", 15264 title "Gen X", 20838 title "BOOMER", 27777 title "Silent Generation"
#!/bin/sh
#
# This script deploys the given manifest,
# tracks the deployment, and rolls back on failure.
#
# First execute this with "myapp.yaml" and then try it with "myapp.failing.yaml"
#
MANIFEST_PATH=$1
DEPLOYMENT_NAME=myapp