Skip to content

Instantly share code, notes, and snippets.

@computersrmyfriends
computersrmyfriends / Add-WindowsTerminalToWinX.ps1
Last active December 26, 2025 08:54
Add Windows Terminal to Win+X menu on Windows 10
<#
.SYNOPSIS
Adds Windows Terminal to the Win+X menu on Windows 10.
.DESCRIPTION
This script downloads pre-hashed Windows Terminal shortcuts and adds them to the Win+X menu.
It creates both regular and administrator versions of Windows Terminal shortcuts.
Original PowerShell shortcuts are backed up before modification.
.NOTES
@computersrmyfriends
computersrmyfriends / styletts2_demo_libritts.ipynb
Created February 17, 2025 19:35
StyleTTS2_Demo_LibriTTS.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@computersrmyfriends
computersrmyfriends / windows-ssh-server-install.ps1
Created August 9, 2024 04:35
One liner open ssh server install for windows
$sshServerCapability = Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'; if ($sshServerCapability.State -ne 'Installed') { Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0; Write-Output "OpenSSH Server installed."; } else { Write-Output "OpenSSH Server is already installed."; }; Set-Service -Name sshd -StartupType 'Automatic'; Write-Output "sshd service startup type set to 'Automatic'."; if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) { Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."; New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22; Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' created."; } else { Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' already exists."; }; Start-Service -Name sshd; Write-Output "sshd service started."; $serviceStatus = G
@computersrmyfriends
computersrmyfriends / FULL TMUX INFO
Last active July 20, 2024 19:29
Gets and Prints a report of all the running processes within all tmux sessions, windows and panes
#!/bin/bash
get_pane_info() {
local session=$1
local window=$2
local pane=$3
# Get the pane's PID
local pane_pid=$(tmux display-message -p -t "${session}:${window}.${pane}" '#{pane_pid}')
@computersrmyfriends
computersrmyfriends / install_google_chrome.sh
Created July 20, 2024 09:00
Auto install latest Google Chrome browser in Linux
#!/bin/bash
# Exit immediately if a command exits with a non-zero status.
set -e
# Define the URL for the Google signing key and the destination file
GOOGLE_KEY_URL="https://dl-ssl.google.com/linux/linux_signing_key.pub"
KEYRING_PATH="/etc/apt/keyrings"
KEYRING_FILE="${KEYRING_PATH}/google-chrome.gpg"
REPO_FILE="/etc/apt/sources.list.d/google-chrome.list"
@computersrmyfriends
computersrmyfriends / install__rust_alacritty.sh
Created July 20, 2024 05:30
Install Alacritty and Rust all users Linux
#!/bin/bash
# Function to install dependencies
install_dependencies() {
sudo apt update
sudo apt install -y build-essential cmake libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev tmux
}
# Function to install Rust and Cargo
install_rust() {
@computersrmyfriends
computersrmyfriends / INCREASE_TMUX_HISTORY_ALL_USERS.sh
Last active August 6, 2024 21:30
Permanently increase tmux history size for all users ONE LINER
sudo bash -c 'for user_home in /home/*; do [ -d "$user_home" ] && (touch "$user_home/.tmux.conf"; grep -qxF "set -g history-limit 10000" "$user_home/.tmux.conf" || echo "set -g history-limit 10000" >> "$user_home/.tmux.conf"); done; touch /root/.tmux.conf; grep -qxF "set -g history-limit 10000" /root/.tmux.conf || echo "set -g history-limit 10000" >> /root/.tmux.conf; echo "History limit set to 10000 for all users. Reload your tmux sessions."'
@computersrmyfriends
computersrmyfriends / TMUX_ENABLE_MOUSE_ALL_USERS.sh
Last active August 6, 2024 21:28
Permanently enable mouse tmux one liner
sudo bash -c 'for user_home in /home/*; do [ -d "$user_home" ] && (touch "$user_home/.tmux.conf"; grep -qxF "set -g mouse on" "$user_home/.tmux.conf" || echo "set -g mouse on" >> "$user_home/.tmux.conf"); done; touch /root/.tmux.conf; grep -qxF "set -g mouse on" /root/.tmux.conf || echo "set -g mouse on" >> /root/.tmux.conf; echo "Mouse support added to all .tmux.conf files. Reload your tmux sessions."'
#!/bin/bash
# Function to detect OS and architecture
detect_os_arch() {
OS=$(uname | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case "$OS" in
linux)
if [[ "$ARCH" == "x86_64" ]]; then
@computersrmyfriends
computersrmyfriends / gist:309126397e689e3338641b10ad474def
Created February 12, 2024 10:51
Compile ffmpeg with nvenc for Ubuntu 22
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
# ripped from https://gist.github.com/Brainiarc7/3f7695ac2a0905b05c5b
# updated to my personal needs
# tested on Ubuntu 22
# refer here: