Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""
Test the TCP RTT to each AWS region by connecting to the HTTP port for the EC2 API endpoint
for EC2 in each region.
"""
from __future__ import print_function
import sys
import json
@yarreg
yarreg / fetch_driver
Created January 26, 2020 19:36
Installation MERCUSYS MW150US USB 2.0
#!/bin/bash
#set -e
# install-wifi - 22/01/2020 - by MrEngman.
UPDATE_SELF=${UPDATE_SELF:-1}
UPDATE_URI="http://downloads.fars-robotics.net/wifi-drivers/install-wifi"
ROOT_PATH=${ROOT_PATH:-"/"}
WORK_PATH=${WORK_PATH:-"${ROOT_PATH}/root"}
@yarreg
yarreg / install.sh
Last active December 29, 2018 11:45
#!/bin/sh
if [ -z "$URL" ]; then
echo "Please provide script URL"
exit 1
fi
cd /tmp
wget --no-check-certificate -O script.sh $URL
chmod +x script.sh
@yarreg
yarreg / json.sh
Created February 21, 2018 18:35
Get/Set JSON key value
#!/bin/sh
set_json_val() {
sed -e 's!^\(\s*"'"$2"'"\s*:\s*"\?\)[^,"]*!\1'"$3"'!' -i $1
}
get_json_val() {
sed -e 's!\([^\\]\)"!\1!g' -e 's!,$!!' $1 | \
sed -n "s!.*${2}: *\(.*\)!\1!p"
}
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font: 24px Helvetica;
background: #999999;
}
0x0DA99524e02ED0B837f1Fc4Aedb442A396A400b5