Skip to content

Instantly share code, notes, and snippets.

View taidos's full-sized avatar
🎯
Focusing

Carlos Faustino taidos

🎯
Focusing
View GitHub Profile
@taidos
taidos / generateWhmcsUuids.php
Created September 7, 2020 07:01 — forked from robetus/generateWhmcsUuids.php
WHMCS UUID Generator for clients and admins. Tested working on WHCMS 7.4.1
<?php
/**
* Generate uuids for clients and admins that don't have uuids set.
*
* The WHMCS 7.4.1 update process automatically inserts uuids, but if your
* installation bypasses WHMCS update routines then this will generate uuids for
* the client and admin users that don't have one yet.
*
* Warning! Please back up at least your tblclient and tbladmin tables before
* running this!
@taidos
taidos / kloxo api lib
Created September 16, 2020 14:59 — forked from jutaz/kloxo api lib
kloxo api lib
<?php
class Kloxo
{
public $CI;
public $KloxoCore;
public $helper;
public function __construct()
{
# Copied from http://ttaportal.org/wp-content/uploads/2012/10/7-Reallocation-using-LVM.pdf
##
## Showing the problem: need to reallocate 32GB from /dev/mapper/pve-data to /dev/mapper/pve-root
##
df -h
# Filesystem Size Used Avail Use% Mounted on
# /dev/mapper/pve-root 37G 37G 0 100% /
# tmpfs 2.0G 0 2.0G 0% /lib/init/rw
@taidos
taidos / proxmox_resize_pve-root
Created January 24, 2021 08:35
Proxmox - Resize pve-root
# Check disk space before
df -h
# Delete local-lvm storage in gui
lvremove /dev/pve/data
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@taidos
taidos / cf-ddns.sh
Created August 8, 2021 04:41 — forked from yashodhank/cf-ddns.sh
Cloudflare API v4 Dynamic DNS Update for both IPv4 and IPv6 with Proxy Mode On/Off in Bash
#!/bin/bash
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
# CHANGE THESE
auth_email="[email protected]"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings | Login >> My Profile >>> Scroll down to API Keys and locate Global API Key >>>> Click API Key to see your API identifier
record_name="www.example.com"
zone_identifier="023e105f4ecef8ad9ca31a8372d0c353"
record_identifier_ipv4="372e67954025e0ba6aaa6d586b9e0b59" # use List DNS Records api to get record id, link below ↓ or see help above.
#!/bin/bash
SERVER_NAME="$(ifconfig | grep broadcast | awk {'print $2'} | head -1)" # get IP
# SERVER_NAME="$(ifconfig | grep broadcast | awk {'print $2'} | awk '{if(NR==1) print $0}')"
# SERVER_NAME="$(ifconfig | grep broadcast | awk {'print $2'} | sed -n 1p)"
TIMESTAMP=$(date +"%F")
BACKUP_DIR="/root/backup/$TIMESTAMP"
MYSQL_USER="user"
MYSQL_PASSWORD="pass"
MYSQL=/usr/bin/mysql
#!/bin/bash
MYSQL=`which mysql`
MYSQLUSER=root
MYSQLPASSWD=`grep ^mysql= /usr/local/directadmin/scripts/setup.txt|cut -d'=' -f2`
MYSQLHOST=localhost
DST=/var/spool/mysqlsfp
DST=$DST/`date +%Y-%m-%d`
#!/bin/bash
#Server hardening script for cPanel servers
# Make sure only root can run this script
if [ "$(id -u)" != "0" ]; then
echo -e "\e[93m This script must be run as root \e[0m"
exit 1
fi
echo -e "\e[1;36;40m Server Hardening initiated \e[0m"
@taidos
taidos / fullbackup.php
Created August 21, 2021 03:22 — forked from JShipps/fullbackup.php
cPanel Full Backup Script
<?php
$cpaneluser = 'user'; // cPanel username
$cpaneluserpass = 'pass'; // cPanel password
$theme = 'paper_lantern'; // Must match current selected cPanel theme ('paper_lantern' in the majority of cases, 'x3' is possible as well)
$ftp = true; // If it's false the backup will be stored in user's home directory, otherwise it will be uploaded via FTP to some custom location
$ftpserver = 'serverX.web-hosting.com'; // Must be localhost for current server or custom hostname for remote FTP upload
$ftpusername = 'user'; // cPanel/SFTP username. Should be the same as cPanel username for local upload or custom for remote upload
$ftppassword = 'pass'; // cPanel/SFTP password. Should be the same as cPanel password for local upload or custom for remote upload
$ftpport = '21098'; // SFTP port. Should be 21 in most cases.
$ftpdirectory = '/home/user/backups'; // Directory on FTP server to store backups. MUST EXIST BEFORE BACKUP OR BACKUP PROCESS WILL FAIL