Skip to content

Instantly share code, notes, and snippets.

@mdpuma
mdpuma / tuned-adm.sh
Created May 22, 2026 18:21
Troubleshoot high cpu power consumption Cloudlinux Tuned
#!/bin/bash
# default installed profile
[root@194-33-42-41 home]# tuned-adm active
Current active profile: cloudlinux-latency-performance-cgv2
# change profile
tuned-adm profile cloudlinux-default-cgv2
@mdpuma
mdpuma / ioc_checksessions_files.sh
Created April 30, 2026 07:46
ioc_checksessions_files.sh
#!/bin/bash
# Scan for compromised session files
SESSIONS_DIR="/var/cpanel/sessions"
COMPROMISED=0
echo "[*] Scanning session files for injection indicators..."
for session_file in "$SESSIONS_DIR"/raw/*; do
[ -f "$session_file" ] || continue
@mdpuma
mdpuma / get_top_talkers_src.sh
Created September 10, 2025 04:45
conntrack show top talkers
#!/bin/bash
# Show top talkers from conntrack
# Needs: conntrack package (conntrack-tools)
conntrack -L 2>/dev/null \
| awk '{print $5}' \
| sed 's/src=//' \
| sort \
| uniq -c \
| sort -nr \
@mdpuma
mdpuma / mmwatch.py
Created October 19, 2024 05:15
mmwatch
#!/usr/bin/env python
# copy https://raw.githubusercontent.com/cloudflare/cloudflare-blog/refs/heads/master/2017-06-29-ssdp/mmwatch
import sys
import time
import subprocess
import datetime
import re
@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>