Skip to content

Instantly share code, notes, and snippets.

@mdpuma
mdpuma / WHMCSDecryptor.php
Created February 23, 2024 18:43 — forked from Wruczek/WHMCSDecryptor.php
Simple PHP script to decrypt WHMCS hashed strings
<?php
$encoded_string = "JATa2iUqVdzCkBP5RiyitlQlUiACl8UrpJOeGUJO";
$cc_encryption_hash = "SOmECRAZYLONGHASHROFLCOPTERBBQKTHX";
echo decrypt_whmcs($encoded_string, $cc_encryption_hash);
function decrypt_whmcs($encoded_string, $cc_encryption_hash) {
$key = md5(md5($cc_encryption_hash)) . md5($cc_encryption_hash);
$hash_key = _hash($key);
$hash_length = strlen($hash_key);
@mdpuma
mdpuma / fastnetmon.conf
Created September 2, 2023 15:00
fastnetmon graphite exporter victoriametrics
# Graphite monitoring
graphite = on
# Please use only IP because domain names are not allowed here
graphite_host = xxx.xxx.xxx.xxx
graphite_port = 9109
# Default namespace for Graphite data
graphite_prefix = fastnetmon
# How often we export metrics to Graphite
/interface wireless channels
add band=2ghz-b/g/n width=20 list=2GHz/20MHz frequency=2412 name=ch1
add band=2ghz-b/g/n width=20 list=2GHz/20MHz frequency=2437 name=ch6
add band=2ghz-b/g/n width=20 list=2GHz/20MHz frequency=2462 name=ch11
add band=5ghz-onlyac width=20 list=5GHz/80MHz extension-channel=Ceee frequency=5180 name=ch36/38/42
add band=5ghz-onlyac width=20 list=5GHz/80MHz extension-channel=eCee frequency=5200 name=ch40/38/42
add band=5ghz-onlyac width=20 list=5GHz/80MHz extension-channel=eeCe frequency=5220 name=ch44/46/42
add band=5ghz-onlyac width=20 list=5GHz/80MHz extension-channel=eeeC frequency=5240 name=ch48/46/42
@mdpuma
mdpuma / tcpdump_rotate.sh
Created February 2, 2022 11:26
Tcpdump with rotate
#!/bin/bash
NET=1.1.1.1
tcpdump -i eth0 -n net $NET -G 1800 -w sip_dump_%d-%m-%y-%H-%M.pcap -v
@mdpuma
mdpuma / kvm980.xml
Created January 25, 2022 18:50
solusvm limit iops virsh
<blkiotune>
<device>
<path>/dev/vg/kvm980_img</path>
<read_iops_sec>100</read_iops_sec>
<write_iops_sec>100</write_iops_sec>
</device>
</blkiotune>
@mdpuma
mdpuma / copy_vm_proxmox_lve.sh
Last active March 5, 2022 05:11
copy_vm_proxmox_lve.sh
#!/bin/bash
SOURCE="vds2"
SOURCE_LVM=$1
DEST_LVM=$2
SIZE=$3
if [ "$SIZE" = "" ]; then
echo "Please specify size of lvm, example 32G"
exit
@mdpuma
mdpuma / script.sh
Created July 13, 2021 09:59
change csf/lfd firewall to cphulk blocking
#!/bin/bash
sed -i '/^LF_PERMBLOCK =/s/1/0/' /etc/csf/csf.conf
sed -i '/^CC_LOOKUPS =/s/CC_LOOKUPS.*/CC_LOOKUPS = "1"/' /etc/csf/csf.conf
sed -i '/^LF_TRIGGER =/s/LF_TRIGGER.*/LF_TRIGGER = "0"/' /etc/csf/csf.conf
sed -i '/^LF_TRIGGER_PERM =/s/LF_TRIGGER_PERM.*/LF_TRIGGER_PERM = "0"/' /etc/csf/csf.conf
sed -i '/^LF_EMAIL_ALERT =/s/LF_EMAIL_ALERT.*/LF_EMAIL_ALERT = "0"/' /etc/csf/csf.conf
sed -i '/^LF_SSHD =/s/LF_SSHD.*/LF_SSHD = "0"/' /etc/csf/csf.conf
sed -i '/^LF_FTPD =/s/LF_FTPD.*/LF_FTPD = "0"/' /etc/csf/csf.conf
sed -i '/^LF_SMTPAUTH =/s/LF_SMTPAUTH.*/LF_SMTPAUTH = "0"/' /etc/csf/csf.conf
@mdpuma
mdpuma / voxility.sh
Created July 11, 2021 15:11
voxility.sh
#!/bin/bash -e
action=$1
argument=$2
IPS="1.1.1.1/24 2.2.2.2/24"
case "$action" in
listips)
#for i in $IPS; do
@mdpuma
mdpuma / gist:12a73204fbb9e0fa6b43ce45affdb0c9
Last active February 23, 2021 09:48
tcpdump vlan capture tag priority
#!/bin/sh
# VLANID is 10 | 0xa
# VLANID is 20 | 0x14
# VLANID is 3342 | 0x0d0e
# VLANID is 3340 | 0x0d0c
# https://www.binaryhexconverter.com/hex-to-binary-converter
# https://www.tcpdump.org/manpages/pcap-filter.7.html