Skip to content

Instantly share code, notes, and snippets.

View det-peralta's full-sized avatar
💭
I may be slow to respond.

sirdetperalta det-peralta

💭
I may be slow to respond.
  • Portugal
View GitHub Profile
@det-peralta
det-peralta / install_docker_on_debian_wsl2.sh
Last active December 27, 2021 11:49
Install Docker Engine on Debian WSL2
#!/bin/sh
#Uninstall docker old versions
sudo apt remove --yes docker docker-engine docker.io containerd runc || true
#Set up the docker repository
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
@det-peralta
det-peralta / mouse_jiggler.ps1
Created November 29, 2022 14:02
Mouse jiggler
Add-Type -AssemblyName System.Windows.Forms
while ($true)
{
$Pos = [System.Windows.Forms.Cursor]::Position
$x = ($pos.X % 500) + 1
$y = ($pos.Y % 500) + 1
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
Start-Sleep -Seconds 10
}
@det-peralta
det-peralta / setup_github_auth.sh
Created May 14, 2024 16:38
This bash script helps automate the setup of GitHub authentication using either a Personal Access Token (PAT) or SSH keys. Follow the script prompts to configure your GitHub credentials securely and efficiently.
#!/bin/bash
# Function to configure Git to use a Personal Access Token (PAT)
setup_pat() {
echo "Configuring Git to use a Personal Access Token (PAT)..."
read -p 'Enter your GitHub username: ' github_username
echo "Please generate a PAT from https://github.com/settings/tokens and copy it."
read -sp 'Enter your GitHub Personal Access Token: ' github_pat
echo
@det-peralta
det-peralta / create_samba_share.sh
Last active May 15, 2024 22:44
Bash script for setting up an authenticated Samba share on Debian, automating installation and configuration for easy network sharing.
#!/bin/bash
# Function to prompt for user input
prompt_for_input() {
local prompt="$1"
local variable_name="$2"
local input
while true; do
printf "%s: " "$prompt"
#!/bin/bash
# Global variables
SSH_CONFIG="/etc/ssh/sshd_config"
SSH_CONFIG_D="/etc/ssh/sshd_config.d/60-cloudimg-settings.conf"
# Function to update system repositories
update_system() {
sudo apt update && sudo apt upgrade -y
}
@det-peralta
det-peralta / passthru-nvidia-to-lxc.sh
Created May 20, 2024 10:11 — forked from paul-chambers/passthru-nvidia-to-lxc.sh
nvidia GPU passthru to an LXC container (for Debian)
#!/bin/bash
# In both host and container, add the nVidia repros (see https://nvidia.github.io/nvidia-container-runtime/)
set -x
which curl > /dev/null || apt install curl
# add the repo key:
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add -
# add the 'nvidia container runtime' repo to apt's sources
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)