Refreshing the scripts using the latest ones from the MacBook.
authorrtrimana <rtrimana@uci.edu>
Wed, 12 Feb 2020 21:14:07 +0000 (13:14 -0800)
committerrtrimana <rtrimana@uci.edu>
Wed, 12 Feb 2020 21:14:07 +0000 (13:14 -0800)
automation/clicker.sh
automation/clickers.sh
automation/clickers1.sh
automation/clickers2.sh
automation/madIoT.sh [deleted file]

index 4dba108c4d857e9a8b60740399a337d87457ed9d..9316f3cb5fadaddee8b67088acca9d36688d751e 100755 (executable)
@@ -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"
index 72abda6e562c6ed74dfa9cb5430479463f33d1d3..e284c0f480d3c5d1b8a484c49206e0a2e777aa81 100755 (executable)
@@ -5,14 +5,11 @@
 
 # Parameters:
 # $1 : device identification (run "adb devices" to figure out)
-#
-# Command:
-# ./clickers.sh <device-identification>
 
 # Loop variables
 BEGIN=1
-END=100
-#END=4
+#END=100
+END=4
 INC=1
 DEVICE=$1
 
index 7d64a4cefbce249bcd956966dd582a7bbfa91ee7..edb50e0e0940b1a92bed717fd0d883e3e3b3aac3 100755 (executable)
@@ -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"
index 549d4c9a8221fe1c51f968435f5a821a6eae9c00..10db779589f7c3e5ebde9b4896d5d9107f8b392b 100755 (executable)
@@ -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 (executable)
index 3ba4825..0000000
+++ /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