Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🏫
Book an hour with me for Golang coaching.

Alex Ellis alexellis

👨‍🏫
Book an hour with me for Golang coaching.
View GitHub Profile
@alexellis
alexellis / setFans.sh
Last active Nov 18, 2020 — forked from ppouliot/setFans.sh
Script to set the fan speed on Ampere server
View setFans.sh
#! /bin/sh
# Alex Ellis 18th Nov 2020
# Updated for the 1U unit, which has 7 fans
logo () {
echo ""
echo " ▄██▄"
echo " ▄█ █▄"
echo " ▄█ █▄"
@alexellis
alexellis / install-k3sup.sh
Last active Nov 19, 2020
Multi-master / HA k3s for my Raspberry Pi cluster
View install-k3sup.sh
#!/bin/bash
set -e
CH=latest
echo Installing Server 1
k3sup install --user pi --ip 192.168.2.147 \
--k3s-channel $CH \
--cluster \
@alexellis
alexellis / inletsctl-role.json
Last active Oct 4, 2020
IAM Role for AWS EC2 for inletsctl/inlets-operator
View inletsctl-role.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:AuthorizeSecurityGroupIngress",
"ec2:DescribeInstances",
"ec2:DescribeImages",
View gist:04d39e5474650aab217f7f8ed0008e5a
Add this to your user-data field in the EC2 console
It creates a new user i.e. "alex" with the SSH key specified.
Then: `k3sup install --ip $IP --user alex`
```yaml
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0
@alexellis
alexellis / led-app.py
Created Sep 1, 2020
Pair of Python3 programs to control an LED and sense the environment using the Pimoroni Blinkt and Envirophat
View led-app.py
from flask import Flask
app = Flask(__name__)
import sys
import blinkt
blinkt.set_clear_on_exit(False)
def print_color(r,g,b):
print('Setting Blinkt to {r},{g},{b}'.format(r=r, g=g, b=b))
@alexellis
alexellis / docker-compose.yml
Created Jul 21, 2020
Hack on JavaScript for OpenFaaS using Docker Compose
View docker-compose.yml
# Assume that you ran "faas-cli new --lang node12 api2" before starting with this file.
version: '3.3'
services:
api2:
build:
context: ./template/node12
ports:
- 8000:3000
@alexellis
alexellis / sponsors.go
Last active Dec 31, 2020
sponsors.go - query whether a GitHub user is your sponsor at a given tier (dollar amount)
View sponsors.go
// LICENSE for this file: MIT
// Copyright: Alex Ellis, OpenFaaS Ltd 2020
// Do not remove this notice
package handlers
import (
"context"
"encoding/json"
"os"
@alexellis
alexellis / insiders-2020-06-21.md
Last active Jul 15, 2020
Insiders Update: 21st June 2020 - Exploring Kubernetes 1.18, major updates for arkade and openfaas
View insiders-2020-06-21.md

Welcome to this week's Insiders Update! Insiders gain exclusive access to early previews, tutorials, updates, news, and events on my OSS work.

🐳 Become an Insider or Subscribe today 👉 through GitHub

Insiders Update: 21st June 2020 - Exploring Kubernetes 1.18, major updates for arkade and openfaas

Webinar - exploring K8s 1.18

This week I gave two webinars for clients including one on bare-metal and Packet's Tinkerbell project and Exploring Kubernetes 1.18 - a technical deep-drive hosted by Sysdig.

@alexellis
alexellis / kubernetes-ingress-example.yaml
Created Jun 21, 2020
kubernetes-ingress-example.yaml
View kubernetes-ingress-example.yaml
# From my webinar for Sysdig - Exploring Kubernetes 1.18
# Create A KinD or k3s cluster with no IngressController
# Run `arkade install ingress-nginx` to add IngressNginx to the cluster as your IngressController
# Save and apply all the Kubernetes YAML files below
# Forward the IngressController
# kubectl port-forward ingress-nginx-controller 8080:80
@alexellis
alexellis / 2020-06-12-insiders.md
Last active Jul 15, 2020
Insiders Update: 12th June 2020 - Featured: bare metal and open source project updates
View 2020-06-12-insiders.md

Welcome to this week's Insiders Update! Insiders gain exclusive access to early previews, tutorials, updates, news, and events on my OSS work.

🐳 Become an Insider or Subscribe today 👉 through GitHub

Insiders Update: 12th June 2020 - Featured: bare metal and open source project updates

I hope that you are keeping well? If you need to talk and socialise, feel free to join us on OpenFaaS Slack. I gave myself some time off this #FaaSFriday for a walk with my wife in the countryside.