Skip to content

Instantly share code, notes, and snippets.

View abbott's full-sized avatar
🎯
Focusing

Bruce Abbott abbott

🎯
Focusing
View GitHub Profile
@angus-mcritchie
angus-mcritchie / wsl-2-static-ip-address.md
Last active January 8, 2024 19:29
WSL2 Static IP Address (Windows Host Override)

WSL 2 Static IP Address (Windows Host Override)

A crude, but effective solution for hosting local development projects inside WSL 2.

before you start

  • node js is required
  • ⚠️ this script changes your host file - save a copy of your host file before use

Steps

@Clustmart
Clustmart / export-safari-bookmarks.swift
Last active July 14, 2024 11:52
Export Safari bookmarks and folder structure to ~/bookmarks.csv
import Foundation
// Define the file path to save the CSV
let filePath = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("bookmarks.csv")
// Create the CSV file if it doesn't exist
if !FileManager.default.fileExists(atPath: filePath.path) {
FileManager.default.createFile(atPath: filePath.path, contents: nil, attributes: nil)
}
@JamesDawson
JamesDawson / setup-pyenv-poetry-windows.ps1
Last active November 14, 2024 15:38
Setup python, pyenv-win and poetry on Windows
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string] $PythonVersion
)
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
Set-StrictMode -Version Latest
@b0gdanw
b0gdanw / Disable-Ventura-Bloatware.sh
Last active October 18, 2024 02:02
Disable Ventura Bloatware
#!/bin/zsh
# Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
# Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12) and macOS Ventura (13)
# Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
# Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist
# To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot; sudo rm -r /private/var/db/com.apple.xpc.launchd/*
# user
@tprelog
tprelog / enable-docker.sh
Last active October 30, 2024 20:38
Use docker-compose on TrueNAS SCALE 22.12 (Bluefin) without Kubernetes
#!/usr/bin/env bash
#
# Enable docker and docker-compose on TrueNAS SCALE (no Kubernetes)
#
# This script is a hack! Use it at your own risk!!
# Using this script to enable Docker is NOT SUPPORTED by ix-systems!
# You CANNOT use SCALE Apps while using this script!
#
# 1 Create a dedicated Docker dataset in one of your zpools
@jamietre
jamietre / docker-compose.yml
Last active July 13, 2024 21:59
Script to start WSL and bind localhost to WSL IP
# Example docker-compose.yml for plex.
version: "2"
services:
plex:
image: plexinc/pms-docker:plexpass
runtime: nvidia
container_name: "plex"
restart: always
hostname: "MY-PLEX"
volumes:
@krzys-h
krzys-h / Hyper-V GPU-PV with Linux guest.md
Last active November 30, 2024 17:12
Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Modern versions of Windows support GPU paravirtualization in Hyper-V with normal consumer graphics cards. This is used e.g. for graphics acceleration in Windows Sandbox, as well as WSLg. In some cases, it may be useful to create a normal VM with GPU acceleration using this feature, but this is not officially supported. People already figured out how to do it with Windows guests though, so why not do the same with Linux? It should be easy given that WSLg is open source and reasonably well documented, right?

Well... not quite. I managed to get it to run... but not well.

How to do it?

  1. Verify driver support
@gangefors
gangefors / Install FreeNAS SCALE on a partition and create a mirror.md
Last active November 30, 2024 16:36
How to install TrueNAS SCALE on a partition instead of the full disk

Install TrueNAS SCALE on a partition instead of the full disk

The TrueNAS installer doesn't have a way to use anything less than the full device. This is usually a waste of resources when installing to a modern NVMe which is usually several hundred of GB. TrueNAS SCALE will use only a few GB for its system files so installing to a 16GB partition would be helpful.

The easiest way to solve this is to modify the installer script before starting the installation process.

@Jiab77
Jiab77 / setup-apcupsd-and-netdata-on-ubuntu.md
Last active September 3, 2024 12:35
In this document, I will explain how to setup apcupsd on Ubuntu 18.04 and 20.04.

Setup apcupsd and netdata on Ubuntu

In this document, I will explain how to setup apcupsd on Ubuntu 18.04 and 20.04.

I'll only document USB connected UPS and not the other supported connection modes.

Remove nut

If you have followed my previous gist related to nut, I'd serisouly recommend you to cleanup everything before continuing this gist.

@erkserkserks
erkserkserks / Fast UTM shared directories using Samba.md
Last active November 26, 2023 10:11
Fast UTM shared directories using Samba

Fast UTM shared directories using Samba

Problem

UTM's shared directory implementation relies on SPICE WebDAV, which is slow.

Solution

Use Samba for faster shared directories. Samba is ~5x faster, see benchmarks at the end.