mirror of
https://github.com/FAUSheppy/config
synced 2025-12-07 23:41:34 +01:00
[git fast commit] 25. Jun 2018 - 06:51:51
This commit is contained in:
@@ -14,6 +14,7 @@ BATTERY_LOG = "battery.log"
|
|||||||
IP_LOG = "ip.log"
|
IP_LOG = "ip.log"
|
||||||
LOGINS_LOG = "logins.log"
|
LOGINS_LOG = "logins.log"
|
||||||
BC_WORD_LOG = "bc.log"
|
BC_WORD_LOG = "bc.log"
|
||||||
|
BC_PAGE_LOG = "bcp.log"
|
||||||
|
|
||||||
BATTERY_CRITICAL = 3 # in %
|
BATTERY_CRITICAL = 3 # in %
|
||||||
BAT_WARNING_STR = ">>>>>>>>>>>>>>>> ------------ WARNING BATTER FAILURE IMMINENT ------------ <<<<<<<<<<<<<"
|
BAT_WARNING_STR = ">>>>>>>>>>>>>>>> ------------ WARNING BATTER FAILURE IMMINENT ------------ <<<<<<<<<<<<<"
|
||||||
|
|||||||
@@ -72,6 +72,12 @@ def bcw():
|
|||||||
return hl_utils.color_panel(string,hl_utils.get_color(tmp,0,8000,reverse=False))
|
return hl_utils.color_panel(string,hl_utils.get_color(tmp,0,8000,reverse=False))
|
||||||
except:
|
except:
|
||||||
return ""
|
return ""
|
||||||
|
def bwp():
|
||||||
|
try:
|
||||||
|
with open(hl_utils.hlpath(BC_PAGE_LOG),'r') as f:
|
||||||
|
return hl_utils.color_panel("{} pages".format(f.read().strip()),RED)
|
||||||
|
except:
|
||||||
|
return "lolwtf"
|
||||||
|
|
||||||
|
|
||||||
def countdown():
|
def countdown():
|
||||||
@@ -85,4 +91,4 @@ def countdown():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(bcw(),countdown(),logins(),ip(),vpn(),guthaben(),battery(),date(),sep='',end='')
|
print(bwp(),bcw(),countdown(),logins(),ip(),vpn(),guthaben(),battery(),date(),sep='',end='')
|
||||||
|
|||||||
@@ -172,11 +172,30 @@ def pr_acct_status():
|
|||||||
f.write(out)
|
f.write(out)
|
||||||
|
|
||||||
def bc_words():
|
def bc_words():
|
||||||
if hl_utils.is_cip():
|
|
||||||
with open(hl_utils.hlpath(BC_WORD_LOG),'w') as g:
|
with open(hl_utils.hlpath(BC_WORD_LOG),'w') as g:
|
||||||
tmp = hl_utils.shexec("wc -w /proj/cipdata/ik15ydit/license-confusion-bc/other_shit/lel.md")
|
tmp = hl_utils.shexec("wc -w {}".format(hl_utils.hlpath(".bctext",use_hostname=False)))
|
||||||
tmp = tmp.split()[0]
|
tmp = tmp.split()[0]
|
||||||
g.write(tmp)
|
g.write(tmp)
|
||||||
|
def bc_pages():
|
||||||
|
hl_utils.shexec("pandoc {} -o {}".format(\
|
||||||
|
hl_utils.hlpath(".bctext",use_hostname=False),\
|
||||||
|
hl_utils.hlpath("test.pdf",use_hostname=False)))
|
||||||
|
arr = hl_utils.shexec("pdftk {} dump_data".format(\
|
||||||
|
hl_utils.hlpath("test.pdf",use_hostname=False)))
|
||||||
|
arr = arr.split("\n")
|
||||||
|
lol = "lolcannon"
|
||||||
|
for el in arr:
|
||||||
|
if "NumberOfPages" in el:
|
||||||
|
try:
|
||||||
|
with open(hl_utils.hlpath(BC_PAGE_LOG),'r') as f:
|
||||||
|
if int(f.read()) == int(el):
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
lol = el
|
||||||
|
break
|
||||||
|
with open(hl_utils.hlpath(BC_PAGE_LOG),"w") as g:
|
||||||
|
g.write(el.split()[1])
|
||||||
|
|
||||||
def vpn_status():
|
def vpn_status():
|
||||||
if not hl_utils.is_cip():
|
if not hl_utils.is_cip():
|
||||||
@@ -222,6 +241,7 @@ def save():
|
|||||||
#cip_logins()
|
#cip_logins()
|
||||||
trace_login()
|
trace_login()
|
||||||
bc_words()
|
bc_words()
|
||||||
|
bc_pages()
|
||||||
|
|
||||||
def trace_login():
|
def trace_login():
|
||||||
if hl_utils.is_cip():
|
if hl_utils.is_cip():
|
||||||
|
|||||||
Reference in New Issue
Block a user