From 09d844208450e8158633ab8041760b3bfb91d179 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Wed, 12 Feb 2020 13:14:07 -0800 Subject: [PATCH] Refreshing the scripts using the latest ones from the MacBook. --- automation/clicker.sh | 96 +++++++++++++++++++++++------ automation/clickers.sh | 7 +-- automation/clickers1.sh | 132 +++++++++++++++++++--------------------- automation/clickers2.sh | 15 +++-- automation/madIoT.sh | 59 ------------------ 5 files changed, 150 insertions(+), 159 deletions(-) delete mode 100755 automation/madIoT.sh diff --git a/automation/clicker.sh b/automation/clicker.sh index 4dba108..9316f3c 100755 --- a/automation/clicker.sh +++ b/automation/clicker.sh @@ -6,6 +6,7 @@ # Loop variables BEGIN=1 END=100 +#END=2 INC=1 # Range of random number (in seconds) @@ -17,18 +18,25 @@ do date +"%m/%d/%Y %r" #./adb shell getevent -l - use this command to get the position + # Click on screen + #./adb shell input tap 500 1500 # TP-Link switch #./adb shell input tap 1002 913 # TP-Link bulb on/off #./adb shell input tap 994 560 # D-Link switch #./adb shell input tap 987 346 - # SmartThings + # D-Link motion sensor + #./adb shell input tap 975 840 + # SmartThings plug #./adb shell input tap 921 1188 + #./adb shell input tap 533 653 + # WeMo, WeMo Insight, LiFX bulbs, Hue bulbs with ST-app + #./adb shell input tap 533 653 # WeMo #./adb shell input tap 981 532 # WeMo Insight - #./adb shell input tap 981 326 + ./adb shell input tap 981 326 # Kwikset doorlock #if (( $i % 2 )) #then @@ -39,7 +47,17 @@ do # ./adb shell input tap 520 1211 #fi # Hue bulb - #./adb shell input tap 900 550 + #./adb shell input tap 923 383 + #./adb shell input tap 900 550 + # Hue bulb intensity + #if (( $i % 2 )) + #then + # brighter + # ./adb shell input tap 100 650 + #else + # dimmer + # ./adb shell input tap 100 750 + #fi # Lifx bulb #./adb shell input tap 506 580 # Amcrest camera @@ -57,12 +75,16 @@ do #if (( $i % 2 )) #then # live view - # ./adb shell input tap 532 740 + #./adb shell input tap 532 740 + # ./adb shell input tap 533 653 #else # stop live view - # ./adb shell input tap 101 1012 + #./adb shell input tap 101 1012 + # ./adb shell input tap 533 653 + # ./adb shell input tap 533 653 + # ./adb shell input tap 533 653 #fi - # Blossom + # Blossom - turning on/off 1 zone #if (( $i % 2 )) #then # start watering @@ -71,10 +93,12 @@ do # stop watering # ./adb shell input tap 496 1533 #fi + # Blossom - change mode active/hibernate + #./adb shell input tap 1002 1176 # Dlink siren #./adb shell input tap 994 802 # Nest thermostat - #if (( $i % 2 )) + #if (( $i % 2)) #then # start fan # ./adb shell input tap 524 1668 @@ -85,26 +109,64 @@ do # ./adb shell input tap 679 1702 #fi # Alexa - if (( $i % 2 )) - then + #if (( $i % 2)) + #then # Using Google Translate and # having her speak to Alexa # Question 1 - ./adb shell input tap 907 145 - ./adb shell input tap 543 692 - ./adb shell input tap 148 775 - else + # ./adb shell input tap 907 145 + # ./adb shell input tap 543 692 + # ./adb shell input tap 148 775 + #else # Question 2 - ./adb shell input tap 907 145 - ./adb shell input tap 463 1668 - ./adb shell input tap 148 775 - fi + # ./adb shell input tap 907 145 + # ./adb shell input tap 463 1668 + # ./adb shell input tap 148 775 + #fi #date +%r #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA] #RAND=$[`jot -r 1 $RAN_STA $RAN_END`] #echo "Delay: $RAND seconds" #sleep $[$RAND]s + + # TP-Link bulb - change colors & intensity + #if (( $i % 2 )) + #then + # color 1 - horizontal + #./adb shell input tap 250 1000 + # color 3 - vertical + #./adb shell input tap 500 1250 + # intensity change (vertical) + # ./adb shell input tap 250 1405 + #else + # color 2 - horizontal + #./adb shell input tap 750 1000 + # color 4 - vertical + #./adb shell input tap 500 750 + # intensity change (vertical) + # ./adb shell input tap 850 1405 + #fi + # Hue bulb - change intensity + #if (( $i % 2 )) + #then + # intensity change (bright) + # ./adb shell input tap 300 550 + #else + # intensity change (dimmed) + # ./adb shell input tap 800 550 + #fi + # Arlo camera - arm/disarm + #if (( $i % 2 )) + #then + # Arm + # ./adb shell input tap 500 500 + #else + # Disarm + # ./adb shell input tap 500 750 + #fi # pick a prime number > 120 seconds sleep 131s + #sleep 13s done +#ssh root@192.168.1.1 "kill -9 18572 18576" diff --git a/automation/clickers.sh b/automation/clickers.sh index 72abda6..e284c0f 100755 --- a/automation/clickers.sh +++ b/automation/clickers.sh @@ -5,14 +5,11 @@ # Parameters: # $1 : device identification (run "adb devices" to figure out) -# -# Command: -# ./clickers.sh # Loop variables BEGIN=1 -END=100 -#END=4 +#END=100 +END=4 INC=1 DEVICE=$1 diff --git a/automation/clickers1.sh b/automation/clickers1.sh index 7d64a4c..edb50e0 100755 --- a/automation/clickers1.sh +++ b/automation/clickers1.sh @@ -8,8 +8,8 @@ # Loop variables BEGIN=1 -END=100 -#END=2 +#END=100 +END=6 INC=1 DEVICE=$1 @@ -19,7 +19,28 @@ RAN_END=200 for ((i=$BEGIN; i<=$END; i+=$INC)); do - + # Button widget to IFTTT + #if (( $i % 2 )) + #then + # Left button + # ./adb -s "$DEVICE" shell input tap 100 400 + #else + # Right button + # ./adb -s "$DEVICE" shell input tap 300 400 + #fi + # Cloud speech (cloud.google.com/text-to-speech/) + #if (( $i % 2 )) + #then + # speech #1 + # ./adb -s "$DEVICE" shell input tap 900 140 + # ./adb -s "$DEVICE" shell input tap 600 1600 + # ./adb -s "$DEVICE" shell input tap 350 1000 + #else + # speech #2 + # ./adb -s "$DEVICE" shell input tap 900 140 + # ./adb -s "$DEVICE" shell input tap 600 500 + # ./adb -s "$DEVICE" shell input tap 350 1000 + #fi date +"%m/%d/%Y %r" #./adb shell getevent -l - use this command to get the position # Click on screen @@ -28,72 +49,44 @@ do #./adb -s "$DEVICE" shell input tap 1002 913 # TP-Link bulb on/off #./adb -s "$DEVICE" shell input tap 994 560 - # D-Link switch - #./adb -s "$DEVICE" shell input tap 987 346 - # D-Link motion sensor - #./adb -s "$DEVICE" shell input tap 975 840 - # SmartThings plug - #./adb -s "$DEVICE" shell input tap 921 1188 - #./adb -s "$DEVICE" shell input tap 533 653 - # WeMo, WeMo Insight, LiFX bulbs, Hue bulbs with ST-app - #./adb -s "$DEVICE" shell input tap 533 653 - # WeMo - #./adb -s "$DEVICE" shell input tap 981 532 - # WeMo Insight - #./adb -s "$DEVICE" shell input tap 981 326 - # Kwikset doorlock - #if (( $i % 2 )) - #then - # locking - # ./adb -s "$DEVICE" shell input tap 153 1211 - #else - # unlocking - # ./adb -s "$DEVICE" shell input tap 520 1211 - #fi - # Hue bulb - #./adb -s "$DEVICE" shell input tap 923 383 - # Lifx bulb - #./adb -s "$DEVICE" shell input tap 506 580 - # Amcrest camera - #if (( $i % 2 )) - #then - # live view - # ./adb -s "$DEVICE" shell input tap 92 139 - # ./adb -s "$DEVICE" shell input tap 92 139 - #else - # stop live view (go to playback) - # ./adb -s "$DEVICE" shell input tap 92 139 - # ./adb -s "$DEVICE" shell input tap 92 250 - #fi - # Arlo camera - #if (( $i % 2 )) - #then - # live view - #./adb -s "$DEVICE" shell input tap 532 740 - # ./adb -s "$DEVICE" shell input tap 533 653 - #else - # stop live view - #./adb -s "$DEVICE" shell input tap 101 1012 - # ./adb -s "$DEVICE" shell input tap 533 653 - # ./adb -s "$DEVICE" shell input tap 533 653 - # ./adb -s "$DEVICE" shell input tap 533 653 - #fi - # Blossom - turning on/off 1 zone + # TP-Link 2-outlet plug (outlet 1) + #./adb -s "$DEVICE" shell input tap 1000 550 + # TP-Link plug/power strip/light bulb ON/OFF (center) + #./adb -s "$DEVICE" shell input tap 550 900 + # TP-Link camera live/stop + #./adb -s "$DEVICE" shell input tap 1000 1700 + # TP-Link camera start/stop recording (after going live) + #./adb -s "$DEVICE" shell input tap 950 950 + # Wemo Insight + ./adb -s "$DEVICE" shell input tap 1000 300 + # Blink camera (watch) #if (( $i % 2 )) - #then - # start watering - # ./adb -s "$DEVICE" shell input tap 538 1597 - #else - # stop watering - # ./adb -s "$DEVICE" shell input tap 496 1533 - #fi - # Blossom - change mode active/hibernate - #./adb -s "$DEVICE" shell input tap 1002 1176 - # Dlink siren - #./adb -s "$DEVICE" shell input tap 994 802 + #then + # Watch + # ./adb -s "$DEVICE" shell input tap 150 850 + #else + # Close + # ./adb -s "$DEVICE" shell input tap 100 150 + #fi + # Blink camera (photo) + #./adb -s "$DEVICE" shell input tap 1050 850 + # Insteon Hub (plug ON/OFF) + #if (( $i % 2 )) + #then + # ON + # ./adb -s "$DEVICE" shell input tap 210 315 + # ./adb -s "$DEVICE" shell input tap 500 900 + #else + # OFF + # ./adb -s "$DEVICE" shell input tap 210 315 + # ./adb -s "$DEVICE" shell input tap 500 1200 + #fi + # Lightify + #./adb -s "$DEVICE" shell input tap 550 1050 # Nest thermostat - #if (( $i % 2)) - #then + #if (( $i % 2)) + #then + # start fan # ./adb -s "$DEVICE" shell input tap 524 1668 # ./adb -s "$DEVICE" shell input tap 936 1709 @@ -190,7 +183,7 @@ do #fi # Rachio sprinkler - ON/OFF #if (( $i % 2 )) - #then + #then # ON # ./adb -s "$DEVICE" shell input tap 900 1500 # ./adb -s "$DEVICE" shell input tap 300 600 @@ -211,7 +204,7 @@ do # ./adb -s "$DEVICE" shell input tap 600 700 #fi # Ring doorbell - ring alerts - ./adb -s "$DEVICE" shell input tap 1000 570 + #./adb -s "$DEVICE" shell input tap 1000 570 # Ring doorbell - motion alerts #./adb -s "$DEVICE" shell input tap 1000 750 # Ecobee thermostat - ON/OFF @@ -267,4 +260,3 @@ do sleep 131s #sleep 13s done -#ssh root@192.168.1.1 "kill -9 19327 19332" diff --git a/automation/clickers2.sh b/automation/clickers2.sh index 549d4c9..10db779 100755 --- a/automation/clickers2.sh +++ b/automation/clickers2.sh @@ -33,7 +33,7 @@ do #./adb -s "$DEVICE" shell input tap 921 1188 #./adb -s "$DEVICE" shell input tap 533 653 # WeMo, WeMo Insight, LiFX bulbs, Hue bulbs with ST-app - #./adb -s "$DEVICE" shell input tap 533 653 + ./adb -s "$DEVICE" shell input tap 533 653 # WeMo #./adb -s "$DEVICE" shell input tap 981 532 # WeMo Insight @@ -121,22 +121,22 @@ do #sleep $[$RAND]s # TP-Link bulb - change colors & intensity - if (( $i % 2 )) - then + #if (( $i % 2 )) + #then # color 1 - horizontal #./adb -s "$DEVICE" shell input tap 250 1000 # color 3 - vertical #./adb -s "$DEVICE" shell input tap 500 1250 # intensity change - ./adb -s "$DEVICE" shell input tap 150 1405 - else + # ./adb -s "$DEVICE" shell input tap 150 1405 + #else # color 2 - horizontal #./adb -s "$DEVICE" shell input tap 750 1000 # color 4 - vertical #./adb -s "$DEVICE" shell input tap 500 750 # intensity change - ./adb -s "$DEVICE" shell input tap 950 1405 - fi + # ./adb -s "$DEVICE" shell input tap 950 1405 + #fi # Hue bulb - change intensity #if (( $i % 2 )) #then @@ -264,4 +264,3 @@ do sleep 131s #sleep 53s done -#ssh root@192.168.1.1 "kill -9 21280 21287" diff --git a/automation/madIoT.sh b/automation/madIoT.sh deleted file mode 100755 index 3ba4825..0000000 --- a/automation/madIoT.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -# Drop packets with lengths 1299, 1300, and 640 -#iptables -I INPUT -s 192.168.1.108 -p tcp -j DROP -#iptables -I INPUT -d 192.168.1.108 -p tcp -j DROP -#iptables -I OUTPUT -s 192.168.1.108 -p tcp -j DROP -#iptables -I OUTPUT -d 192.168.1.108 -p tcp -j DROP -#iptables -I FORWARD -s 192.168.1.108 -p tcp -j DROP -#iptables -I FORWARD -d 192.168.1.108 -p tcp -j DROP - -# Ecobee -# HVAC -#iptables -I FORWARD -s 192.168.1.108 -d 216.220.61.235 -p tcp -m length --length 1280:1290 -j DROP -#iptables -I FORWARD -s 192.168.1.108 -p tcp -m length --length 1280:1290 -j DROP -# Fan -#iptables -I FORWARD -s 192.168.1.108 -d 216.220.61.235 -p tcp -m length --length 1370:1380 -j DROP -#iptables -I FORWARD -s 192.168.1.108 -p tcp -m length --length 1370:1380 -j DROP - -# Nest -# Fan -#iptables -I FORWARD -s 192.168.1.108 -p tcp -m length --length 875:885 -j DROP -#iptables -I FORWARD -s 192.168.1.108 -p tcp -m length --length 840:860 -j DROP - -# Amazon plug - -# WeMo plug -#iptables -I FORWARD -s 192.168.1.108 -p tcp -m length --length 240:250 -j DROP -#iptables -I FORWARD -d 192.168.1.59 -p tcp -m length --length 240:250 -j DROP -# WeMo Insight plug -#iptables -I FORWARD -d 192.168.1.10 -p tcp -m length --length 240:250 -j DROP - -# TP-Link plug -#iptables -I FORWARD -s 192.168.1.74 -p tcp -m length --length 570:590 -j DROP -# We need to block the entire traffic to the plug to make this work -#iptables -I FORWARD -d 192.168.1.74 -p tcp -j DROP - -# D-Link plug -# Phone signature -#iptables -I FORWARD -s 192.168.1.108 -p tcp -m length --length 1080:1120 -j DROP -# Device signature -iptables -I FORWARD -d 192.168.1.58 -p tcp -m length --length 70:100 -j DROP - -# SmartThings plug -#iptables -I FORWARD -s 192.168.1.108 -p tcp -m length --length 680:700 -j DROP - -#iptables -I FORWARD -s 192.168.1.108 -d 216.220.61.235 -p tcp -m length --length 1300 -j DROP -#iptables -I FORWARD -d 192.168.1.108 -s 216.220.61.235 -p tcp -m length --length 640 -j DROP -#iptables -I FORWARD -s 216.220.61.235 -d 192.168.1.108 -p tcp -m length --length 620:630 -j DROP -#iptables -I INPUT -s 192.168.1.108 -d 216.220.61.235 -p tcp -m length --length 1299 -j DROP -#iptables -I INPUT -s 192.168.1.108 -d 216.220.61.235 -p tcp -m length --length 1300 -j DROP -#iptables -I INPUT -d 192.168.1.108 -s 216.220.61.235 -p tcp -m length --length 640 -j DROP -#iptables -I OUTPUT -s 192.168.1.108 -d 216.220.61.235 -p tcp -m length --length 1299 -j DROP -#iptables -I OUTPUT -s 192.168.1.108 -d 216.220.61.235 -p tcp -m length --length 1300 -j DROP -#iptables -I OUTPUT -d 192.168.1.108 -s 216.220.61.235 -p tcp -m length --length 640 -j DROP - -#iptables -I FORWARD -s 192.168.1.108 -d 216.220.61.235 -p tcp -j DROP -#iptables -I FORWARD -s 216.220.61.235 -d 192.168.1.108 -p tcp -j DROP -#iptables -I FORWARD -s 192.168.1.108 -p tcp -j DROP -#iptables -I FORWARD -d 192.168.1.108 -p tcp -j DROP -- 2.34.1