Skip to content

Instantly share code, notes, and snippets.

View nukhes's full-sized avatar
🇧🇷

Pedro Henrique nukhes

🇧🇷
  • ETEC
  • BR
  • 22:45 (UTC -03:00)
View GitHub Profile
@nukhes
nukhes / lockvital.sh
Created October 27, 2025 16:45
Hold updates for vital parts of Ubuntu/Linux
sudo apt-mark hold "grub-*" "grub2*" "linux-generic*" "linux-headers-generic*" "linux-image-generic*" "linux-signed-generic*" "linux-signed-image-generic*" linux-firmware intel-microcode amd64-microcode
@nukhes
nukhes / debloat.sh
Created October 27, 2025 01:50
Debloat Linux Mint 22.1 XFCE
sudo apt update -y && sudo apt remove --purge -y *thunderbird* libreoffice* celluloid sticky *calendar* cmatrix hypnotix rhythmbox *yaru* *papirus* && sudo apt autopurge -y
@nukhes
nukhes / overleaf_download.sh
Created September 20, 2025 21:24 — forked from MohamedElashri/overleaf_download.sh
Download all projects on overleaf all at once. #python
#!/bin/bash
now=`date +"%Y-%m-%d"`
directory=~/Documents//Overleaf/backup
outputTmpDirectory=$directory/tmp.zip
outputDirectory=$directory/$backup.zip
# To get the cookie
cookie=`python - << EOF
import re
# pip install mechanize
@nukhes
nukhes / cleanup_old_kernels.sh
Created September 13, 2025 18:52
Cleanup old kernels in Debian based systems (Ubuntu, Pop!_OS, Linux Mint).
#!/bin/bash
set -e
current=$(uname -r)
echo "Current kernel: $current"
kernels=$(dpkg --list | grep linux-image-[0-9] | awk '{print $2}')
to_remove=$(echo "$kernels" | grep -v "$current")
if [ -z "$to_remove" ]; then
@nukhes
nukhes / virtmanager.sh
Last active September 1, 2025 20:20
Setup VirtManager (KVM) in Debian based OSes.
#!/bin/bash
set -e
# Install required packages
sudo apt update
sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager
# Add current user to libvirt and kvm groups
sudo adduser "$USER" libvirt
sudo adduser "$USER" kvm
#!/bin/bash
# install_docker_agnostic.sh
# A comprehensive, agnostic bash script for Docker Engine installation and rootless configuration on Linux.
set -e
# --- Global Variables ---
DISTRO_ID=""
DISTRO_LIKE=""
PACKAGE_MANAGER=""
@nukhes
nukhes / lamp.sh
Last active May 24, 2025 16:24
Script para instalar a stack LAMP num Ubuntu
#!/bin/bash
echo "ESTE SCRIPT IRÁ INSTALAR O LAMP STACK NESTA MÁQUINA."
echo "Atualizando pacotes..."
sudo apt update -y && sudo apt upgrade -y
echo "Instalando Apache, MySQL, PHP e dependências..."
sudo apt install -y apache2 mysql-server php libapache2-mod-php php-mysql ufw
@nukhes
nukhes / disable_cache_and_logs.sh
Created October 5, 2024 12:47
Script that prevents writing cache and logs in a Linux environment, useful for a Raspberry Pi that uses the system on a microSD card and with eventual power losses the risk of losing data is greater if the system is writing to the card. Remember that this script may hinder future troubleshooting processes, use at your own risk.
#!/bin/bash
# Disable rsyslog (system log)
echo "Disabling rsyslog..."
systemctl stop rsyslog
systemctl disable rsyslog
# Disable journald (persistent logs)
echo "Disabling persistent logging for journald..."
sed -i 's/^#\?Storage=.*/Storage=none/' /etc/systemd/journald.conf