Skip to content

Instantly share code, notes, and snippets.

@FaserF
FaserF / autounattend.xml
Last active February 25, 2025 15:30
Silent Windows 11 Pro installation
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64"
publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
</component>
</settings>
@pa-0
pa-0 / .cleanup.sh
Created January 22, 2025 07:33 — forked from ivanistheone/.cleanup.sh
A shell script I use to (mostly) automatically cleanup my ~/Desktop
#!/bin/bash
MYHOME=$HOME
MYDESKTOP=$HOME/Desktop
echo " _ "
echo " | | "
echo " ___ | | ___ __ _ _ __ _ _ _ __ "
echo " / __|| |/ _ \/ _ | '_ \| | | | '_ \ "
echo " | (__ | | __/ (_| | | | | |_| | |_) |"
echo " \___||_|\___|\__,_|_| |_|\__,_| .__/ "
@ChuckieChen945
ChuckieChen945 / Sophia.ps1
Last active December 24, 2024 21:20
个人重装系统所用的脚本
<#
.SYNOPSIS
Default preset file for "Sophia Script for Windows 11 (PowerShell 7)"
Version: v6.1.3
Date: 26.07.2022
Copyright (c) 2014—2022 farag
Copyright (c) 2019—2022 farag & Inestic
@lumiobrie
lumiobrie / PowerToolkit.psm1
Last active January 30, 2025 13:10
Módulo multipropósito para configuraciones varias en Windows y análisis y tratamiento de archivos de audio
using namespace System.IO;
function Get-GistContent {
param (
[Parameter(Position = 0, Mandatory = $true)]
[string] $gistId
)
# Define the Gist API URL using the provided gistId
$apiUrl = "https://api.github.com/gists/$gistId"
@scowalt
scowalt / !machine-setup.scripts.md
Last active March 2, 2025 08:26
Machine setup scripts

Machine setup scripts

Idempotent scripts I use to set up my machines.

Windows

iwr -useb https://scripts.scowalt.com/setup/win.ps1 | iex
variables() {
NSAPP=$(echo ${APP,,} | tr -d ' ') # This function sets the NSAPP variable by converting the value of the APP variable to lowercase and removing any spaces.
var_install="${NSAPP}-install" # sets the var_install variable by appending "-install" to the value of NSAPP.
INTEGER='^[0-9]+([.][0-9]+)?$' # it defines the INTEGER regular expression pattern.
}
# This function sets various color variables using ANSI escape codes for formatting text in the terminal.
color() {
YW=$(echo "\033[33m")
BL=$(echo "\033[36m")
rem ---------------------------------------------------------------------------
rem MY ULTIMATE WINDOWS 11 CUSTOMIZATION SCRIPT
rem ---------------------------------------------------------------------------
rem Tested on Windows 11 IoT Enterprise LTSC 24H2 Build 26100.2033
rem Most of these hacks require signing out and in again.
rem ___
rem Explanation of registry flags:
rem /f = Overwrite
rem /d = Assigns the specified data to the registry value.
@Hackiri
Hackiri / proxmox_template_builder.sh
Last active December 3, 2024 03:46
create cloud init template proxmox
#!/bin/bash
# Exit immediately if a command exits with a non-zero status.
set -e
# Function to check for required utilities
function check_utilities() {
local utilities=("qm" "wget" "xz" "sha256sum" "ssh-keygen")
for util in "${utilities[@]}"; do
command -v "$util" >/dev/null 2>&1 || { echo "$util not found. Please install it."; exit 1; }
#!/bin/bash
set -e # Exit on any command failure
# Variables
STORAGE="local-lvm"
MEMORY=4096
DISK_SIZE="5G" # You can adjust this if needed
BRIDGE="V10"
IMAGES_DIR="/var/lib/vz/template/iso" # Common image directory
@Nikolai2038
Nikolai2038 / ini_file_variable_get.sh
Last active March 2, 2025 21:58
Bash: Get and set specified variable in specified section of `.ini` file using `awk`
#!/bin/bash
main() {
local ini_file="${1}" && { shift || true; }
local section_name="${1}" && { shift || true; }
local variable_name="${1}" && { shift || true; }
if [ -z "${ini_file}" ] || [ -z "${section_name}" ] || [ -z "${variable_name}" ]; then
echo "Usage: ini_file_variable_get.sh <ini_file> <section_name> <variable_name> [is_error_if_section_is_not_found=1] [is_error_if_variable_is_not_found=1]" >&2
return 1
fi