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 / gitea.md
Created February 17, 2024 17:42 — forked from adamlwgriffiths/gitea.md
Setup Gitea on Synology DiskStation NAS

Synology Gitea setup

Install Docker

Package Centre > Docker > Install

Create folders

    /docker/gitea/postgresql
 /docker/gitea/gitea
@darth-veitcher
darth-veitcher / rtl8188eus-on-raspi.md
Last active September 8, 2023 17:14
Installing a TP-Link TL-WN725N Wireless Adapter on a RaspberryPi

This was a proper pain... Turns out there's a whole host of issues with the rtl8188eus driver.

Steps to fix (on Debian / RaspberryPi OS).

1. Install build tools

sudo apt install -y \
  build-essential \
 git \
@darth-veitcher
darth-veitcher / logger.py
Created August 15, 2023 16:25 — forked from nkhitrov/logger.py
Configure uvicorn logs with loguru for FastAPI
"""
WARNING: dont use loguru, use structlog
https://gist.github.com/nkhitrov/38adbb314f0d35371eba4ffb8f27078f
Configure handlers and formats for application loggers.
"""
import logging
import sys
from pprint import pformat
@darth-veitcher
darth-veitcher / gpt4all-mac.md
Created April 11, 2023 08:29
GPT4All on a Mac

High level instructions for getting GPT4All working on MacOS with LLaMACPP

See nomic-ai/gpt4all for canonical source.

Environment

  • This walkthrough assumes you have created a folder called ~/GPT4All. Adjust the following commands as necessary for your own environment.
  • It's highly advised that you have a sensible python virtual environment. A conda config is included below for simplicity. Install it with conda env create -f conda-macos-arm64.yaml and then use with conda activate gpt4all.
@darth-veitcher
darth-veitcher / set-optimum-cude-device.md
Last active April 11, 2023 07:44
Set Optimum CUDA device

Optimum CUDA Device

Simple script to detect operating system, GPU architecture, and return device for CUDA usage. Useful for when running on MacOS with Apple Silicon and need to swap out hardcoded cuda:0 type strings for mps.

"""Uses some sensible logic to determine platform and best available device for pytorch.

Assumed combinations (in order of preference):

* CUDA (nvidia GPU) / AMD (ROCm)
@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