Skip to content

Instantly share code, notes, and snippets.

View michelep's full-sized avatar
🎯
Focusing

Michele "O-Zone" michelep

🎯
Focusing
View GitHub Profile
### Keybase proof
I hereby claim:
* I am michelep on github.
* I am michelepin (https://keybase.io/michelepin) on keybase.
* I have a public key ASBJQbAto-H_jCkG8m9oKZbo1JPJvebu6BhbLrPrYaq81Ao
To claim this, I am signing this object:
@michelep
michelep / gist:2ba519269901da15763bfcacf66568a7
Created March 26, 2019 10:59
Add favicon.ico icon to LiquidFeedback
In liquid_feedback_frontend directory, edit file app/main/_layout/default.html and add a line like at line 7:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="icon" type="image/png" href="__BASEURL__/static/favicon.ico">
<title><!-- WEBMCP SLOTNODIV html_title --></title>
<link rel="stylesheet" type="text/css" media="screen" href="__BASEURL__/static/gregor.js/gregor.css" />
<link rel="stylesheet" type="text/css" href="<!-- WEBMCP SLOTNODIV stylesheet_url -->" />
@michelep
michelep / gist:ee73e3ee028d7fe8e9ed023718d6cefa
Created June 17, 2019 09:32
Replica pacchetti tra server
Elenco pacchetti installati:
# dpkg --get-selections > elenco.txt
ripulisci l'elenco:
# awk '{print $1}' elenco.txt > elenco.lst
script bash per installare i pacchetti:
#!/bin/bash
@michelep
michelep / gist:9ab02bf5e11d2a4ee96ad33c903984aa
Created February 3, 2020 12:14
Encrypt and decypt file using symmetric enctyption with OpenSSL
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
...
# ===================== 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;
@michelep
michelep / gist:893627c8c003cfc695ccbef8685eb3d0
Created November 16, 2020 13:58
Wazuh 4.x - Clean unassigned sharks in ElasticSearch
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
@michelep
michelep / WAZUH - Hot-Cold-Delete Policy
Created December 15, 2020 10:18
WAZUH - Hot-Cold-Delete Policy
{
"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": [
{
@michelep
michelep / fortinet_wifi_password
Created December 17, 2020 08:25
FortiNET WiFI password generator and changer
#!/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
#
Da console:
config waf profile
edit {Profile Name}
config signature
set disabled-signature {Event ID} {Event ID}
end
end
@michelep
michelep / gist:8fa4e6f629022d2874019c3de13b281a
Created January 29, 2021 12:24
Get all IP and MACs addresses from a Cisco router via SNMP and save into a MySQL table
<?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` (