Skip to content

Instantly share code, notes, and snippets.

View larkinwc's full-sized avatar
🎯
Focusing

Larkin Williams-Capone larkinwc

🎯
Focusing
View GitHub Profile
@larkinwc
larkinwc / build_crosvm.sh
Created February 18, 2025 06:14
Script to install and build crosvm (with gpu mode) on a fresh install of debian 12
#!/bin/bash
# Exit on any error
set -e
# Function to print status messages
print_status() {
echo "===> $1"
}
@larkinwc
larkinwc / fix_docker_wsl.sh
Created February 16, 2025 21:17
Script to fix docker running in WSL if it crashes and won't start again with the message "/etc/init.d/docker: 62: ulimit: error setting limit (Invalid argument)"
#!/bin/bash
# Check if script is run as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (use sudo)"
exit 1
fi
echo "Setting ulimit..."
ulimit -n 524288
@larkinwc
larkinwc / get-eks.sh
Created November 19, 2024 16:04
EKS Cluster fetching script
#!/bin/bash
# Function to handle keyboard input
function select_option {
# Initialize variables
local selected=0
local options=("$@")
local key=""
# Hide cursor
@larkinwc
larkinwc / setupubuntulxc.sh
Last active October 11, 2024 01:23
Ubuntu LXC VDI Setup Script
#!/bin/bash
# Ubuntu-22.04-LXC-Desktop Setup Script
# Exit on any error
set -e
# Function to print messages
print_message() {
echo "===== $1 ====="
@larkinwc
larkinwc / obsidian_to_hugo.sh
Last active September 19, 2024 19:28
Bash script to take a specific obsidian note and copy it along with images into hugo content
#!/bin/bash
set -x # Enable debug mode
# Check if correct number of arguments are provided
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <obsidian_file> <hugo_content_dir> <hugo_post_name>"
exit 1
fi
@larkinwc
larkinwc / concat_md.sh
Created September 10, 2024 22:01
Bash script to copy all .md in the current directory. Useful to have Claude summarize notes from Obsidian
#!/bin/bash
# Create a temporary file
temp_file=$(mktemp)
# Concatenate all non-empty .md files in the current directory, adding titles and separators
for file in *.md; do
if [ -f "$file" ] && [ -s "$file" ] && ! [ -z "$(grep -v '^[[:space:]]*$' "$file")" ]; then
echo -e "\n====== $file ======\n" >> "$temp_file"
cat "$file" >> "$temp_file"