Last active
March 30, 2018 04:58
-
-
Save lmchawla/51f15e4c1191f69947eb8e03ed41d0cc to your computer and use it in GitHub Desktop.
Screamer for mac, keep working while it informs when internet is down and back online. Accommodates sensitivity for erratic connections
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 os | |
import time | |
working = 0 | |
while True: | |
response = os.system("ping -c 1 8.8.8.8") | |
print(response, working) | |
if response == 0: | |
working = max(1, working + 1) | |
time.sleep(5) | |
else: | |
working = min(-1, working - 1) | |
time.sleep(0.1) | |
if working == 5: | |
os.system("say 'net AA gA yaaa'") | |
if working == -3: | |
os.system("say 'net cha la gA yaaa'") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment