Skip to content

Instantly share code, notes, and snippets.

@dot-mike
dot-mike / update_go.sh
Last active August 8, 2024 10:21
This script downloads and installs a specific version of Go lang
#!/usr/bin/env bash
# This script downloads and installs a specific version of Go.
# Check if the version is provided
if [ -z "$1" ]; then
echo "Usage: ./update_go.sh version (example 1.20.4 or latest)"
exit 1
fi
#unbind-key C-b
#set -g prefix 'C-a'
#bind-key 'C-a' send-prefix
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
@dot-mike
dot-mike / popos_post_install.sh
Created June 22, 2024 13:52
Installs packages on system after inital OS install
#!/usr/bin/env bash
sudo apt update && sudo apt upgrade -y
apt_packages=(
git
tmux
htop
curl
wget
vim
@dot-mike
dot-mike / caddy_ubuntu.sh
Last active July 5, 2024 23:25 — forked from abhishek77in/caddy_ec2_ubuntu22_04.sh
Script to install caddy
#!/bin/bash
sudo apt update
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
sudo tee /etc/caddy/Caddyfile > /dev/null <<EOF
yourdomain.com {
reverse_proxy localhost:7860
@dot-mike
dot-mike / twentythreevideoex.py
Created July 9, 2024 19:30
Yt-DLP plugin for detandreteatret / 23video.com
# coding: utf-8
from __future__ import unicode_literals
import re
# ⚠ Don't use relative imports
from yt_dlp.extractor.common import InfoExtractor
from yt_dlp.utils import int_or_none, try_get, clean_html, unescapeHTML
@dot-mike
dot-mike / gist:3dec5d3440c0ca8203670475a80ca700
Created December 2, 2024 17:43
haproxy true master for redis
frontend redis-read
bind *:6379
default_backend redis-online
frontend redis-write
bind *:6380
default_backend redis-primary
@dot-mike
dot-mike / new-vm-ps1
Created December 16, 2024 19:57
Hyper-V to create a new VM quickly from existing vhd file
$VMName = Read-Host 'Name your VM'
New-Item -Path C:\Hyper-V\ -Name "$VMname" -ItemType Directory -Force
Copy-Item -Path "C:\Hyper-V\W11DevEvalImage\WinDev2407Eval.vhdx" -Destination "C:\Hyper-V\$VMname\$vmname.vhdx" | Out-Null
New-VM -Name $VMName -Path C:\Hyper-V\$VMName -MemoryStartupBytes 8GB -VHDPath "C:\Hyper-V\$VMname\$vmname.vhdx" -Generation 2 -BootDevice VHD
Set-VM -Name $VMName -ProcessorCount 4
Set-VMMemory $VMName -DynamicMemoryEnabled $false
Set-VM -Name $VMName -CheckpointType Disabled
Connect-VMNetworkAdapter -VMName $VMName -SwitchName External
#TPM
@dot-mike
dot-mike / boxstarter.ps1
Last active December 20, 2024 19:11
Boxstarter script
# START http://boxstarter.org/package/nr/url?<url-gist>
#Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
choco install -y GoogleChrome
choco install -y Firefox
choco install -y 7zip.install
choco install -y microsoft-windows-terminal
choco install -y notepadplusplus.install
choco install -y fiddler
@dot-mike
dot-mike / !ComputerCraft GUI Framework.md
Last active January 17, 2025 19:45
ComputerCraft GUI Framework

ComputerCraft GUI Framework

A flexible GUI framework for ComputerCraft that provides a complete windowing system with tabs, buttons, labels, lists and graphs.

Features

  • Tabbed interface support
  • Multiple UI elements (buttons, labels, lists)
  • Flexible positioning system with anchoring
  • Global and element-specific styling
@dot-mike
dot-mike / README.md
Last active January 20, 2025 21:49 — forked from travelhawk/README.md
Use vagrant and ansible on Windows (WSL2)

Use vagrant and ansible on Windows (WSL2)

Making Vagrant and Virtualbox installed on Windows as a provider is not well documented across the documentations. This document outlines how to set this up.

Requirements

  • Windows 11
  • Virtualbox
  • WSL2