These are commands I use on a regular basis. For the sake of simplicity, the filenames I use in the examples below are in.mp4
and out.mp4
, though you can use your imagination to picture blah.mov
or audio.wav
on a case-by-case basis.
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 | |
RESULT=$(/sbin/ping -s 1 -i 0.2 -c 20 8.8.8.8 | grep "packet loss" | /usr/bin/awk -F ',' '{print $3}' | awk '{print $1}' | /usr/bin/sed 's/%//') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name Outgoing-Ping-Loss --value ${RESULT} --region us-west-2 | |
RESULT=$(/sbin/ping -s 1 -i 0.2 -c 20 10.10.0.1 | grep "packet loss" | /usr/bin/awk -F ',' '{print $3}' | awk '{print $1}' | /usr/bin/sed 's/%//') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name Internal-Ping-Loss --value ${RESULT} --region us-west-2 |
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 | |
SPEEDTEST=$(/opt/homebrew/bin/speedtest -I en0 -f json) | |
RESULT=$(echo $SPEEDTEST | /opt/homebrew/bin/jq '.download.bandwidth') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name SpeedTest-Download --value ${RESULT} --region us-west-2 | |
RESULT=$(echo $SPEEDTEST | /opt/homebrew/bin/jq '.upload.bandwidth') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name SpeedTest-Upload --value ${RESULT} --region us-west-2 | |
RESULT=$(echo $SPEEDTEST | /opt/homebrew/bin/jq '.ping.latency') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name SpeedTest-Ping --value ${RESULT} --region us-west-2 | |
RESULT=$(echo $SPEEDTEST | /opt/homebrew/bin/jq '.packetLoss') |
Replace SOURCE_IP
with an actual CIDR range (0.0.0.0/0
for all)
sudo iptables -I INPUT -s SOURCE_IP -j LOG --log-prefix "SOME_LABEL_HERE-INPUT: "
sudo iptables -I FORWARD -s SOURCE_IP -j LOG --log-prefix "SOME_LABEL_HERE-FORWARD: "
sudo iptables -I OUTPUT -d SOURCE_IP -j LOG --log-prefix "SOME_LABEL_HERE-OUTPUT: "