mirror of
https://github.com/FAUSheppy/config
synced 2025-12-09 08:08:32 +01:00
[git fast commit] 24. Jun 2018 - 16:46:37
This commit is contained in:
@@ -13,6 +13,7 @@ VPN_LOG = "vpn_status.log"
|
|||||||
BATTERY_LOG = "battery.log"
|
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"
|
||||||
|
|
||||||
BATTERY_CRITICAL = 3 # in %
|
BATTERY_CRITICAL = 3 # in %
|
||||||
BAT_WARNING_STR = ">>>>>>>>>>>>>>>> ------------ WARNING BATTER FAILURE IMMINENT ------------ <<<<<<<<<<<<<"
|
BAT_WARNING_STR = ">>>>>>>>>>>>>>>> ------------ WARNING BATTER FAILURE IMMINENT ------------ <<<<<<<<<<<<<"
|
||||||
|
|||||||
@@ -64,6 +64,16 @@ def logins():
|
|||||||
except:
|
except:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
def bcw():
|
||||||
|
try:
|
||||||
|
with open(hl_utils.hlpath(BC_WORD_LOG),'r') as f:
|
||||||
|
tmp = int(f.read())
|
||||||
|
string = "{} of 6000 words".format(tmp)
|
||||||
|
return hl_utils.color_panel(string,hl_utils.get_color(tmp,0,8000,reverse=False))
|
||||||
|
except:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def countdown():
|
def countdown():
|
||||||
delta = datetime(year=2018,month=7,day=22,hour=20) - datetime.now()
|
delta = datetime(year=2018,month=7,day=22,hour=20) - datetime.now()
|
||||||
if delta.days > 1:
|
if delta.days > 1:
|
||||||
@@ -75,4 +85,4 @@ def countdown():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(countdown(),logins(),ip(),vpn(),guthaben(),battery(),date(),sep='',end='')
|
print(bcw(),countdown(),logins(),ip(),vpn(),guthaben(),battery(),date(),sep='',end='')
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ def sigusr2_handler(signum, frame):
|
|||||||
|
|
||||||
|
|
||||||
def quota():
|
def quota():
|
||||||
|
if True:
|
||||||
|
return
|
||||||
if hl_utils.is_cip():
|
if hl_utils.is_cip():
|
||||||
q=hl_utils.shexec("cip-quota")
|
q=hl_utils.shexec("cip-quota")
|
||||||
ciptmp="WTF"
|
ciptmp="WTF"
|
||||||
@@ -169,6 +171,13 @@ def pr_acct_status():
|
|||||||
with open(hl_utils.hlpath(PRINT_LOG),'w') as f:
|
with open(hl_utils.hlpath(PRINT_LOG),'w') as f:
|
||||||
f.write(out)
|
f.write(out)
|
||||||
|
|
||||||
|
def bc_words():
|
||||||
|
if hl_utils.is_cip():
|
||||||
|
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 = tmp.split()[0]
|
||||||
|
g.write(tmp)
|
||||||
|
|
||||||
def vpn_status():
|
def vpn_status():
|
||||||
if not hl_utils.is_cip():
|
if not hl_utils.is_cip():
|
||||||
out_vpn = hl_utils.shexec("ip r g 8.8.8.8").split("\n")[0]
|
out_vpn = hl_utils.shexec("ip r g 8.8.8.8").split("\n")[0]
|
||||||
@@ -176,7 +185,7 @@ def vpn_status():
|
|||||||
out_vpn = hl_utils.color_panel("VPN: In Use",GREEN)
|
out_vpn = hl_utils.color_panel("VPN: In Use",GREEN)
|
||||||
else:
|
else:
|
||||||
out_vpn = hl_utils.color_panel("VPN: Link Down",RED)
|
out_vpn = hl_utils.color_panel("VPN: Link Down",RED)
|
||||||
with open(hl_utils.hlpath(VPN_LOG),'w+') as g:
|
with open(hl_utils.hlpath(VPN_LOG),'w') as g:
|
||||||
g.write(out_vpn)
|
g.write(out_vpn)
|
||||||
|
|
||||||
def battery_status():
|
def battery_status():
|
||||||
@@ -212,6 +221,7 @@ def save():
|
|||||||
ip_status()
|
ip_status()
|
||||||
cip_logins()
|
cip_logins()
|
||||||
trace_login()
|
trace_login()
|
||||||
|
bc_words()
|
||||||
|
|
||||||
def trace_login():
|
def trace_login():
|
||||||
if hl_utils.is_cip():
|
if hl_utils.is_cip():
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ def color_panel(s,hex_code,seper=True):
|
|||||||
sep = ""
|
sep = ""
|
||||||
return "^fg(#" + hex_code + ") " + s + "^bg()"+sep
|
return "^fg(#" + hex_code + ") " + s + "^bg()"+sep
|
||||||
|
|
||||||
def get_color(nr,start,end):
|
def get_color(nr,start,end,reverse=False):
|
||||||
if end == start or nr >= end:
|
if end == start or nr >= end:
|
||||||
return hex(GREEN)
|
return hex(GREEN)
|
||||||
elif nr <= 0 or nr < start:
|
elif nr <= 0 or nr < start:
|
||||||
@@ -75,8 +75,14 @@ def get_color(nr,start,end):
|
|||||||
else:
|
else:
|
||||||
error("Negative interval value???")
|
error("Negative interval value???")
|
||||||
return(WHITE)
|
return(WHITE)
|
||||||
|
|
||||||
|
if not reverse:
|
||||||
r = r << 16
|
r = r << 16
|
||||||
g = g << 8
|
g = g << 8
|
||||||
|
else:
|
||||||
|
r = r << 8
|
||||||
|
g = g << 16
|
||||||
|
|
||||||
tmp_col = r + g + b
|
tmp_col = r + g + b
|
||||||
if tmp_col > 0xFFFF00:
|
if tmp_col > 0xFFFF00:
|
||||||
error("color value too high")
|
error("color value too high")
|
||||||
|
|||||||
1
zshrc
1
zshrc
@@ -324,3 +324,4 @@ alias bc="cd /proj/cipdata/ik15ydit"
|
|||||||
export PYTHONPATH=/home/cip/2013/ik15ydit/python-local
|
export PYTHONPATH=/home/cip/2013/ik15ydit/python-local
|
||||||
alias -g atip="echo 93.104.211.59"
|
alias -g atip="echo 93.104.211.59"
|
||||||
alias atp="~/.config/playercount.py"
|
alias atp="~/.config/playercount.py"
|
||||||
|
alias mongo="LD_PRELOAD=/home/cip/2013/ik15ydit/libyaml-cpp.so.0.5 ~/mongo github"
|
||||||
|
|||||||
Reference in New Issue
Block a user