/usr/local/bin/python3.10 /Users/ryanbuckner/Library/Application Support/JetBrains/PyCharmCE2023.1/scratches/scratch_3.py
{'abc': '123'}
Process finished with exit code 0
def xxx(data):
## has a thread method with a queue that gets data that does
time.sleep(1)
print "{}".format(data)
data={"abc":"123"}
xxx(data)
data["def"] = "fgh"
import os
path = "/Applications/Safari.app"
os.system(f"open {path}")
Apr 15 19:28:53 Mac-mini Installer Progress[120]: Releasing the boot windows
Apr 15 19:28:53 Mac-mini Installer Progress[120]: Progress Updated: currentPhase = "loginwindow Boot", phase progress = 55.000, total progress = 68.623
Apr 15 19:28:54 Mac-mini Installer Progress[120]: Progress Updated: currentPhase = "loginwindow Boot", phase progress = 80.000, total progress = 86.055
Apr 15 19:29:00 Mac-mini loginwindow[173]: client 0x600003aeb8c0: phaseName = "loginwindow Boot" is done
Apr 15 19:29:00 Mac-mini loginwindow[173]: ISAP: Done with Phase "loginwindow Boot"
Apr 15 19:29:00 Mac-mini Installer Progress[120]: Progress Updated: currentPhase = "loginwindow Boot", phase progress = 100.000, total progress = 100.000
Apr 15 19:29:00 Mac-mini Installer Progress[120]: Done with phase = "loginwindow Boot"
Apr 15 19:29:00 Mac-mini Installer Progress[120]: Progress Updated: currentPhase = "loginwindow Boot", phase progress = 100.000, total progress = 100.000
Apr 15 19:29:01 Mac-mini Installer Progress[120]: Calling completion handler for phase "loginwindow Boot"
Apr 15 19:29:01 Mac-mini loginwindow[173]: client 0x600003aeb8c0: phaseName = "loginwindow Boot", hide progress UI called
Apr 15 19:29:01 Mac-mini loginwindow[173]: client 0x600003aeb8c0: phaseName = "loginwindow Boot" is being released
Apr 15 19:29:01 Mac-mini Installer Progress[120]: Saving completion handler for phase loginwindow Boot
"Phase Name" = "loginwindow Boot";
Apr 15 19:29:01 Mac-mini Installer Progress[120]: Unregister process 173, phaseName loginwindow Boot, uuid 0B0EDBF8-D13E-4657-A8B8-E8CB25DB1C98
Apr 15 19:30:09 Mac-mini reboot[1305]: SHUTDOWN_TIME: 1650043809 802759
Apr 15 19:30:42 localhost bootlog[0]: BOOT_TIME 1650043842 555236
Apr 15 19:30:54 Mac-mini Installer Progress[120]: 1 Boot windows acquired
Ap
# karl wachs 2021-07-14, use as you see fit
# put this script into the action server script of a schedule, run it once per minute
# it will then use pmset to set "poweron "to current time + 3 hours, it is only active when MAC is off, when MAC runs nothing happens
import datetime
import subprocess
pwd = "your mac password"
newBootHour = datetime.datetime.now() + datetime.timedelta(hours = 3)
boottime = "{:02d}:{:02d}:00".format(newBootHour.hour,newBootHour.minute)
indigo.server.log(">>setting boot time << {}".format(boottime) )
cmd = u"/bin/echo '"+ pwd + "' | /usr/bin/sudo -S /usr/bin/pmset repeat wakeorpoweron MTWRFSU " +boottime
#indigo.server.log(">>setting boot time << {}".format(cmd) )
ret = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
# karl wachs 2021-07-14, use as you see fit
# put this script into the action server script of a schedule, run it once per minute
# this script should run every minute. It will check if at least ONE ping to x different ip numbers works
# if ok exit, set lastNetworkOKTest to current time stamp
# if not ok check if last ok test is older than 3 minutes ( give eg switches time to reboot during upgrades etc )
# if lastOKtest < 3 minutes ago: exit
# if lastreboot < 15 minutes ago: exit
# reboot
# you need to set password below
# make sure that execution time stays below 10 secs (max # of ip numbers to test = 3)
# ==> max time is 2 rounds of pings for each ip = 2*3 secs + 2 secs wait = 8 secs
# it will create all necessary variables and folder
# all the variables usedshow time since epoch not at datestring
#
import time
import subprocess
testMaxEvery = 1.*59
rebootIfOkTestOlderThan = 3.*60
rebootNotMoreOftenThan = 20.*60
pwd = "your mac password here "
ipnumbersForPingTest = ["192.168.1.10","192.168.1.1","192.168.1.2"]# use 1..3 ip numbers
numberOfPings = 2
logOK = True
logFailed = True
try: indigo.variables.folder.create(u"rebootIfNoNetwork")
except: pass
try: indigo.variable.create(u"lastNetworkTest", "0","rebootIfNoNetwork")
except: pass
try: lastNetworkTest = float(indigo.variables["lastNetworkTest"].value)
except: lastNetworkTest = 0
try: indigo.variable.create(u"lastOKNetworkTest", "0","rebootIfNoNetwork")
except: pass
try: lastNetworkOKTest = float(indigo.variables["lastNetworkOKTest"].value)
except: lastNetworkOKTest = 0
try: indigo.variable.create(u"lastReboot", "0","rebootIfNoNetwork")
except: pass
try: lastReboot = float(indigo.variables["lastReboot"].value)
except: lastReboot = 0
now = time.time()
if now - lastNetworkTest < testMaxEvery: exit()
indigo.variable.updateValue(u"lastNetworkTest", str(now))
# send ping tries
for ipN in ipnumbersForPingTest:
pingCmd= "/sbin/ping -c {} -W 1 {}".format(numberOfPings , ipN)
ret = subprocess.Popen(pingCmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
if logOK: indigo.server.log(">>reboot if no network<< testing: {}".format(pingCmd))
if ret.find("100.0% packet loss") == -1: # accept at least one ping ok
if logOK: indigo.server.log(">>reboot if no network<<: test passed ")
indigo.variable.updateValue(u"lastOKNetworkTest", str(now))
exit()
if now - lastNetworkOKTest < rebootIfOkTestOlderThan:
if logFailed: indigo.server.log(">>reboot if no network<< test failed, but delaying reboot for {:.0f} secs, waiting for next check".format(rebootIfOkTestOlderThan-(now - lastNetworkOKTest)))
exit()
if now - lastReboot < rebootNotMoreOftenThan:
if logFailed: indigo.server.log(">>reboot if no network<< test failed, but delaying reboot for {:.0f} secs, last reboot was done previuosly".format(rebootNotMoreOftenThan-(now - lastReboot)))
exit()
indigo.variable.updateValue(u"lastReboot", str(now))
if logFailed: indigo.server.log(">>reboot if no network<< failed, rebooting in 2 secs")
time.sleep(2)
cmd = u"echo '"+ pwd + u"' | sudo -S /sbin/reboot now"
subprocess.Popen(cmd, shell=True)
kw123 wrote:Ok.I guess it’s just us three
How about this coming weekend
Is
1pm dallas
= 11am pacific
= 8pm Germany time
ok?
Karl
Sent from my iPhone using Tapatalk
https://www.nytimes.com/2021/01/06/us/politics/russia-cyber-hack.html
Dec 30, 2020 at 19:01:15
Error XML Parse Error: not well-formed (invalid token)
Error On character 0 of line number 1.
Client authentication failed - bad XML received (185.156.72.7)
Client disconnected (185.156.72.7)
Error XML Parse Error: not well-formed (invalid token)
Error On character 0 of line number 1.
Error XML Parse Error: syntax error
Error On character 0 of line number 1.
Error XML Parse Error: not well-formed (invalid token)
Error On character 0 of line number 1.
Error XML Parse Error: not well-formed (invalid token)
Error On character 0 of line number 1.
Error XML Parse Error: not well-formed (invalid token)
Error On character 0 of line number 1.