comez.dev
es

Fragmentos de código

Fragmentos breves y reutilizables de código y configuración. Revísalos antes de ejecutarlos en producción.

DEVEL_MODE="0"
INSTALL_PATH="/etc/apf"
IFACE_UNTRUSTED="eth0"
IFACE_TRUSTED=""
USE_IPV6="1"
SET_VERBOSE="1"
SET_FASTLOAD="1"
SET_VNET="0"
SET_ADDIFACE="0"
SET_MONOKERN="0"
DOCKER_COMPAT="auto"
SET_EXPIRE="600"
PERMBLOCK_COUNT="5"
PERMBLOCK_INTERVAL="86400"
Código completo (140 líneas) →
DEVEL_MODE="0" INSTALL_PATH="/etc/apf" IFACE_UNTRUSTED="eth0" IFACE_TRUSTED="" USE_IPV6="1" SET_VERBOSE="1" SET_FASTLOAD="1" SET_VNET="0" SET_ADDIFACE="0" SET_MONOKERN="0" DOCKER_COMPAT="auto" SET_EXPIRE="600" PERMBLOCK_COUNT="5" PERMBLOCK_INTERVAL="86400" SET_REFRESH="10" SET_REFRESH_MD5="1" FQDN_TIMEOUT="10" SET_TRIM="500" VF_ROUTE="1" VF_LGATE="" RAB="1" RAB_SANITY="1" RAB_PSCAN_LEVEL="2" RAB_HITCOUNT="1" RAB_TIMER="600" RAB_TRIP="1" RAB_LOG_HIT="1" RAB_LOG_TRIP="0" TCP_STOP="DROP" UDP_STOP="DROP" ALL_STOP="DROP" PKT_SANITY="1" PKT_SANITY_INV="0" PKT_SANITY_FUDP="1" PKT_SANITY_PZERO="1" TOS_DEF="0" TOS_DEF_RANGE="512:65535" TOS_0="" TOS_2="" TOS_4="" TOS_8="21,20,80,443" TOS_16="22,25,110,143" TCR_PASS="1" TCR_PORTS="33434:33534" ICMP_LIM="30/s" IG_TCP_CLIMIT="80:60,443:120,8443:15" IG_UDP_CLIMIT="" SYNFLOOD="1" SYNFLOOD_RATE="100/s" SYNFLOOD_BURST="150" RESV_DNS="1" RESV_DNS_DROP="1" BLK_P2P_PORTS="1214,2323,4660_4678,6257,6699,6346,6347,6881_6889,7778" BLK_PORTS="135_139,111,513,520,445,1433,1434,1234,1524,3127" BLK_MCATNET="1" BLK_PRVNET="0" BLK_RESNET="1" BLK_TCP_SACK_PANIC="0" BLK_IDENT="1" SYSCTL_CONNTRACK="262144" SYSCTL_CONNTRACK_ADAPTIVE="1" SYSCTL_CONNTRACK_INCREMENT="65536" SYSCTL_CONNTRACK_HIGH="1048576" SYSCTL_CONNTRACK_BUCKETS="32768" SYSCTL_TCP="1" SYSCTL_TCP_NOSACK="0" SYSCTL_SYN="1" SYSCTL_ROUTE="1" SYSCTL_LOGMARTIANS="1" SYSCTL_ECN="0" SYSCTL_SYNCOOKIES="1" SYSCTL_OVERFLOW="0" HELPER_SSH="1" HELPER_SSH_PORT="22" HELPER_FTP="0" HELPER_FTP_PORT="21" HELPER_FTP_DATA="20" IG_TCP_CPORTS="22,80,443,8443" IG_UDP_CPORTS="" IG_ICMP_TYPES="3,5,11,0,30,8" IG_ICMPV6_TYPES="1,2,3,4,128,129" EGF="0" EG_TCP_CPORTS="21,25,80,443,43" EG_UDP_CPORTS="20,21,53" EG_ICMP_TYPES="all" EG_ICMPV6_TYPES="all" EG_TCP_UID="" EG_UDP_UID="" EG_DROP_CMD="eggdrop,psybnc,bitchx,BitchX,init,udp.pl" SMTP_BLOCK="0" SMTP_PORTS="25,465,587" SMTP_ALLOWUSER="" SMTP_ALLOWGROUP="" DLIST_PHP="1" DLIST_PHP_URL="https://cdn.rfxn.com/downloads/php_list" DLIST_SPAMHAUS="1" DLIST_SPAMHAUS_URL="https://www.spamhaus.org/drop/drop.lasso" DLIST_DSHIELD="1" DLIST_DSHIELD_URL="https://feeds.dshield.org/top10-2.txt" DLIST_RESERVED="1" DLIST_RESERVED_URL="https://cdn.rfxn.com/downloads/reserved.networks" DLIST_ECNSHAME="0" DLIST_ECNSHAME_URL="https://cdn.rfxn.com/downloads/ecnshame.lst" USE_RGT="0" GA_URL="https://yourhost.com/glob_allow.rules" GD_URL="https://yourhost.com/glob_deny.rules" USE_IPSET="auto" IPSET_LOG_RATE="30" IPSET_REFRESH="21600" CC_LOG="1" CC_LOG_ONLY="0" CC_SRC="auto" CC_
Código completo (1 líneas) →
email_alert="1"
email_addr="[email protected]"
email_ignore_clean="1"
email_subj="maldet alert from $(hostname)"
email_panel_user_alerts="0"
email_panel_from="[email protected]"
email_panel_replyto="[email protected]"
email_panel_alert_subj="maldet alert from $(hostname)"
email_format="html"
smtp_relay=""
smtp_from=""
smtp_user=""
smtp_pass=""
slack_alert="0"
Código completo (99 líneas) →
email_alert="1" email_addr="[email protected]" email_ignore_clean="1" email_subj="maldet alert from $(hostname)" email_panel_user_alerts="0" email_panel_from="[email protected]" email_panel_replyto="[email protected]" email_panel_alert_subj="maldet alert from $(hostname)" email_format="html" smtp_relay="" smtp_from="" smtp_user="" smtp_pass="" slack_alert="0" slack_subj="maldet alert from $(hostname)" slack_token="AUTH_TOKEN" slack_channels="maldetreports" telegram_alert="0" telegram_bot_token="TELEGRAM_BOT_TOKEN" telegram_channel_id="TELEGRAM_CHANNEL_ID" discord_alert="0" discord_webhook_url="" autoupdate_signatures="1" sigup_interval="6" autoupdate_version="1" autoupdate_version_hashed="1" cron_prune_days="21" cron_daily_scan="1" scan_days="1" import_config_url="" import_config_expire="43200" sig_import_md5_url="" sig_import_hex_url="" sig_import_yara_url="" sig_import_sha256_url="" sig_import_csig_url="" scan_hashtype="auto" scan_workers="auto" scan_clamscan="1" scan_yara="auto" scan_yara_timeout="300" scan_yara_scope="custom" scan_csig="1" scan_user_access="0" scan_user_access_minuid="1000" scan_max_depth="15" scan_min_filesize="24" scan_max_filesize="2048k" scan_hexdepth="262144" scan_hex_chunk_size="10240" scan_cpunice="19" scan_ionice="6" scan_cpulimit="0" scan_ignore_root="1" scan_ignore_user="" scan_ignore_group="" scan_find_timeout="0" scan_export_filelist="0" scan_tmpdir_paths="/tmp /var/tmp /dev/shm /var/fcgi_ipc" quarantine_hits="1" quarantine_clean="1" quarantine_suspend_user="0" quarantine_suspend_user_minuid="1000" quarantine_on_error="1" default_monitor_mode="users" inotify_base_watches="16384" inotify_sleep="15" inotify_reloadtime="3600" inotify_minuid="1000" inotify_docroot="htdocs" inotify_cpunice="18" inotify_ionice="6" inotify_cpulimit="0" digest_interval="24h" digest_escalate_hits="0" cron_digest_hook="1" monitor_paths_extra="/usr/local/maldetect/monitor_paths.extra" monitor_scan_owner_filters="0" scan_clamd_remote="0" remote_clamd_config="/etc/clamd.d/clamd.remote.conf" remote_clamd_max_retry="5" remote_clamd_retry_sleep="3" enable_statistic="0" elk_host="" elk_port="" elk_index="" session_legacy_compat="auto" string_length_scan="0" string_length="150000" scan_progress_log_interval="60" scan_meta_cleanup_age="48" maint_compress_age="30" maint_archive_age="90" post_scan_hook="" post_scan_hook_format="args" post_scan_hook_exec="async" post_scan_hook_timeout="60" post_scan_hook_on="all" post_scan_hook_min_hits="1"
Abrir página del código →
#!/bin/bash
# ==================================================================================
# 🐕 WATCHDOG v4.0 - Intelligent Service Monitor & Auto-Recovery System
# ==================================================================================
# Universal Linux service monitoring with smart socket-activation support
# 
# Features:
# ✅ Socket-activated service support (snapd, packagekit, etc.)
# ✅ Multi-tier service classification
# ✅ Advanced notification system (Email, Webhook, Telegram)
# ✅ Auto-update from GitHub
# ✅ System health monitoring
# ✅ Intelligent restart policies
# ✅ Multi-language support
Código completo (1866 líneas) →
disable_functions = "exec, passthru, shell_exec, system, proc_open, popen, curl_exec, curl_multi_exec, parse_ini_file, show_source, phpinfo, mail, ini_set, ini_alter, openlog, syslog, readfile, symlink, dl, leak, proc_get_status, proc_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellarg, escapeshellcmd, base64_decode"
Abrir página del código →
disable_functions = "exec, passthru, shell_exec, system, proc_open, popen, curl_exec, curl_multi_exec, parse_ini_file, show_source, phpinfo, mail, ini_set, ini_alter, openlog, syslog, readfile, symlink, dl, leak, proc_get_status, proc_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellarg, escapeshellcmd, base64_decode"
Abrir página del código →
#Ali Çömez Wp Yazı gösterim kodu
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return "0 Gösterim";
}
return $count.' Gösterim';
}
function setPostViews($postID) {
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
Código completo (24 líneas) →