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 / 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
@felipealfonsog
felipealfonsog / arch-key-reset.sh
Last active March 30, 2024 04:59
Script to fix invalid PGP fail and transaction fail issue in Arch Linux
#!/bin/bash
# Script to fix invalid PGP fail and transaction fail issue in Arch Linux
# Computer Science Engineer: Felipe Alfonso González
# Github: https://github.com/felipealfonsog
# Email: [email protected]
# BSD 3-Clause License
echo "Welcome to the Arch Linux PGP key reset script!"
echo "This script will reset all pacman keys to solve the problem."
#!/bin/bash
gpg --check-trustdb 2>&1| grep 'not found' | awk '{print $8}' >bad-keys.txt
gpg --export-ownertrust > ownertrust-gpg.txt
mv ~/.gnupg/trustdb.gpg ~/.gnupg/trustdb.gpg-broken
for KEY in `cat bad-keys.txt` ; do sed -i "/$KEY/d" ownertrust-gpg.txt ; done
gpg --import-ownertrust ownertrust-gpg.txt
rm bad-keys.txt ownertrust-gpg.txt
@felipealfonsog
felipealfonsog / gitcheck.sh
Last active March 27, 2024 03:48
"Gitcheck," checks for repositories within a directory that require actions, such as adding files or committing changes.
#!/bin/bash
################################################################################
# Script: gitcheck #
# Description: Script to check for repositories needing actions. #
# Created by: Felipe Alfonso González - github.com/felipealfonsog - #
# [email protected] #
# License: BSD 3-Clause #
################################################################################