Skip to content

Instantly share code, notes, and snippets.

View felipealfonsog's full-sized avatar
🧳
Working from home

Felipe Alfonso González felipealfonsog

🧳
Working from home
View GitHub Profile
@felipealfonsog
felipealfonsog / config.php-apache.sh
Created September 18, 2025 03:58
Apache, PHP, and MariaDB have been installed and configuration script
#!/bin/bash
# Actualizar sistema
sudo pacman -Syu --noconfirm
# Instalar Apache, PHP, módulos PHP y MariaDB
sudo pacman -S --noconfirm apache php php-apache mariadb
# Configurar Apache para PHP
sudo sed -i '/#LoadModule mpm_event_module modules\/mod_mpm_event.so/s/^#//' /etc/httpd/conf/httpd.conf
@felipealfonsog
felipealfonsog / disable_zram.sh
Created September 18, 2025 03:33
Fix Zram disabled and swapfile configured
#!/bin/bash
set -e
echo "🔧 Disabling zram swap..."
# 1. Turn off zram if active
if swapon --summary | grep -q zram0; then
echo "🛑 Turning off /dev/zram0 swap..."
sudo swapoff /dev/zram0 || echo "⚠️ Failed to swapoff /dev/zram0"
fi
@felipealfonsog
felipealfonsog / fix-broadcom.sh
Created September 18, 2025 03:31
Fix broadcom driver en Arch con broadcom-wl-dkms
#!/bin/bash
echo "🔧 Verificando conexión a Internet..."
if ping -c 1 archlinux.org &>/dev/null; then
echo "✅ Conexión detectada."
else
echo "❌ No hay conexión a Internet. Conecta un cable Ethernet y vuelve a intentarlo."
exit 1
fi
@felipealfonsog
felipealfonsog / fix-wayland-browsers.sh
Last active October 8, 2025 16:57
Fix for Brave & Chrome work in XWayland / Wayland
#!/usr/bin/env bash
# Enable native Wayland support for Chromium-based browsers
# Tested on Arch Linux
set -e
FLAGS=(
"--enable-features=UseOzonePlatform"
"--ozone-platform=wayland"
"--enable-features=WebRTCPipeWireCapturer"
@felipealfonsog
felipealfonsog / launch_browser.sh
Created September 14, 2025 06:08
This Bash script helps launch Google Chrome or Chromium on Arch Linux with KDE, handling known issues with Wayland, KWin, and GPU rendering.
#!/bin/bash
# Script definitivo para lanzar Chrome/Chromium en Arch KDE
# Detecta Wayland y conflictos típicos, fuerza X11 si es necesario
echo "Which browser do you want to run?"
echo "1) Google Chrome"
echo "2) Chromium"
read -rp "Enter 1 or 2: " choice
@felipealfonsog
felipealfonsog / fix-pip.sh
Last active March 23, 2026 20:19
Removing Python's EXTERNALLY-MANAGED lock
#!/usr/bin/env bash
echo "──────────────────────────────────────────────"
echo " Removing Python's EXTERNALLY-MANAGED lock "
echo "──────────────────────────────────────────────"
echo "* Developed and engineered by:"
echo "* Felipe Alfonso Gonzalez <f.alfonso@res-ear.ch>"
echo "* Computer Science Engineer"
echo "* Chile"
echo "------------------------------------------------"
@felipealfonsog
felipealfonsog / brew-safe-upgrade.sh
Created August 7, 2025 21:44
Safe upgrade for each outdated package on brew (macOS)
#!/bin/bash
# Lista de paquetes desactualizados
outdated=$(brew outdated --formula | awk '{print $1}')
echo "Starting safe upgrade for each outdated package..."
for pkg in $outdated; do
echo "-----------------------------"
echo "Upgrading: $pkg"
@felipealfonsog
felipealfonsog / install-battery-hibernate.sh
Last active October 1, 2025 03:15
Battery Hibernate Script - This script monitors the laptop’s battery status and safely hibernates the system when the battery level reaches a critical threshold. - sudo bash install-battery-hibernate.sh
#!/bin/bash
set -e
echo "🔧 Installing battery hibernate script..."
# Crear script seguro
sudo tee /usr/local/bin/battery-hibernate.sh > /dev/null <<'EOF'
#!/bin/bash
@felipealfonsog
felipealfonsog / wifi-autoconnect-setup.sh
Last active July 19, 2025 05:25
This script keeps WiFi connected when the laptop lid is closed and auto-reconnects if disconnected.
#!/bin/bash
# Ensure the script is run as root
if [[ "$EUID" -ne 0 ]]; then
echo "Please run as root"
exit 1
fi
echo "1. Mark all WiFi services as autoconnect..."
for service in $(connmanctl services | awk '/^\*/{print $3}'); do
@felipealfonsog
felipealfonsog / IntelOptimizer.sh
Created January 15, 2025 07:05
A comprehensive optimization script for Intel processors (i1 to i9) designed to enhance thermal management, power efficiency, and performance on laptops and Macs.
#!/bin/bash
# Program: IntelOptimizer
# Description: Optimizes thermal management, power efficiency, and performance for Intel processors (i1 to i9).
# Author: Felipe Alfonso Gonzalez - github.com/felipealfonsog
# Check if the script is run as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (sudo)." >&2
exit 1