Skip to content

Instantly share code, notes, and snippets.

@3clypse
3clypse / wan-monitor.sh
Last active May 30, 2020 01:24
Asuswrt WAN monitor
#!/bin/sh
# [Asuswrt WAN monitor]
#
# The script is quite simple:
# - If we have internet connection (succeeded ping), sleep 1 second and set the fail counter to zero.
# - Else: If is bigger than the limit set => write in the system log*, reset the WAN and sleep 30 seconds.
#
# * Visible on <<YOUR_ASUS_ROUTER_IP>>/Main_LogStatus_Content.asp
@3clypse
3clypse / haveibeenpwned.py
Last active February 8, 2023 10:21
Have I Been Pwned email breach checker using their API
#!/usr/bin/env python3
# Usage: python3 haveibeenpwned.py my-email-list.txt
import requests
import sys
import time
emails = sys.argv[1]
@3clypse
3clypse / 7zip_benchmark.md
Last active February 18, 2021 19:55
7zip benchmark with/without compression

Setup

Generate the files

dd if=/dev/zero of=1GB count=1024 bs=1048576 
dd if=/dev/zero of=2GB count=2048 bs=1048576

Benchmark

@3clypse
3clypse / HH:MM:SS_to_minutes.sh
Last active June 1, 2017 14:42
HH:MM:SS to minutes
echo "01:02:03" | awk -F: '{ print ($1 * 60) + $2 + ($3 / 60)}'
@3clypse
3clypse / m3u_gen.sh
Last active December 11, 2016 18:30
m3u number generator
A=999
for (( i=1; i<=$A; i++ )); do
echo "#EXTINF:-1,Movistar. Canal "$i
echo "http://IP_ROUTE/"$i".ts"
done