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 / megabackup.sh
Last active October 29, 2022 21:09
Server backup to MEGA free space
#!/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
@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
@michelep
michelep / Wazuh Agent deployment
Last active September 29, 2021 12:09
Add agents for Wazuh su Debian
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
...
# ===================== 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;
Da console:
config waf profile
edit {Profile Name}
config signature
set disabled-signature {Event ID} {Event ID}
end
end
@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": [
{