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 | |
date=$(date '+%Y-%m-%dT%H:%M:%S%z') | |
data=$(ping -nfqc1000 '2606:4700:4700::1111') | |
IFS=' ' read min avg max mdev <<<"$(printf '%s' "$data" | grep rtt | sed 's|.* = \([0-9.]*\)/\([0-9.]*\)/\([0-9.]*\)/\([0-9.]*\) ms.*|\1 \2 \3 \4|')" | |
loss=$(printf '%s' "$data" | grep 'packet loss' | sed 's/.*, \([0-9.]*\)\% packet loss.*/\1/') | |
printf '{"date":"%s","min":%s,"avg":%s,"max":%s,"mdev":%s,"ploss":%s}\n' "$date" "${min:-null}" "${avg:-null}" "${max:-null}" "${mdev:-null}" "${loss:-null}" |
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
#!/usr/bin/env bash | |
# Create a randomly generated password | |
echo "\ | |
1. alpha | |
2. alpha + digit | |
3. alpha + digit + special | |
4. alpha + digit + space | |
5. alpha + digit + special + space | |
6. alpha + digit + limited |
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
#!/usr/bin/env python3 | |
import argparse | |
import sys | |
def digest(infile): | |
for line in infile.readlines(): | |
mock(line) |
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
gameInFocus() { | |
; Add games that you will stream | |
return WinActive("Rocket League") or WinActive("Rainbow 6") | |
} | |
; Specify streaming window order if game is active | |
layer = 0 | |
while (True) { | |
if (gameInFocus()) { | |
if (layer == 0) { |
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 | |
# Takes a company name, prints registerd IP blocks for them | |
if [ "$1" = "-4" ]; then | |
ipv4_only="true" | |
shift | |
elif [ "$1" = "-6" ]; then | |
ipv6_only="true" | |
shift | |
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
#!/bin/sh | |
# Poor man's watch | |
if [ "$1" = "-n" ]; then | |
TIME=$2 | |
shift 2 | |
else | |
TIME=2 | |
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
#!/usr/bin/env python | |
from mutagen.id3 import ID3, TPE2 | |
from mutagen.mp4 import MP4 | |
import os | |
import sys | |
def remove_tag(mp4, tag): | |
try: | |
mp4.__delitem__(tag) |
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
template<typename Item> | |
class Array { | |
private: | |
unsigned int first_, last_, capacity_, size_; | |
Item* myArray; | |
public: | |
/*! | |
* Array constructor method. | |
* @param size The maximum capacity of the Array. |