Skip to content

Instantly share code, notes, and snippets.

View lichti's full-sized avatar
👨‍💻
🏊🏻🚴🏻🏃🏻

Gustavo Lichti lichti

👨‍💻
🏊🏻🚴🏻🏃🏻
View GitHub Profile
@lichti
lichti / scan_hosts.sh
Last active January 4, 2024 22:46
Automate nmap scanning for multiple domains with threads
#!/bin/bash
# Author: Gustavo Lichti
# Email: gustavo.lichti@gmail.com
# Usage: ./scan_hosts.sh --hosts <hosts_file> --host xpto.xxx --host xpto2.xxx --threads <number_of_threads> --output <output_directory>
SCRIPT_STARTED=$(date +"%Y%m%d_%H%M")
# Function do add log Line
@lichti
lichti / LogAlert.mikrotik.script
Last active October 7, 2023 14:49
LogAlert.mikrotik.script
:global lastTimeLogingFailure;
:local varEmail "my@email.com";
:local varEmailSubj "failure login";
:local Hostname [/system identity get name];
:local filter "login failure";
:local varDate [/system clock get date];
:local varMonth [:pick $varDate 0 3];
:local varDay [:pick $varDate 4 6];
@lichti
lichti / letsencrypt-proxmox.md
Last active September 12, 2022 20:14
Proxmox with letsencrypt ssl
git clone https://github.com/certbot/certbot /opt/letsencrypt
ln -s /opt/letsencrypt/certbot-auto /usr/bin/certbot
certbot certonly --expand --agree-tos --text --non-interactive \
 --standalone \
@lichti
lichti / yubikey_unlock_luks.sh
Created February 6, 2019 18:14
Using yubikey to unlock LUKS partitions
# Using yubikey to unlock LUKS partitions
# My SDB3 is a partitions with luks, with lvm and ma root fs (/)
# My SDA1 ia my data partition with luks mounted at /data
# I will use yubikey as 2FA to unlock the SDB3 and the SDA1 will be unlocked by a key file
## On SDB3
# Configure the slot two of yubikey to challenge mode
@lichti
lichti / rgvalidator.py
Created November 11, 2020 05:39
Validate Brazilian RG
###
# Explain
# RG Number -> AB.CDE.FGH-V
# X=(Hx9)+(Gx8)+(Fx7)+(Ex6)+(Dx5)+(Cx4)+(Bx3)+(Ax2)+(100xV)
# Y= X%11
# If Y (rest of division) is 0 the RG is Valid
###
# Function to validate Brazilian "RG"
def isValidRG(number,dv):
@lichti
lichti / yml2json.sh
Last active April 20, 2020 06:46
Script to convert yml to json
#!/bin/bash
BYellow='\033[1;33m'
BGreen='\033[1;32m'
Color_Off='\033[0m'
LOCALPATH=$PWD
OUTPUT=$LOCALPATH/OUTPUT
if [ ! -d $OUTPUT ]; then
@lichti
lichti / Warsaw-brwser.txt
Created June 26, 2017 13:28
warsaw-browser - Itau, CEF, BB e outros.
Imagem Docker para rodar um firefox com o warsaw configurado para acesso a bancos brasileiros.
É uma boa opção para acessar bancos através de GNU/Linux.
Have a nice day.
More Info:
https://hub.docker.com/r/lichti/warsaw-browser/
https://github.com/lichti/containers4docker/tree/master/warsaw-browser
@lichti
lichti / mysql_optimize_ng.sh
Created October 29, 2015 03:53
mysql_optimize_ng.sh
#!/bin/bash
MYSQL_LOGIN='-uroot --password=neOfByon'
while read line
do
# SIZE | DATABASE | TABLE | FLAG
SIZE=$( echo "$line" | cut -d\| -f 1)
DATABASE=$( echo "$line" | cut -d\| -f 2)
TABLE=$( echo "$line" | cut -d\| -f 3)
@lichti
lichti / dog.sh
Created January 2, 2020 15:32 — forked from flyzjhz/dog.sh
Openwrt watchdog script
#!/bin/sh
# save dog.sh in /root/dog.sh.
# You can use winscp with scp protocol to do this.
# Using ssh set executation permission and replace the crontab:
# chmod +x /root/dog.sh
# echo "* * * * * /root/dog.sh" | crontab -
# fix wpad / wpad-mini / hostapd stop working bug
logread -l 100 | grep -n "IEEE 802.11: did not acknowledge authentication response"
@lichti
lichti / new_relic_alert.sh
Last active May 7, 2019 13:48
Script to enable or disable newrelic alerts
#!/bin/bash
if [ ! -x /usr/bin/curl ]; then
echo "Please install curl"
exit 1
fi
if [ ! -x /usr/bin/jq ]; then
echo "Please install jq"
exit 1