Skip to content

Instantly share code, notes, and snippets.

View eagle26's full-sized avatar
💪
Giving the extra mile!!

Jose Rivera eagle26

💪
Giving the extra mile!!
View GitHub Profile
@eagle26
eagle26 / fail2ban-clean-db
Last active June 19, 2019 22:05 — forked from mitchellkrogza/fail2ban-reset-log-db.sh
Bash script to reset Fail2Ban - clears / truncates log file and deletes the sqlite database - stops and restarts service during this process.
#!/bin/bash
# Bash Script by https://gist.github.com/mitchellkrogza
# ************************************************************
# This script clears the log file and database of Fail2Ban
# This resets Fail2Ban to a completely clean state
# Useful to use after you have finished testing all your jails
# and completed your initial setup of Fail2Ban and are now
# putting the server into LIVE mode
# ************************************************************
@eagle26
eagle26 / entropy.js
Last active February 7, 2019 17:01 — forked from jabney/entropy.js
Javascript implementation of a Shannon entropy calculation in bits per symbol
// entropy.js MIT License © 2014 James Abney http://github.com/jabney
// Calculate the Shannon entropy of a string in bits per symbol.
(function(shannon) {
'use strict';
// Create a dictionary of character frequencies and iterate over it.
function process(s, evaluator) {
var h = Object.create(null), k;
s.split('').forEach(function(c) {