Skip to content

Instantly share code, notes, and snippets.

View alexellis's full-sized avatar
📖
Check out my eBook on Go

Alex Ellis alexellis

📖
Check out my eBook on Go
View GitHub Profile
@thenaterhood
thenaterhood / Read-only FS on Raspberry Pi.md
Last active May 10, 2024 02:09 — forked from yeokm1/Read-only FS on Arch Linux ARM.md
Set up a raspberry pi with ArchLinux or Raspbian with a Read-only root filesystem

Read-only FS on Raspberry Pi

Most embedded devices use a read-only root filesystem. This can make them more resilient to unexpected shutdowns that could otherwise cause data corruption. Depending on your application, you might consider your Pi to be an embedded system. This can also help with some issues that can come from SD card unreliability.

Full instructions and explanations are obtained from this link but you can run these commands directly. I modified some of the instructions for personal convenience.

Login with default username and password: (ArchLinux Arm: alarm, alarm, Raspbian: pi, raspberry)

Optionally enable root over SSH. The rest of these instructions assume you are in root.

nano /etc/ssh/sshd_config

@coco98
coco98 / kube-registry.yaml
Created May 2, 2017 16:31
Docker registry on minikube
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1
@alexellis
alexellis / init.sh
Last active June 12, 2017 13:28
CloudInit for FaaS
#!/bin/bash
curl -sSL get.docker.com | sh
systemctl start docker
site=$(curl -s https://api.ipify.org/?format=text); echo $site; docker swarm init --advertise-addr=$site
cd /root/
git clone https://github.com/alexellis/faas
cd faas
@ruanbekker
ruanbekker / python-sitemap-to-elasticsearch.py
Last active January 22, 2024 05:49
Python Script that Scrapes Sitemap and Ingest URL, Title and Tags to Elasticsearch
# centos: libxslt-devel python-devel
# debian:
import re
import time
import requests
from bs4 import BeautifulSoup
from elasticsearch import Elasticsearch
es_client = Elasticsearch(['http://10.0.1.11:9200'])
@thebsdbox
thebsdbox / dockercon.sh
Last active May 20, 2020 22:22
Docker Con colour ASCII
#!/bin/bash
# Either run as a standalone, or add to .bash_profile to start on new session
RED=$(tput setaf 1 2>/dev/null)
GREEN=$(tput setaf 2 2>/dev/null)
YELLOW=$(tput setaf 3 2>/dev/null)
BLUE=$(tput setaf 4 2>/dev/null)
PURPLE=$(tput setaf 5 2>/dev/null)
CYAN=$(tput setaf 6 2>/dev/null)
@mgoodness
mgoodness / helm-rbac.md
Last active October 30, 2021 17:04
Helm RBAC setup for K8s v1.6+ (tested on minikube)
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
@raspberrycoulis
raspberrycoulis / twitter-follower-bot.py
Created March 9, 2017 11:18
Python script to check your Twitter followers and send you a Slack notification of how many this is.
#!/usr/bin/python
import tweepy
import urllib2
import time
# For Twitter: Add the relevant keys, tokens and secrets from your Twitter app made here: https://apps.twitter.com/
consumer_key = ''
consumer_secret = ''
@xjdrew
xjdrew / client.go
Last active January 22, 2024 05:49
golang tls client and server, require and verify certificate in double direction
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

# Usage:
# 1) Ctr+S downloads page to ~/Desktop/books.html
# 2) Run script
# 3) Find your books in /tmp/humble_books
# 4) Read them
# 5) Profit
cat ~/Desktop/books.html |
grep "https://dl.humble.com" |
sed -n -E 's/.data-web\=\"(https://dl.humble.com/([.]+).([a-z]+)?["]+)./\1 \2 \3/p' |
sed 's/&/&/g' > /tmp/humble_books_list && cat /tmp/humble_books_list |