Skip to content

Instantly share code, notes, and snippets.

View jacanales's full-sized avatar
💻

Jesús Antonio Canales Diez jacanales

💻
View GitHub Profile
@jacanales
jacanales / sync-fail2ban.sh
Created January 11, 2024 15:11 — forked from klepsydra/sync-fail2ban.sh
Block globally reported hack attempts using your local iptables firewall rules
#!/bin/bash
## Update fail2ban iptables with globally known attackers.
## Actually, runs 100% independently now, without needing fail2ban installed.
##
## /etc/cron.daily/sync-fail2ban
##
## Author: Marcos Kobylecki <fail2ban.globalBlackList@askmarcos.com>
## http://www.reddit.com/r/linux/comments/2nvzur/shared_blacklists_from_fail2ban/
@jacanales
jacanales / ecr-docker-registry-login
Created February 18, 2020 08:54
ECR Login supporting aws-cli < 2.0 and >= 2.0
#!/usr/bin/env bash
aws ecr get-login --no-include-email > /dev/null 2>&1 || (aws ecr get-login-password | docker login --username AWS --password-stdin 846431675915.dkr.ecr.eu-west-1.amazonaws.com > /dev/null 2>&1)
@jacanales
jacanales / main.go
Created February 13, 2020 22:34 — forked from chadlung/main.go
An example Go (golang) REST service that uses JWT (JSON Web Tokens) and Negroni http://www.giantflyingsaucer.com/blog/?p=5994
package main
// Generate RSA signing files via shell (adjust as needed):
//
// $ openssl genrsa -out app.rsa 1024
// $ openssl rsa -in app.rsa -pubout > app.rsa.pub
//
// Code borrowed and modified from the following sources:
// https://www.youtube.com/watch?v=dgJFeqeXVKw
// https://goo.gl/ofVjK4