Skip to content

Instantly share code, notes, and snippets.

@moon0440
moon0440 / tasks-from-sow-aks-dr.md
Last active March 28, 2024 14:40
Disaster Recovery: Azure Kubernetes Service (AKS) Environments

Disaster Recovery for Azure Kubernetes Service (AKS) Environments

Summary

This document provides a structured framework for creating, implementing, and continually refining a Disaster Recovery (DR) plan tailored to Azure Kubernetes Service (AKS). It spans eight phases, starting from problem definition, where essential services and compliance needs are pinpointed, alongside Recovery Time Objective (RTO) and Recovery Point Objective (RPO). The journey continues through meticulous research and planning stages, evaluating both Azure-native and third-party DR tools, and laying out a detailed DR solution design that meets organizational requirements.

Key phases include designing and developing the DR infrastructure with a focus on automation and security, executing and rigorously testing the DR setup to ensure readiness, and a phase dedicated to evaluation and iterative improvement based on real-world feedback. Comprehensive documentation and training sections ensure all stakeholders are knowledgeable and pr

@moon0440
moon0440 / install
Created March 22, 2024 18:44
Ubuntu Docker Setup
USERNAME='b'
apt install -y sudo
useradd $USERNAME --create-home -G sudo --shell /bin/bash
echo '%sudo ALL=(ALL:ALL) NOPASSWD: ALL' | sudo EDITOR='tee -a' visudo
sh <(curl -L https://nixos.org/nix/install) --no-daemon
nix-env --install --attrs nixpkgs.neovim
git clone https://github.com/NvChad/starter ~/.config/nvim && nvim
@moon0440
moon0440 / email_answer.py
Created March 22, 2024 14:44
Email LLM/LangChain Example
# pip install -q langchain openai chromadb tiktoken
import os
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.vectorstores import Chroma
from langchain.text_splitter import CharacterTextSplitter
from langchain.llms import OpenAI
from langchain.chains import RetrievalQA, LLMChain, TransformChain, SimpleSequentialChain, SequentialChain
from langchain.document_loaders import TextLoader
from langchain.prompts import PromptTemplate
@moon0440
moon0440 / install.sh
Last active March 18, 2024 14:38
Ubuntu nvchad install
#/usr/bin/env bash
# Check for Supported os: currently only Ubuntu 20.04
if [[ $(grep 'NAME=' /etc/os-release) != *"Ubuntu"* ]] || [[ $(grep 'VERSION_ID=' /etc/os-release) != *"20.04"* ]]; then
echo "Unsupported OS. This script only supports Ubuntu 20.04."
exit 1
fi
packages=("nvim" "ripgrep" "gcc" "make", "npm)
packages_to_install=()
@moon0440
moon0440 / fix-off-screen.sh
Created October 1, 2022 21:19
wsl2 fix for off screen windows in wslg
#!/usr/bin/env bash
# Can be added to bashrc to load into shell
function resetwindow {
for pid in $(xdotool search -name --onlyvisible --maxdepth 2 .); do
read -r x y < <(xwininfo -id "$pid" | grep Absolute | awk '{print $4}' | xargs)
if [[ "$x" -lt 1 ]] || [[ "$y" -lt 1 ]]; then
xdotool windowmove "$pid" 150 150
fi
done

Keybase proof

I hereby claim:

  • I am moon0440 on github.
  • I am blakemoon (https://keybase.io/blakemoon) on keybase.
  • I have a public key ASB7VqS41f4yG9je--7O4HWKVRzWQO82aOhFCQRLZGsVtwo

To claim this, I am signing this object:

@moon0440
moon0440 / mp4togif.sh
Last active September 30, 2021 16:23
Ubuntu 20.04 mp4 to gif
#!/usr/bin/env bash
filename=${1%.*}
ffmpeg -i $1 -vf "fps=10,scale=512:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 $filename.gif
@moon0440
moon0440 / .vimrc
Last active November 13, 2020 15:17
Windows 10 GVIM settings
set guifont=Consolas:h10
colorscheme slate
set ruler
"set guioptions-=m "menu bar
set guioptions-=T "toolbar
set guioptions-=r "scrollbar
set bs=2 " allow backspacing over everything in insert mode
set belloff=all
set mouse-=a
set guioptions+=a "Mouse highlight auto copy
@moon0440
moon0440 / camlink4k-v4l2-dummy.sh
Created October 7, 2020 16:30
CamLink 4k with hero 5 camera. Creates video4linux dummy device for ubuntu 20.04
sudo modprobe v4l2loopback devices=1 exclusive_caps=1
# v4l2-ctl --list-devices
# Get the video devices for the camlink and dummy.
#Dummy video device (0x0000) (platform:v4l2loopback-000):
# /dev/video2
#
#Cam Link 4K: Cam Link 4K (usb-0000:08:00.0-2):
# /dev/video0
# /dev/video1
# /dev/media0