This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} |