This file contains hidden or 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
import asyncio | |
from wyzeapy import Wyzeapy | |
from wyzeapy.services.camera_service import Camera, CameraService | |
async def async_main(): | |
#Turns on motion detection | |
client = await login() | |
camera_service = await client.camera_service | |
cameras = await camera_service.get_cameras() | |
for camera in cameras: |
This file contains hidden or 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/sh | |
# Define the name of the script to watch | |
SCRIPT_NAME="script.sh" | |
# Function to get current date and time | |
get_timestamp() { | |
date +"%Y-%m-%d %T" | |
} |
This file contains hidden or 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
# Place each MAC address on a separate line like below: | |
# 11:22:33:44:55:66 | |
# AA:BB:CC:DD:EE:FF |
This file contains hidden or 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/sh | |
PREVIOUS_STATE="home" | |
X=0 | |
while true; do | |
# Read MAC addresses from file into a variable | |
MAC_ADDRESSES=$(cat /path/to/mac_addresses.txt) | |
ANYONE_HOME=0 |
This file contains hidden or 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
#this script will run a simple fizzbuzz application in powershell | |
$num = Read-Host "Please enter a number to calculate" | |
#now we calculate the whole fizzbuzz bit | |
for (($i = 1); $i -le $num; $i++) | |
{ | |
If (($i % 3 -eq 0) -And ($i % 5 -ne 0)) | |
{ | |
Write-Host "Fizz" | |
} |
This file contains hidden or 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
#Simple fizzbuzz script for bash | |
#!/bin/bash | |
echo "Input a value for fizzbuzz" | |
read num | |
for (( i = 1; i <= $num; i++ )) | |
do | |
if [ $(( "$i" % 3 )) -eq 0 ] && ! [ $(( "$i" % 5 )) -eq 0 ] | |
then | |
echo "Fizz" | |
elif [ $(( "$i" % 5 )) -eq 0 ] && ! [ $(( "$i" % 3 )) -eq 0 ] |
This file contains hidden or 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 | |
# Set the desired reveal time (24-hour format) when the ports should be unblocked | |
unblock_time="01:00" | |
#block ports at startup, they will unblock when needed. | |
ufw deny 80 | |
ufw deny 22 | |
while true |
This file contains hidden or 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/sh | |
#little script to perform dyndns updates of ipv6 addresses for afraid.org | |
#assign last ip now so we have a var to check | |
last_ip=0 | |
while sleep 300 | |
do | |
current_ip=$(ip -6 addr list scope global $device | grep -v " fd" | sed -n 's/.*inet6 \([0-9a-f:]\+\).*/\1/p' | head -n 1) | |
if [ "$current_ip" != "$last_ip" ]; then | |
#the check failed, update the ip | |
echo "The IP address is out of date.The Last IP logged is $last_ip .The Current IP is $current_ip, updating the IP" |
This file contains hidden or 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/sh | |
# DynDNS Updater Script, with HTTPS/SSL Support | |
# This example uses NameCheap's HTTPS/SSL URL update method to update the IP for hostname.example.com. This script runs in an endless loop set to the UPDATE_INTERVAL which is currently 5 minutes. | |
# Edit the settings section to match your DynDNS provider, including the DDNS URL which will be unique for each provider. | |
# This script requires curl and its CA Bundle to be installed in /opt/usr/bin, see the DynDNS article for more information. | |
# alfer@fusebin.com | |
# Debug | |
#set -x |
This file contains hidden or 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/sh | |
set -x | |
##Verify the network is up before continuing | |
until ping -c1 www.google.com >/dev/null 2>&1; do :; done | |
### Block all traffic from listed. Use ISO code ### | |
ISO="br-aggregated cn-aggregated tw-aggregated ru-aggregated ir-aggregated ph-aggregated sg-aggregated hk-aggregated ua-aggregated ge-aggregated cz-aggregated in-aggregated ke-aggregated za-aggregated id-aggregated kh-aggregated vn-aggregated rs-aggregated tr-aggregated al-aggregated bg-aggregated kr-aggregated ph-aggregated" |
NewerOlder