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
function valid_ip() | |
{ | |
local ip=$1 | |
local stat=1 | |
regexv6='^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$' | |
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | |
OIFS=$IFS | |
IFS='.' | |
ip=($ip) |
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
#!/bin/bash | |
# Extract SRT subtitles from each MKV file in the given directory | |
# call script.sh <path> <language-searchtag> | |
# If no directory is given, work in local dir | |
if [ "$1" = "" ]; then | |
DIR="." | |
else | |
DIR="$1" | |
fi |
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
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script> | |
<script> | |
function normalize(tagname){ | |
var newTable = $(tagname).clone(true); | |
$(tagname).empty(); |
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
def random_in_intervals(allowed_intervals: Iterable): | |
""" generate a radnom int from a selection of several intervals. | |
intervals have to be in the format a, b where b > a""" | |
sum_of_ranges = sum(b-a for a, b in allowed_intervals) | |
random_float = random.random() | |
relative_number = random_float*sum_of_ranges | |
# now we have to get the actual value from the interval |