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 | |
# | |
###################################################### | |
# Fortigate WiFi client monitor | |
# v0.0.1 - Michele "O-Zone" Pinassi | |
# | |
# This script, tested with Fortigate API 6.4.x, check if an user | |
# is connected on wifi network with more than CLIENT_TRIGGER clients. | |
# At the end, send a mail with username and device MACs connected | |
# |
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 | |
# | |
# This daily cron script needed for maintain clean RT database: remove old rejected and deleted tickets, remove old resolved tickets | |
# | |
DATE=`date --i` | |
# Delete rejected and deleted old tickets | |
/opt/rt4/sbin/rt-shredder --sqldump /var/rt4/backup/RT_old_${DATE}.sql --plugin 'Tickets=query,(Status="deleted" OR Status="rejected") AND LastUpdated > "730 days ago";limit,100' --force 2>&1 |
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
In header.php theme file, add this between <head> and </head> tags: | |
<?php | |
if ( is_single() && 'post' == get_post_type() ) { | |
if(has_post_thumbnail($post->ID)) { | |
$img_src = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); | |
} | |
if($excerpt = get_the_excerpt()) { | |
$excerpt = strip_tags($excerpt); | |
$excerpt = str_replace("", "'", $excerpt); |
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
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
#!/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
... | |
# ===================== 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
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 |