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 / setup-battery-hibernate.sh
Created July 19, 2025 10:35
sudo bash setup-battery-hibernate.sh
#!/bin/bash
set -e
echo "🔧 Creating 8G swap file at /swapfile..."
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
@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
@felipealfonsog
felipealfonsog / system.sh
Created September 28, 2024 20:14
System Management Linux+Mac
#!/bin/bash
# Action Script
# Author: Felipe Alfonso González
# GitHub: github.com/felipealfonsog
# Contact: [email protected]
# License: BSD 3-Clause License
# Function to display the options menu
display_menu() {
@felipealfonsog
felipealfonsog / manage_onedrive.sh
Created September 4, 2024 05:32
Manage onedrive on Arch Linux, using systemd to enable or disable a service or daemon for continuous syncing.
#!/bin/bash
SERVICE_NAME="onedrive"
CONFIG_DIR="$HOME/.config/onedrive"
SYNC_DIR="$HOME/OneDrive"
# Check if onedrive is installed
if ! command -v onedrive &> /dev/null; then
echo "'onedrive' command not found. Please install it with yay or check your installation."
exit 1
@felipealfonsog
felipealfonsog / Guide to Create a `.deb` Package
Created July 25, 2024 14:54
Step-by-Step Guide to Create a `.deb` Package for `project`
# Step-by-Step Guide to Create a `.deb` Package for `project`
## 1. Prepare the Project Directory Structure
Ensure your project directory structure is as follows:
project/
├── DEBIAN/
│ ├── control
│ └── postinst
@felipealfonsog
felipealfonsog / apache_and_php.md
Created July 24, 2024 06:15 — forked from superjojo140/apache_and_php.md
Apache, PHP, MariaDB and PhpMyAdmin on Archlinux

Guide to install a LAMP system on on your archlinux system and serve php-based database applications.
LAMP stands for a Linux system with Apache (webserver), MariaDB (database) and PHP (programming language). In this guide we will also install PhpMyAdmin (database admin GUI) to easily manage the SQL tables.

Apache

apache logo

The Apache HTTP Server is an open-source and free product of the Apache Software Foundation and one of the most widely used web servers on the Internet. In addition to factors such as performance, expandability, security, freedom from license costs and support from a very large community, its long-term availability for a wide variety of operating systems is one of the reasons for its widespread use; it is most frequently used as a LAMP system.

Install packages

@felipealfonsog
felipealfonsog / noip.sh
Last active May 3, 2024 03:58
This Bash script updates a Dynamic DNS hostname using the 'noip-duc' command with preset parameters.
#!/bin/bash
# By Computer Science Engineer: Felipe Alfonso González
# Github.com/felipealfonsog
# Define command parameters
hostname="server.ddns.net"
username="......"
password="......"
@felipealfonsog
felipealfonsog / netctrl.sh
Last active May 10, 2024 00:31
NetCtrl is a script to remotely manage multiple machines on your local network. (For macOS Intel/Apple Silicon & Linux Arch / Debian)
#!/bin/bash
# Function to display a welcome message
welcome_message() {
echo "Welcome to NetCtrl!"
echo "NetCtrl is a script to remotely manage multiple machines on your local network."
echo "By computer science engineer Felipe Alfonso González - GitHub.com/felipealfonsog"
echo "Let's get started."
echo
}
[settings]
debug = false
hidefilenames = false
ignore =
COMMIT_EDITMSG$
PULLREQ_EDITMSG$
MERGE_MSG$
TAG_EDITMSG$
api_key=waka_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx