mirror of
https://github.com/FAUSheppy/config
synced 2025-12-10 00:28:32 +01:00
genocide
This commit is contained in:
@@ -245,6 +245,3 @@ for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
|
|||||||
# start it on each monitor
|
# start it on each monitor
|
||||||
"$panel" $monitor &
|
"$panel" $monitor &
|
||||||
done
|
done
|
||||||
|
|
||||||
touch ~/.config/cip_logins
|
|
||||||
echo $HOST >> ~/.config/cip_logins
|
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from datetime import datetime
|
||||||
from hl_panel_content import color_panel, get_color
|
from hl_panel_content import color_panel, get_color
|
||||||
from hl_utils import error, is_cip, shexec, color_remove, hlpath, is_laptop
|
from hl_utils import error, is_cip, shexec, color_remove, hlpath, is_laptop
|
||||||
import re
|
import re
|
||||||
|
import socket
|
||||||
|
|
||||||
RED = 0xff0000
|
RED = 0xff0000
|
||||||
GREEN = 0x32CD32
|
GREEN = 0x32CD32
|
||||||
@@ -71,7 +73,7 @@ def battery():
|
|||||||
return color_panel(str(e),RED)
|
return color_panel(str(e),RED)
|
||||||
|
|
||||||
def battery_status():
|
def battery_status():
|
||||||
if is_laptop:
|
if is_laptop():
|
||||||
with open(hlpath("battery.log"),'w') as g:
|
with open(hlpath("battery.log"),'w') as g:
|
||||||
g.write(battery())
|
g.write(battery())
|
||||||
|
|
||||||
@@ -85,6 +87,15 @@ def ip_status():
|
|||||||
g.write(tmp)
|
g.write(tmp)
|
||||||
|
|
||||||
|
|
||||||
|
def trace_login():
|
||||||
|
if is_cip():
|
||||||
|
try:
|
||||||
|
tmp = shexec("wget --timeout=3 -O- --quiet 'https://atlantishq.de/ciplog/"+socket.gethostname()+"&active&"+str(datetime.now())+"'")
|
||||||
|
except:
|
||||||
|
tmp = "Service Unreachable"
|
||||||
|
with open(hlpath("cip_logins.log"),'w') as f:
|
||||||
|
f.write(tmp)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
#print('"'+sys.argv[-1]+'"')
|
#print('"'+sys.argv[-1]+'"')
|
||||||
while(True):
|
while(True):
|
||||||
@@ -92,8 +103,7 @@ if __name__ == '__main__':
|
|||||||
pr_acct_status()
|
pr_acct_status()
|
||||||
battery_status()
|
battery_status()
|
||||||
ip_status()
|
ip_status()
|
||||||
|
trace_login()
|
||||||
if sys.argv[-1]=='--refresh':
|
if sys.argv[-1]=='--refresh':
|
||||||
break
|
break
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
import urllib3
|
|
||||||
import socket
|
|
||||||
|
|
||||||
http = urllib3.PoolManager()
|
|
||||||
socket.setdefaulttimeout(5)
|
|
||||||
url = 'https://squarez.fauiwg.de:7001/radicale/testuser/cal.ics/'
|
|
||||||
headers = urllib3.util.make_headers(basic_auth='testuser:test')
|
|
||||||
r = http.request('GET', url, headers=headers)
|
|
||||||
f = open(test.log,'w')
|
|
||||||
f.write(r)
|
|
||||||
f.close()
|
|
||||||
Reference in New Issue
Block a user