This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# | |
import os | |
import sys | |
from os.path import dirname, abspath | |
import re | |
import time | |
import requests | |
import urllib3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// Questa procedura preleva dai routers, via SNMP, l'elenco degli indirizzi IP e relativi MAC connessi, salvandoli su una tabella MySQL: | |
// | |
// -- | |
// -- Struttura della tabella `ipMACs` | |
// -- | |
// | |
// CREATE TABLE IF NOT EXISTS `ipMACs` ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
###################################################### | |
# | |
# WiFi network password manager | |
# | |
# Tested with FortiGATE v6.2.6 and v6.2.2 | |
# | |
# This script change password for [WIFI BSSID] and send a mail with the new password | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"policy": { | |
"policy_id": "hot_cold_workflow", | |
"description": "A simple default policy that changes the replica count between hot and cold states.", | |
"last_updated_time": 1607978734307, | |
"schema_version": 1, | |
"error_notification": null, | |
"default_state": "hot", | |
"states": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET https://localhost:9200/_cat/shards -u admin:admin -k | grep UNASSIGNED | awk {'print $1'} | xargs -i curl -XDELETE "https://localhost:9200/{}" -u admin:admin -k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Da console: | |
config waf profile | |
edit {Profile Name} | |
config signature | |
set disabled-signature {Event ID} {Event ID} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
# ===================== OPTION 66 | |
# option tftp-server-name "tftp://voip."; | |
option tftp-server-name "voip."; | |
option subnet-mask 255.255.255.0; | |
# ==================== OPTION 114 | |
# Gigaset URL for provisioning | |
option dhcp_114_FW_URL code 114 = text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Su HOST: | |
apt-get install curl apt-transport-https lsb-release gnupg2 | |
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | apt-key add - | |
echo "deb https://packages.wazuh.com/4.x/apt/ stable main" | tee /etc/apt/sources.list.d/wazuh.list | |
apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Encrypt a file using a supplied password: | |
$ openssl enc -aes-256-cbc -salt -in file.txt -out file.txt.enc -k PASS | |
Decrypt a file using a supplied password: | |
$ openssl enc -aes-256-cbc -d -in file.txt.enc -out file.txt -k PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# backup mysql dbs, /etc folder and all subfolders inside /var/www. Encrypt it using aes256 and upload to MEGA.nz /backup folder | |
# 1) have a mega.nz account for 50GB of space | |
# 2) install MEGAcmd (https://mega.nz/cmd) | |
# 3) change CONFIGURATION lines to fit your needs and copy to /etc/cron.daily ;-) | |
# CONFIGURATION | |
SERVER="[name of the server]" | |
DAYS_TO_BACKUP=3 |