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 / fix-flutter.sh
Created October 24, 2025 22:04
This script fully removes conflicting Flutter and Dart packages, cleans caches, installs flutter-bin from AUR, adds the user to the flutter group, adjusts permissions, and verifies installation. It ensures a clean, conflict-free Flutter environment on Arch Linux.
#!/usr/bin/env bash
set -e
echo "=== Clean and safe Flutter-Bin installation ==="
# Function to remove packages if installed
remove_if_installed() {
for pkg in "$@"; do
if pacman -Qi "$pkg" &>/dev/null || yay -Qi "$pkg" &>/dev/null; then
echo "-> Removing conflicting package: $pkg"
@felipealfonsog
felipealfonsog / install_latest_firefox_linux.sh
Last active October 8, 2025 09:49
Install latest version of Firefox on Linux in the menu
#!/bin/bash
# Detect the package manager
if command -v pacman &> /dev/null; then
PACKAGE_MANAGER="pacman"
INSTALL_CMD="sudo pacman -S --noconfirm"
elif command -v apt &> /dev/null; then
PACKAGE_MANAGER="apt"
INSTALL_CMD="sudo apt install -y"
elif command -v dnf &> /dev/null; then
@felipealfonsog
felipealfonsog / add_pacmanrepo.sh
Last active October 6, 2025 08:54
Arch Linux Bin repo generator script - for a personal server
#!/bin/bash
set -e
PACMAN_CONF="/etc/pacman.conf"
REPO_NAME="gnlz"
REPO_URL="https://gnlz.cl/repo/\$arch"
if grep -q "^\[$REPO_NAME\]" "$PACMAN_CONF"; then
echo ">> Repository [$REPO_NAME] already exists in $PACMAN_CONF"
else
@felipealfonsog
felipealfonsog / install_notedeck_menu_nostr.sh
Last active September 22, 2025 05:06
Installs NoteDeck in KDE Plasma’s Internet menu with a Nostr icon, updates caches, and makes it appear immediately—no sudo or restart required.
#!/bin/bash
set -euo pipefail
APP_NAME="NoteDeck"
EXEC_PATH="/usr/bin/notedeck"
ICON_URL="https://raw.githubusercontent.com/github/explore/refs/heads/main/topics/nostr/nostr.png"
ICON_DIR="$HOME/.local/share/icons/hicolor/256x256/apps"
ICON_PATH="$ICON_DIR/notedeck-nostr.png"
DESKTOP_DIR="$HOME/.local/share/applications"

Keybase proof

I hereby claim:

  • I am felipealfonsog on github.
  • I am felipealfonsog (https://keybase.io/felipealfonsog) on keybase.
  • I have a public key ASDo6wD-QmniHwAHF7--HdLHSNv6kJ3UIg4I9PCFC3CC-go

To claim this, I am signing this object:

@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