Skip to content

Instantly share code, notes, and snippets.

View medeirosT's full-sized avatar

Tiago Roque Medeiros medeirosT

View GitHub Profile
@medeirosT
medeirosT / handleModem.py
Last active March 23, 2021 00:29
Reset your modem on internet outages using a USB Relay
# see this script for the relay lib : https://github.com/jaketeater/Very-Simple-USB-Relay
from relay import Relay
import os
from os import path
import time
import datetime
def check_ping():
if os.system("ping -c 1 -t 12 -i 0.2 8.8.8.8 > /dev/null") == 0:
return True
else:
@medeirosT
medeirosT / fakeapple.php
Created October 31, 2019 02:37
There's a website pretending to be apple, its emails are even passing some spam filters. Let's spam them.
<?php
/**
* Returns a string with random alphanumeric characters.
* @param {integer} length - Size of randomized string we're returning, default is 10
* @return {string} randomized string.
*/
function generate_random_string($length = 10) {
return substr(str_shuffle(str_repeat($x='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length/strlen($x)) )),1,$length);
}