Skip to content

Instantly share code, notes, and snippets.

View jesussuarz's full-sized avatar
🌀
Verified

Jesus Suarez jesussuarz

🌀
Verified
View GitHub Profile
@jesussuarz
jesussuarz / set_db_privileges.md
Last active May 17, 2024 07:43
Set DB privileges cPanel/WHM API

MySQL User Privilege Management Script

Description

This Python script automates the process of setting MySQL database privileges for users managed under a cPanel/WHM environment. It leverages the cPanel's UAPI and WHM API to modify database privileges based on a predefined list of users. The script is particularly useful for system administrators who need to manage database access rights efficiently across multiple users.

Features

  • List Accounts: Retrieves all cPanel accounts using the WHM API.
  • List Databases and Users: For each cPanel account, it lists all associated MySQL databases and the users who have access to them.
@jesussuarz
jesussuarz / SSH-Dynamic-Port-and-Security-Setup.md
Last active May 5, 2024 04:03
Advanced SSH Configuration Script for Dynamic Port Assignment and Enhanced Security

Advanced SSH Configuration Script for Dynamic Port Assignment and Enhanced Security

Introduction:

This Bash script automates the configuration of SSH services on Oracle Linux 8.9, including dynamic port assignment based on IP address input, SELinux and firewall adjustments, and SSH key pair generation with enhanced security measures.

Functionality:

The script starts by verifying the presence of an IP address as input. It then parses the IP address to construct a unique SSH port number based on predefined rules: the port number starts with a '6', followed by the first digit of the first IP octet, and the last digits of the remaining three octets.

Key Features:

The script provided is a Bash shell script designed to compute an SSH port number based on a specific set of rules applied to an input IP address. Here's a detailed description of how the script works and what it's designed to do:

Script Description:

The purpose of this Bash script is to dynamically calculate a port number for SSH connections based on a unique format derived from an IP address. The script takes a single IP address as an input argument and processes it to generate a custom SSH port. The custom port number is constructed following these rules:

  • The first digit of the port is always '6'.
  • The second digit is taken from the first digit of the first octet of the IP address.
  • The next three digits are composed of the last digit from each of the three remaining octets of the IP address.

This method ensures that each IP address is likely to correspond to a unique port number, facilitating distinct SSH configurations for different servers or devices identified by their IP addresses.

@jesussuarz
jesussuarz / How to Retrieve Secret Credentials from Jenkins for Docker Registry.md
Last active March 19, 2024 23:49
How to Retrieve Secret Credentials from Jenkins for Docker Registry

How to Retrieve Secret Credentials from Jenkins for Docker Registry

First off, I want to state that what I'm about to describe isn't lawful. If you need access to secret credentials, you should request them from your administrator. I am not responsible for any misuse of this information.

Understanding Our Goal

The aim is to obtain secret keys for Docker registry repositories accessible from a pipeline.

The Problem

When a pipeline runs, Docker registry credentials aren't exposed in the output. This is a security measure; credentials are replaced with asterisks, like so:

@jesussuarz
jesussuarz / Fix error JAVA PATH Site24x7 On-Premise Poller.md
Last active March 23, 2024 07:12
Fix error JAVA PATH Site24x7 On-Premise Poller

Fix error JAVA PATH Site24x7 On-Premise Poller

I recently encountered a somewhat annoying issue while attempting to install the Site24x7 On-Premise Poller on an AlmaLinux 8.9 machine.

The problem manifested as follows:

./Site24x7OnPremisePoller_64bit.bin Preparing to install... 
Extracting the JRE from the installer archive... 
Unpacking the JRE... 
@jesussuarz
jesussuarz / readme.md
Created February 25, 2024 01:55
Question forum for whmcs bypass with full updates

Question forum for whmcs bypass with full updates

Post your questions here

@jesussuarz
jesussuarz / Fixing: Passbolt Recovery Emails Not Arriving or Rarely Arriving.md
Last active February 10, 2024 09:25
Fixing: Passbolt Recovery Emails Not Arriving or Rarely Arriving

Fixing: Passbolt Recovery Emails Not Arriving or Rarely Arriving

I spent an entire day working to uncover solutions for this issue. Hopefully, you can appreciate the effort with a comment 😊

There are two paths to consider. It's important to note that all steps were taken on a CentOS 7 server with a PRO installation (which allows updating from the Passbolt master branch).

Solution 1: Adjusting Mail Size Limits

Firstly, check if the Postfix mail server is queuing the emails. This can be done by tailing the mail log file:

@jesussuarz
jesussuarz / Connection Speed Tests on OVH Network Servers.md
Created February 7, 2024 05:34
Connection Speed Tests on OVH Network Servers

Connection Speed Tests on OVH Network Servers

For Windows Servers:

Simply navigate to the following link from your server's web browser: http://proof.ovh.net

For Linux Servers:

Find available files to test different connection sizes:

@jesussuarz
jesussuarz / Fixing Connection SSH Issues from ESXi 8 to a Remote Server on OVH Servers.md
Last active February 6, 2024 05:00
Fixing Connection SSH Issues from ESXi 8 to a Remote Server on OVH Servers

Fixing Connection SSH Issues from ESXi 8 to a Remote Server on OVH Servers

If you're facing difficulties when trying to connect from an ESXi 8 server hosted on OVH to another remote server, here's a step-by-step solution to resolve it.

Step 1: Verify the Status of the SSH Service

First, it's important to confirm whether the SSH service is enabled on your ESXi 8 server. To do so, execute the following command:

chkconfig --list | grep on
@jesussuarz
jesussuarz / Change User Role to Administrator in Passbolt from the Database using phpMyAdmin.md
Last active February 4, 2024 01:41
Change User Role to Administrator in Passbolt from the Database using phpMyAdmin

Change User Role to Administrator in Passbolt from the Database using phpMyAdmin

If you have a user in Passbolt and have access to the database, you can make that user an administrator by following these steps:

Step 1: Access phpMyAdmin on your server

First, log in to phpMyAdmin on your server.

Step 2: Access the Role Table