Skip to content

Instantly share code, notes, and snippets.

View darth-veitcher's full-sized avatar

James Veitch darth-veitcher

View GitHub Profile
@darth-veitcher
darth-veitcher / stable-diffusion-on-apple-silicon.md
Created February 12, 2023 02:22
Stable Diffusion on Apple Silicon

Stable Diffusion on Apple Silicon

This repository outlines what I have done in order to get Stable Diffusion running on a MacBook Pro with a M2 chip.

Exact Specs:

Key Value
Model MacBook Pro
Screen 14"
@darth-veitcher
darth-veitcher / micro-k8s-setup.md
Created November 10, 2022 08:09 — forked from borkmann/micro-k8s-setup.md
MicroK8s setup for Cilium

Set up microk8s with Cilium for development

Microk8s is a Canonical project to provide a kubernetes environment for local development, similar to minikube but without requiring a separate VM to manage. These instructions describe setting it up for common development use cases with Cilium and may be helpful in particular for testing BPF kernel extensions with Cilium.

Microk8s will run its own version of docker for the kubernetes runtime, so if you have an existing docker installation then this may be confusing, for instance when building images the image may be stored with one of these installations and not the other. This guide assumes you will run both docker daemon instances, and use your existing docker-ce for building Cilium while using the microk8s.docker daemon instance for the runtime of your kubernetes pods.

Requirements

@darth-veitcher
darth-veitcher / terminal-with-powerline.sh
Created May 10, 2022 21:53 — forked from lirantal/terminal-with-powerline.sh
Hyper terminal + Powerline 9k terminal theme for oh-my-zsh
# Use hyper.is or iTerm2 as terminal emulators
# Install ohmyzsh
# https://github.com/robbyrussell/oh-my-zsh
# Copy over configs from ~/.bash_profile
# For example, it may have the nvm setup or any aliases like exa=ls and cat=bat
# ~/.hyper.js configuration:
copyOnSelect: true
@darth-veitcher
darth-veitcher / myip.sh
Created May 5, 2022 07:38
Get current IP from google.com
dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'\"' '{ print $2}'
@darth-veitcher
darth-veitcher / find-latest-nodejs.py
Created May 4, 2022 22:08
Find the latest NodeJS release available (LTS or All)
#!/user/env python3
# Script to determine the latest NodeJS release available.
# Written in pure python 3 with no additional dependencies.
from urllib import request
from typing import List
import json
import logging
import argparse
@darth-veitcher
darth-veitcher / self-signed.py
Last active May 3, 2022 11:55
Self Signed PKI
#!/usr/bin/env python3
# Title: POOR MAN'S PKI
# Author: James Veitch
# Date: 2018
# =================
# Description:
# Designed to quickly create a Root CA and signed bundle for
# a defined host. NOT INTENDED FOR PRODUCTION.
# Assumes you have OpenSSL installed and available in $PATH.
@darth-veitcher
darth-veitcher / settings.json
Last active April 15, 2022 18:37
VSCode Workspace Settings
{
// https://github.com/tonsky/FiraCode/wiki/VS-Code-Instructions
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"python.linting.flake8Enabled": true,
"python.linting.pylamaEnabled": true,
"python.formatting.provider": "black",
"[python]": {
"editor.formatOnPaste": false,
"editor.formatOnSaveMode": "file"
@darth-veitcher
darth-veitcher / .flake8
Created April 15, 2022 18:30
Flake8 compatible with Black
# see: https://github.com/psf/black/blob/06ccb88bf2bd35a4dc5d591bb296b5b299d07323/docs/guides/using_black_with_other_tools.md#flake8
[flake8]
max-line-length = 88
extend-ignore = E203
exclude = */tests/*
@darth-veitcher
darth-veitcher / .gitignore
Created April 15, 2022 18:29
Python .gitignore
# OS specific
# Windows
Thumbs.db
desktop.ini
# OS X
.DS_Store
.Spotlight-V100
.Trashes
._*
@darth-veitcher
darth-veitcher / gh-labels.py
Last active April 12, 2022 13:59
setup github labels
# source: https://docs.github.com/en/rest/reference/issues#create-a-label
import os
import sys
import requests
TOKEN = os.environ.get("GITHUB_API_TOKEN")
if not TOKEN:
print("GITHUB_API_TOKEN not found. Please set as an environment variable.")
sys.exit(1)