Skip to content

Instantly share code, notes, and snippets.

View Rycieos's full-sized avatar

Mark Vander Stel Rycieos

View GitHub Profile
@Rycieos
Rycieos / pings.sh
Last active December 18, 2020 15:36
Ping flood a remote destination and log the results
#!/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}"
@Rycieos
Rycieos / password.sh
Created December 18, 2020 15:32
password
#!/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
#!/usr/bin/env python3
import argparse
import sys
def digest(infile):
for line in infile.readlines():
mock(line)
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) {
#!/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
@Rycieos
Rycieos / watch
Created September 29, 2017 18:21
#!/bin/sh
# Poor man's watch
if [ "$1" = "-n" ]; then
TIME=$2
shift 2
else
TIME=2
fi
#!/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)
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.