mirror of
https://github.com/FAUSheppy/config
synced 2025-12-06 15:11:35 +01:00
Merge branch 'master' of gitlab.cs.fau.de:ik15ydit/config
This commit is contained in:
@@ -16,6 +16,14 @@ def guthaben():
|
|||||||
guthaben = hl_utils.color_panel(guthaben,col)
|
guthaben = hl_utils.color_panel(guthaben,col)
|
||||||
return guthaben;
|
return guthaben;
|
||||||
|
|
||||||
|
def quota():
|
||||||
|
q = ''
|
||||||
|
if not hl_utils.is_cip():
|
||||||
|
return ''
|
||||||
|
else:
|
||||||
|
with open(hl_utils.hlpath("quota.cip")) as f:
|
||||||
|
return f.read()
|
||||||
|
|
||||||
def vpn():
|
def vpn():
|
||||||
vpn = ''
|
vpn = ''
|
||||||
if hl_utils.is_cip():
|
if hl_utils.is_cip():
|
||||||
@@ -29,6 +37,8 @@ def vpn():
|
|||||||
def ip():
|
def ip():
|
||||||
with open(hl_utils.hlpath(IP_LOG)) as f:
|
with open(hl_utils.hlpath(IP_LOG)) as f:
|
||||||
tmp = f.read()
|
tmp = f.read()
|
||||||
|
if len(tmp) > 20:
|
||||||
|
tmp = hl_utils.color_panel("Public IP: IP6 ",GREEN)
|
||||||
tmp = ' '+tmp
|
tmp = ' '+tmp
|
||||||
return tmp;
|
return tmp;
|
||||||
|
|
||||||
@@ -60,7 +70,7 @@ def countdown():
|
|||||||
tmp = "{} von 150 Tagen bis Abgabe verbleibend".format(delta.days)
|
tmp = "{} von 150 Tagen bis Abgabe verbleibend".format(delta.days)
|
||||||
else:
|
else:
|
||||||
tmp = "{}h bis BC Abgabe".format(delta.hours)
|
tmp = "{}h bis BC Abgabe".format(delta.hours)
|
||||||
tmp = hl_utils.color_panel(tmp,YELLOW)
|
tmp = hl_utils.color_panel(tmp,hl_utils.get_color(delta.days,0,180))
|
||||||
return tmp
|
return tmp
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,31 @@ def sigusr2_handler(signum, frame):
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
def quota():
|
||||||
|
if hl_utils.is_cip():
|
||||||
|
q=hl_utils.shexec("cip-quota")
|
||||||
|
ciptmp="WTF"
|
||||||
|
home="WTF"
|
||||||
|
test = []
|
||||||
|
print(q)
|
||||||
|
for l in q:
|
||||||
|
test += [l]
|
||||||
|
|
||||||
|
try:
|
||||||
|
#if l.endswith("ciptmp\n"):
|
||||||
|
ciptmp = test[2].split("(")[1].split(")")[0]
|
||||||
|
#elif l.endswith("ik15ydit\n"):
|
||||||
|
home = test[1].split("(")[1].split(")")[0]
|
||||||
|
#break
|
||||||
|
except Exception:
|
||||||
|
return
|
||||||
|
|
||||||
|
tmp = "Quota: "+home+"/"+ciptmp
|
||||||
|
with open(hl_utils.hlpath("quota.cip"),"w") as f:
|
||||||
|
print(tmp)
|
||||||
|
f.write(tmp)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def pw():
|
def pw():
|
||||||
pw="NOPE"
|
pw="NOPE"
|
||||||
@@ -163,7 +188,7 @@ last_ip="LOL"
|
|||||||
def ip_status():
|
def ip_status():
|
||||||
global last_ip
|
global last_ip
|
||||||
try:
|
try:
|
||||||
ip="Public IP: "+ hl_utils.shexec("wget --no-proxy --timeout=3 -O- --quiet https://atlantishq.de:8002/ipcheck")
|
ip="Public IP: "+ hl_utils.shexec("wget -4 --no-proxy --timeout=3 -O- --quiet https://atlantishq.de:8002/ipcheck")
|
||||||
if last_ip == ip:
|
if last_ip == ip:
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
@@ -180,6 +205,7 @@ def ip_status():
|
|||||||
g.write(tmp)
|
g.write(tmp)
|
||||||
|
|
||||||
def save():
|
def save():
|
||||||
|
quota()
|
||||||
vpn_status()
|
vpn_status()
|
||||||
pr_acct_status()
|
pr_acct_status()
|
||||||
battery_status()
|
battery_status()
|
||||||
@@ -201,7 +227,7 @@ if __name__ == '__main__':
|
|||||||
signal.signal(signal.SIGUSR2,sigusr2_handler)
|
signal.signal(signal.SIGUSR2,sigusr2_handler)
|
||||||
signal.siginterrupt(signal.SIGUSR1, True)
|
signal.siginterrupt(signal.SIGUSR1, True)
|
||||||
while(True):
|
while(True):
|
||||||
|
save()
|
||||||
if sys.argv[-1] in ['--refresh','-r']:
|
if sys.argv[-1] in ['--refresh','-r']:
|
||||||
break
|
break
|
||||||
save()
|
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ def color_panel(s,hex_code,seper=True):
|
|||||||
def get_color(nr,start,end):
|
def get_color(nr,start,end):
|
||||||
if end == start or nr >= end:
|
if end == start or nr >= end:
|
||||||
return hex(GREEN)
|
return hex(GREEN)
|
||||||
elif nr <= 0:
|
elif nr <= 0 or nr < start:
|
||||||
return hex(RED)
|
return hex(RED)
|
||||||
else:
|
else:
|
||||||
r,g,b = 0,0,0
|
r,g,b = 0,0,0
|
||||||
|
|||||||
1
vim/rc
1
vim/rc
@@ -100,4 +100,5 @@ set clipboard=unnamed
|
|||||||
" python-jedi config
|
" python-jedi config
|
||||||
"let g:jedi#popup_on_dot = 0
|
"let g:jedi#popup_on_dot = 0
|
||||||
autocmd FileType python setlocal completeopt-=preview
|
autocmd FileType python setlocal completeopt-=preview
|
||||||
|
autocmd BufNewFile,BufRead *.sp set syntax=cpp
|
||||||
autocmd BufNewFile,BufRead *.sm set syntax=cpp
|
autocmd BufNewFile,BufRead *.sm set syntax=cpp
|
||||||
|
|||||||
2
zshrc
2
zshrc
@@ -320,6 +320,8 @@ alias insurgency_status="ssh insurgency@atlantishq.de -t /usr/local/bin/insurgen
|
|||||||
alias python=python3
|
alias python=python3
|
||||||
alias dirc="ssh sheppy@atlantishq.de -t 'command;tmux a -d'"
|
alias dirc="ssh sheppy@atlantishq.de -t 'command;tmux a -d'"
|
||||||
alias gfc='git commit . -m "[git fast commit] $(date +"%d. %h %Y - %H:%M:%S")" && git push'
|
alias gfc='git commit . -m "[git fast commit] $(date +"%d. %h %Y - %H:%M:%S")" && git push'
|
||||||
|
alias bc="cd /proj/cipdata/ik15ydit"
|
||||||
|
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 players='~/trash/test/test.py'
|
alias players='~/trash/test/test.py'
|
||||||
|
|||||||
Reference in New Issue
Block a user