From 0fce162f17cddb1efaf19c6adb937b4f9339cf38 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Fri, 19 May 2017 00:12:09 +0200 Subject: [PATCH 01/13] Removed IRC as panel-content --- herbstluftwm/panel_content.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/herbstluftwm/panel_content.py b/herbstluftwm/panel_content.py index 4726e38..abf7389 100755 --- a/herbstluftwm/panel_content.py +++ b/herbstluftwm/panel_content.py @@ -126,4 +126,4 @@ def irc(): else: return '' -print(irc(),guthaben(),battery(),sep='') +print(guthaben(),battery(),sep='') From 89cf18b0ca91376d11b253030f9562d0e0a23149 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 22 May 2017 13:01:36 +0200 Subject: [PATCH 02/13] Added baisc vpn support zsh/hl --- herbstluftwm/autostart | 4 +++- zshrc | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index 2212b06..c5a81a3 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -38,6 +38,8 @@ if [[ "$HOST" == "atlantislaptop" ]]; then xautolock -time 15 -locker /home/ik15ydit/.config/i3lock/piclock.sh & /usr/bin/dunst & hc keybind $Mod-o spawn /bin/bash -c "systemctl hibernate" + hc keybind $Mod-c spawn /bin/bash -c "sudo /usr/bin/openvpn_cip.sh" + hc keybind $Mod-Shift-c spawn /bin/bash -c "sudo stopvpn.sh" fi @@ -166,7 +168,7 @@ hc mousebind $Mod-Button3 resize hc keybind $Mod-BackSpace cycle_monitor hc keybind $Mod-Tab cycle_all +1 hc keybind $Mod-Shift-Tab cycle_all -1 -hc keybind $Mod-c cycle +#hc keybind $Mod-c cycle #hc keybind $Mod-i jumpto urgent #pulseaudio diff --git a/zshrc b/zshrc index 4cec87e..59ed5f7 100644 --- a/zshrc +++ b/zshrc @@ -111,6 +111,7 @@ if [[ $HOST =~ atlantis* ]]; then alias telegram-plain='ssh uni -t "/proj/ciptmp/ik15ydit/Zeug/Telegram/tg/bin/telegram-cli --disable-colors --disable-readline -k tg-server.pub"' alias x='exec startx' + alias vpn='sudo /usr/bin/openvpn_cip.sh' else alias telegram='/proj/ciptmp/ik15ydit/Zeug/Telegram/tg/bin/telegram-cli -k tg-server.pub' alias burp=/home/cip/2013/ik15ydit/ciptmp/reps/WebScan/burpsuite/BurpSuiteFree From ac19b67953179e6631a586105e1f787c9d6d01af Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 22 May 2017 13:10:30 +0200 Subject: [PATCH 03/13] cleaning up hl dir --- herbstluftwm/autostart | 2 +- .../{panel_content.py => hl_panel_content.py} | 0 .../{cwd_helper.py => hl_start_urxvt_cwd.py} | 0 ...l_pracct_deamon.py => hl_status_deamon.py} | 0 herbstluftwm/panel.sh | 2 +- herbstluftwm/wsbar.sh | 54 ------------------- 6 files changed, 2 insertions(+), 56 deletions(-) rename herbstluftwm/{panel_content.py => hl_panel_content.py} (100%) rename herbstluftwm/{cwd_helper.py => hl_start_urxvt_cwd.py} (100%) rename herbstluftwm/{hl_pracct_deamon.py => hl_status_deamon.py} (100%) delete mode 100755 herbstluftwm/wsbar.sh diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index c5a81a3..0fd6018 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -59,7 +59,7 @@ hc keybind $Mod-q close #spawn shit hc keybind $Mod-Return spawn urxvt -hc keybind $Mod-Shift-Return spawn ~/.config/herbstluftwm/cwd_helper.py +hc keybind $Mod-Shift-Return spawn ~/.config/herbstluftwm/hl_start_urxvt.py hc keybind $Mod-i spawn urxvt -e nohup zsh -c "chromium &" #need to reliably use the zshconf chromium if [[ $HOST =~ atlantis* ]]; then hc keybind $Mod-l spawn i3lock -i ~/.config/i3lock/bg.png -t diff --git a/herbstluftwm/panel_content.py b/herbstluftwm/hl_panel_content.py similarity index 100% rename from herbstluftwm/panel_content.py rename to herbstluftwm/hl_panel_content.py diff --git a/herbstluftwm/cwd_helper.py b/herbstluftwm/hl_start_urxvt_cwd.py similarity index 100% rename from herbstluftwm/cwd_helper.py rename to herbstluftwm/hl_start_urxvt_cwd.py diff --git a/herbstluftwm/hl_pracct_deamon.py b/herbstluftwm/hl_status_deamon.py similarity index 100% rename from herbstluftwm/hl_pracct_deamon.py rename to herbstluftwm/hl_status_deamon.py diff --git a/herbstluftwm/panel.sh b/herbstluftwm/panel.sh index 8998e2e..564ffba 100755 --- a/herbstluftwm/panel.sh +++ b/herbstluftwm/panel.sh @@ -118,7 +118,7 @@ hc pad $monitor $panel_height echo -n "^bg()^fg() ${windowtitle//^/^^}" ####################### Interface to python layer ######################### - right="30. Mai 14 Kobras |$($HOME/.config/herbstluftwm/panel_content.py) $date" + right="30. Mai 14 Kobras |$($HOME/.config/herbstluftwm/hl_panel_content.py) $date" right_text_only=$(echo -n "$right" | sed 's.\^[^(]*([^)]*)..g') # get width of right aligned text.. and add some space.. diff --git a/herbstluftwm/wsbar.sh b/herbstluftwm/wsbar.sh deleted file mode 100755 index a4142bb..0000000 --- a/herbstluftwm/wsbar.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -FG='white' -BG='black' -FONT="-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*" - -function uniq_linebuffered() { - awk '$0 != l { print ; l=$0 ; fflush(); }' "$@" -} - -{ - conky -c ~/.conkyrc_herbstluft | while read -r; do - echo -e "conky $REPLY"; - #break - done > >(uniq_linebuffered) & - childpid=$! - herbstclient --idle - kill $childpid -} | { - TAGS=( $(herbstclient tag_status $monitor) ) - conky="" - separator="^fg(#1793D0)^ro(1x16)^fg()" - while true; do - for i in "${TAGS[@]}" ; do - echo -n "^ca(1,herbstclient use ${i:1}) " - case ${i:0:1} in - '#') - echo -n "^fg(#1793D0)[^fg(#FFFFFF)${i:1}^fg(#1793D0)]" - ;; - ':') - echo -n "^fg(#FFFFFF) ${i:1} " - ;; - *) - echo -n "^fg(#123456) ${i:1} " - ;; - esac - echo -n "^ca()" - done - echo -n " $separator" - conky_text_only=$(echo -n "$conky"|sed 's.\^[^(]*([^)]*)..g') - width=$(textwidth "$FONT" "$conky_text_only ") - echo -n "^p(_RIGHT)^p(-$width)$conky" - echo - read line || break - cmd=( $line ) - case "$cmd[0]" in - tag*) - TAGS=( $(herbstclient tag_status $monitor) ) - ;; - conky*) - conky="${cmd[@]:1}" - ;; - esac - done -} 2> /dev/null |dzen2 -ta l -y 0 -x 0 -h 16 -w 1286 -fg $FG -bg $BG -fn $FONT & From 9718cfde07627738f3dab95e0a6b808b717117d8 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 22 May 2017 13:27:52 +0200 Subject: [PATCH 04/13] Added missing python package for deb 9 --- other/package_list_full.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/other/package_list_full.txt b/other/package_list_full.txt index d3a988e..873bd4f 100644 --- a/other/package_list_full.txt +++ b/other/package_list_full.txt @@ -57,6 +57,7 @@ pulseaudio ;#sound python ;#python python-pdfminer ;#needed for markingbird python-pip ;#install python modules +python-psutils ;#needed for hl_start_urxvt_cwd.py (hlconfig) qemu-kvm ;#virtual machine rofi ;#easier find/switch between open windows rxvt-unicode-256color ;#terminal-emulator From 2286cab7411ce83a4f6d3438e6f0d6fa48db10b0 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 22 May 2017 17:12:18 +0200 Subject: [PATCH 05/13] Fixed Hotkey --- herbstluftwm/autostart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index 0fd6018..abd75ee 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -59,7 +59,7 @@ hc keybind $Mod-q close #spawn shit hc keybind $Mod-Return spawn urxvt -hc keybind $Mod-Shift-Return spawn ~/.config/herbstluftwm/hl_start_urxvt.py +hc keybind $Mod-Shift-Return spawn ~/.config/herbstluftwm/hl_start_urxvt_cwd.py hc keybind $Mod-i spawn urxvt -e nohup zsh -c "chromium &" #need to reliably use the zshconf chromium if [[ $HOST =~ atlantis* ]]; then hc keybind $Mod-l spawn i3lock -i ~/.config/i3lock/bg.png -t From a529dc01305cc4b8be3abd520daa7f638a9528cf Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 22 May 2017 17:12:45 +0200 Subject: [PATCH 06/13] Fixed Supprocess array --- herbstluftwm/hl_start_urxvt_cwd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/herbstluftwm/hl_start_urxvt_cwd.py b/herbstluftwm/hl_start_urxvt_cwd.py index 5342a8c..2dbc4ea 100755 --- a/herbstluftwm/hl_start_urxvt_cwd.py +++ b/herbstluftwm/hl_start_urxvt_cwd.py @@ -25,7 +25,8 @@ if window==-1: ############ IF URXVT GET PID ########### pid = -1 -out = shexec('xprop -id '+hex(window)).split('\n') +out = subprocess.check_output(['xprop','-id',hex(window)]).decode().split('\n') +#out = shexec('xprop -id '+hex(window)).split('\n') #not working for l in out: if l.startswith('WM_CLASS(STRING)') and 'urxvt' in l: break; From d81c63bbe3fa944054b3b8573441a7964d709343 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 22 May 2017 17:54:56 +0200 Subject: [PATCH 07/13] Added VPN-Status in panel --- herbstluftwm/hl_panel_content.py | 9 ++++++++- herbstluftwm/hl_status_deamon.py | 28 ++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/herbstluftwm/hl_panel_content.py b/herbstluftwm/hl_panel_content.py index abf7389..1c0f9fc 100755 --- a/herbstluftwm/hl_panel_content.py +++ b/herbstluftwm/hl_panel_content.py @@ -71,6 +71,13 @@ def guthaben(): guthaben = color_panel(guthaben,col) return guthaben; +def vpn(): + vpn = '' + if not hl_utils.is_cip(): + tmp = -1 + with open(hl_utils.hlpath("vpn_status.log")) as f: + tmp = float(f.read()); + return tmp; def battery(): if hl_utils.is_laptop(): @@ -126,4 +133,4 @@ def irc(): else: return '' -print(guthaben(),battery(),sep='') +print(vpn(),guthaben(),battery(),sep='') diff --git a/herbstluftwm/hl_status_deamon.py b/herbstluftwm/hl_status_deamon.py index 6c36aae..db4719f 100755 --- a/herbstluftwm/hl_status_deamon.py +++ b/herbstluftwm/hl_status_deamon.py @@ -2,14 +2,38 @@ import os import sys import time +import subprocess +from hl_panel_content.py import color_panel from hl_utils import error, is_cip, shexec, color_remove, hlpath +RED = 0xff0000 +GREEN = 0x32CD32 +YELLOW = 0xffff00 + #Druckerguthaben -if is_cip(): - while(True): +while(True): + if is_cip(): path = hlpath("pracct.log") out = color_remove(shexec("pr_acct").split("\n")[0]).split(' ')[-1] with open(path,'w+') as f: f.write(out) + if not is_cip(): + vpn_path = hlpath("vpn_status.log") + out_vpn = subprocess.check_output(["ps","-ef"]).decode().split('\n') + #filter(lambda x: not 'openvpn' in x,out_vpn) + ret = 0 + for l in out_vpn: + if 'openvpn' in l: + ret += 1; + print(ret) + if ret <= 1: + out_vpn = color_panel("VPN DEACTIVATED",GREEN) + if ret == 2: + out_vpn = color_panel("VPN CONNECTED",RED) + if ret >= 3: + out_vpn = color_panel("multiple VPNs connected",YELLOW) + print(out_vpn) + with open(vpn_path,'w+') as g: + g.write(out_vpn) time.sleep(30) sys.exit() From 9b7c4585e4b3e3ec8bbf4d8ad030d9fe1281b3a1 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 22 May 2017 18:06:48 +0200 Subject: [PATCH 08/13] Fixed VPN status --- herbstluftwm/hl_panel_content.py | 9 +++++---- herbstluftwm/hl_status_deamon.py | 14 ++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/herbstluftwm/hl_panel_content.py b/herbstluftwm/hl_panel_content.py index 1c0f9fc..86358e7 100755 --- a/herbstluftwm/hl_panel_content.py +++ b/herbstluftwm/hl_panel_content.py @@ -76,7 +76,8 @@ def vpn(): if not hl_utils.is_cip(): tmp = -1 with open(hl_utils.hlpath("vpn_status.log")) as f: - tmp = float(f.read()); + tmp = f.read() + tmp = ' '+tmp return tmp; def battery(): @@ -95,7 +96,7 @@ def battery(): if bat.startswith("Charging"): return color_panel("Charging",GREEN,seper=False) + color_panel(bat.lstrip("Charging ,").strip('\n'),get_color(plain,0,100)) - elif bat.startswith("Full"): + elif bat.startswith("Full") or bat.startswith('Unknown'): return color_panel("On Supply and fully charged",GREEN) elif plain <= 1: return color_panel(">>>>>>>>>>>>>>>> --------------- WARNING BATTER FAILURE IMMINENT --------------- <<<<<<<<<<<<<",RED) @@ -132,5 +133,5 @@ def irc(): pass else: return '' - -print(vpn(),guthaben(),battery(),sep='') +if __name__ == "__main__": + print(vpn(),guthaben(),battery(),sep='') diff --git a/herbstluftwm/hl_status_deamon.py b/herbstluftwm/hl_status_deamon.py index db4719f..e272c84 100755 --- a/herbstluftwm/hl_status_deamon.py +++ b/herbstluftwm/hl_status_deamon.py @@ -3,7 +3,7 @@ import os import sys import time import subprocess -from hl_panel_content.py import color_panel +from hl_panel_content import color_panel from hl_utils import error, is_cip, shexec, color_remove, hlpath RED = 0xff0000 @@ -27,12 +27,14 @@ while(True): ret += 1; print(ret) if ret <= 1: - out_vpn = color_panel("VPN DEACTIVATED",GREEN) - if ret == 2: - out_vpn = color_panel("VPN CONNECTED",RED) - if ret >= 3: + out_vpn = color_panel("VPN DEACTIVATED",RED) + elif ret <= 3: + out_vpn = color_panel("VPN CONNECTED",GREEN) + elif ret >= 4: out_vpn = color_panel("multiple VPNs connected",YELLOW) - print(out_vpn) + else: + out_vpn = color_panel("WTF VPN STATUS BROKEN",RED) + #print(out_vpn) with open(vpn_path,'w+') as g: g.write(out_vpn) time.sleep(30) From 71e712dd2477f9021c534f660afe7a874913be7c Mon Sep 17 00:00:00 2001 From: Sheppy Date: Tue, 23 May 2017 00:34:42 +0200 Subject: [PATCH 09/13] Adding lock to hibernatecall --- herbstluftwm/autostart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index abd75ee..c9e7e2d 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -37,7 +37,7 @@ if [[ "$HOST" == "atlantislaptop" ]]; then hc keybind XF86MonBrightnessDown spawn /bin/bash -c 'tee /sys/class/backlight/intel_backlight/brightness <<< "$(expr $(cat /sys/class/backlight/intel_backlight/brightness) - 5)"' xautolock -time 15 -locker /home/ik15ydit/.config/i3lock/piclock.sh & /usr/bin/dunst & - hc keybind $Mod-o spawn /bin/bash -c "systemctl hibernate" + hc keybind $Mod-o spawn /bin/bash -c "/home/ik15ydit/.config/i3lock/piclock.sh & systemctl hibernate" hc keybind $Mod-c spawn /bin/bash -c "sudo /usr/bin/openvpn_cip.sh" hc keybind $Mod-Shift-c spawn /bin/bash -c "sudo stopvpn.sh" fi From fb98f6264709f1d0d3317066c0e10e194d3611b1 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Tue, 23 May 2017 00:35:21 +0200 Subject: [PATCH 10/13] No Idea where that went in the first palce.. --- herbstluftwm/hl_status_deamon.py | 17 +++++++++++------ i3lock/piclock.sh | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100755 i3lock/piclock.sh diff --git a/herbstluftwm/hl_status_deamon.py b/herbstluftwm/hl_status_deamon.py index e272c84..3dd1de8 100755 --- a/herbstluftwm/hl_status_deamon.py +++ b/herbstluftwm/hl_status_deamon.py @@ -11,12 +11,13 @@ GREEN = 0x32CD32 YELLOW = 0xffff00 #Druckerguthaben -while(True): - if is_cip(): +def pr_acct_status()_ + if is_cip(): path = hlpath("pracct.log") out = color_remove(shexec("pr_acct").split("\n")[0]).split(' ')[-1] with open(path,'w+') as f: f.write(out) +def vpn_status(): if not is_cip(): vpn_path = hlpath("vpn_status.log") out_vpn = subprocess.check_output(["ps","-ef"]).decode().split('\n') @@ -27,15 +28,19 @@ while(True): ret += 1; print(ret) if ret <= 1: - out_vpn = color_panel("VPN DEACTIVATED",RED) + out_vpn = color_panel("VPN: Link Down",RED) elif ret <= 3: - out_vpn = color_panel("VPN CONNECTED",GREEN) + out_vpn = color_panel("VPN: In Use",GREEN) elif ret >= 4: out_vpn = color_panel("multiple VPNs connected",YELLOW) else: - out_vpn = color_panel("WTF VPN STATUS BROKEN",RED) + out_vpn = color_panel("VPN: WTF alles kaputt",RED) #print(out_vpn) with open(vpn_path,'w+') as g: g.write(out_vpn) time.sleep(30) -sys.exit() + +if __name__ = '__main__': + while(True): + vpn_status() + pr_acct_status() diff --git a/i3lock/piclock.sh b/i3lock/piclock.sh new file mode 100755 index 0000000..b950aa4 --- /dev/null +++ b/i3lock/piclock.sh @@ -0,0 +1 @@ +i3lock -i ~/.config/i3lock/bg.png -t From fa662b9ac50a38aa2aa7cb2339aa9fee3f6fe7f7 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Tue, 23 May 2017 00:59:51 +0200 Subject: [PATCH 11/13] Improved VPN detection --- herbstluftwm/autostart | 4 ++-- herbstluftwm/hl_status_deamon.py | 25 ++++++++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index c9e7e2d..4a3884e 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -38,8 +38,8 @@ if [[ "$HOST" == "atlantislaptop" ]]; then xautolock -time 15 -locker /home/ik15ydit/.config/i3lock/piclock.sh & /usr/bin/dunst & hc keybind $Mod-o spawn /bin/bash -c "/home/ik15ydit/.config/i3lock/piclock.sh & systemctl hibernate" - hc keybind $Mod-c spawn /bin/bash -c "sudo /usr/bin/openvpn_cip.sh" - hc keybind $Mod-Shift-c spawn /bin/bash -c "sudo stopvpn.sh" + hc keybind $Mod-c spawn /bin/bash -c "sudo /usr/bin/openvpn_cip.sh & ~/.config/herbstluftwm/hl_status_deamon.py --refresh" + hc keybind $Mod-Shift-c spawn /bin/bash -c "sudo stopvpn.sh && ~/.config/herbstluftwm/hl_status_deamon.py --refresh" fi diff --git a/herbstluftwm/hl_status_deamon.py b/herbstluftwm/hl_status_deamon.py index 3dd1de8..9e26b60 100755 --- a/herbstluftwm/hl_status_deamon.py +++ b/herbstluftwm/hl_status_deamon.py @@ -2,6 +2,7 @@ import os import sys import time +import sys import subprocess from hl_panel_content import color_panel from hl_utils import error, is_cip, shexec, color_remove, hlpath @@ -11,7 +12,7 @@ GREEN = 0x32CD32 YELLOW = 0xffff00 #Druckerguthaben -def pr_acct_status()_ +def pr_acct_status(): if is_cip(): path = hlpath("pracct.log") out = color_remove(shexec("pr_acct").split("\n")[0]).split(' ')[-1] @@ -23,24 +24,30 @@ def vpn_status(): out_vpn = subprocess.check_output(["ps","-ef"]).decode().split('\n') #filter(lambda x: not 'openvpn' in x,out_vpn) ret = 0 + #worst case thats about 1k lines for l in out_vpn: - if 'openvpn' in l: + if 'openvpn' in l and not 'sudo' in l and not 'grep' in l and not 'cip.sh' in l: ret += 1; - print(ret) - if ret <= 1: + #print(ret) + if ret == 0: out_vpn = color_panel("VPN: Link Down",RED) - elif ret <= 3: + elif ret == 1: out_vpn = color_panel("VPN: In Use",GREEN) - elif ret >= 4: + elif ret > 1: out_vpn = color_panel("multiple VPNs connected",YELLOW) else: - out_vpn = color_panel("VPN: WTF alles kaputt",RED) + out_vpn = color_panel("VPN: ret was "+str(ret)+" ??",RED) #print(out_vpn) with open(vpn_path,'w+') as g: g.write(out_vpn) - time.sleep(30) -if __name__ = '__main__': +if __name__ == '__main__': + #print('"'+sys.argv[-1]+'"') + if sys.argv[-1]=='--refresh': + vpn_status() + pr_acct_status() + sys.exit() while(True): vpn_status() pr_acct_status() + time.sleep(30) From 6f805b8cc790b2d0521bf82073b0f19a29565314 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Tue, 23 May 2017 23:46:55 +0200 Subject: [PATCH 12/13] Various Additional files --- atlantislaptop/active | 19 +++++++++++ atlantislaptop/copyfiles.sh | 13 ++++++++ atlantislaptop/edurom | 20 ++++++++++++ atlantislaptop/openvpn | 36 +++++++++++++++++++++ atlantislaptop/openvpn_cip.sh | 1 + atlantislaptop/ssh_config | 54 ++++++++++++++++++++++++++++++++ atlantislaptop/stopvpn.sh | 1 + atlantislaptop/sudoers | 31 ++++++++++++++++++ herbstluftwm/hl_panel_content.py | 2 ++ zshrc | 1 + 10 files changed, 178 insertions(+) create mode 100644 atlantislaptop/active create mode 100644 atlantislaptop/copyfiles.sh create mode 100644 atlantislaptop/edurom create mode 100644 atlantislaptop/openvpn create mode 100755 atlantislaptop/openvpn_cip.sh create mode 100644 atlantislaptop/ssh_config create mode 100755 atlantislaptop/stopvpn.sh create mode 100755 atlantislaptop/sudoers diff --git a/atlantislaptop/active b/atlantislaptop/active new file mode 100644 index 0000000..24dcd35 --- /dev/null +++ b/atlantislaptop/active @@ -0,0 +1,19 @@ +wpa +wpa-peap +wpa-peap-wo-domain +wpa-psk +wpa-psk-hex +wpa2-leap +wpa2-peap +wpa2-peap-wo-domain +wep-hex +wep-passphrase +wep-shared +leap +ttls +eap +peap +peap-tkip +eap-tls +psu +edurom diff --git a/atlantislaptop/copyfiles.sh b/atlantislaptop/copyfiles.sh new file mode 100644 index 0000000..b5b9162 --- /dev/null +++ b/atlantislaptop/copyfiles.sh @@ -0,0 +1,13 @@ +CONF_DIR=~/.config/atlantislaptop + +#system config +cp $CONF_DIR/openvpn /etc/default/ +cp $CONF_DIR/ssh_config /etc/ssh/ +cp $CONF_DIR/sudoers /etc/ +cp $CONF_DIR/active /etc/wicd/encryption/templates/ +cp $CONF_DIR/edurom /etc/wicd/encryption/templates/ + +#scripts in path +cp $CONF_DIR/openvpn_cip.sh /usr/bin/ +cp $CONF_DIR/stopvpn.sh /usr/bin/ +echo "auth.txt expected in /etc/openvpn/" diff --git a/atlantislaptop/edurom b/atlantislaptop/edurom new file mode 100644 index 0000000..7cc9885 --- /dev/null +++ b/atlantislaptop/edurom @@ -0,0 +1,20 @@ +name = eduroam +author = wlan-support@rrze.fau.de +version = 1 +require identity *Identity anonymous_identity *Anonymous_identity password *Password ca_cert *Path_to_CA_Cert +----- +ctrl_interface=/var/run/wpa_supplicant +network={ + ssid="$_ESSID" + scan_ssid=$_SCAN + key_mgmt=WPA-EAP + pairwise=CCMP TKIP + group=CCMP + eap=TTLS + identity="$_IDENTITY" + anonymous_identity="$_ANONYMOUS_IDENTITY" + password="$_PASSWORD" + ca_cert="$_CA_CERT" + phase1="peaplabel=0" + phase2="auth=PAP" +} diff --git a/atlantislaptop/openvpn b/atlantislaptop/openvpn new file mode 100644 index 0000000..058107d --- /dev/null +++ b/atlantislaptop/openvpn @@ -0,0 +1,36 @@ +# This is the configuration file for /etc/init.d/openvpn + +# +# Start only these VPNs automatically via init script. +# Allowed values are "all", "none" or space separated list of +# names of the VPNs. If empty, "all" is assumed. +# The VPN name refers to the VPN configutation file name. +# i.e. "home" would be /etc/openvpn/home.conf +# +# If you're running systemd, changing this variable will +# require running "systemctl daemon-reload" followed by +# a restart of the openvpn service (if you removed entries +# you may have to stop those manually) +# +#AUTOSTART="all" +AUTOSTART="none" +#AUTOSTART="home office" +# +# WARNING: If you're running systemd the rest of the +# options in this file are ignored. +# +# Refresh interval (in seconds) of default status files +# located in /var/run/openvpn.$NAME.status +# Defaults to 10, 0 disables status file generation +# +#STATUSREFRESH=10 +#STATUSREFRESH=0 +# Optional arguments to openvpn's command line +OPTARGS="" +# +# If you need openvpn running after sendsigs, i.e. +# to let umountnfs work over the vpn, set OMIT_SENDSIGS +# to 1 and include umountnfs as Required-Stop: in openvpn's +# init.d script (remember to run insserv after that) +# +OMIT_SENDSIGS=0 diff --git a/atlantislaptop/openvpn_cip.sh b/atlantislaptop/openvpn_cip.sh new file mode 100755 index 0000000..c07de06 --- /dev/null +++ b/atlantislaptop/openvpn_cip.sh @@ -0,0 +1 @@ +openvpn --config /etc/openvpn/openfaupn.conf --auth-user-pass /etc/openvpn/auth.txt diff --git a/atlantislaptop/ssh_config b/atlantislaptop/ssh_config new file mode 100644 index 0000000..12ee7d6 --- /dev/null +++ b/atlantislaptop/ssh_config @@ -0,0 +1,54 @@ + +# This is the ssh client system-wide configuration file. See +# ssh_config(5) for more information. This file provides defaults for +# users, and the values can be changed in per-user configuration files +# or on the command line. + +# Configuration data is parsed as follows: +# 1. command line options +# 2. user-specific file +# 3. system-wide file +# Any configuration value is only changed the first time it is set. +# Thus, host-specific definitions should be at the beginning of the +# configuration file, and defaults at the end. + +# Site-wide defaults for some commonly used options. For a comprehensive +# list of available options, their meanings and defaults, please see the +# ssh_config(5) man page. + +Host * +# ForwardAgent no +# ForwardX11 no +# ForwardX11Trusted yes +# RhostsRSAAuthentication no +# RSAAuthentication yes +# PasswordAuthentication yes +# HostbasedAuthentication no +# GSSAPIAuthentication no +# GSSAPIDelegateCredentials no +# GSSAPIKeyExchange no +# GSSAPITrustDNS no +# BatchMode no +# CheckHostIP yes +# AddressFamily any +# ConnectTimeout 0 +# StrictHostKeyChecking ask + IdentityFile ~/.ssh/identity +# IdentityFile ~/.ssh/id_rsa +# IdentityFile ~/.ssh/id_dsa +# Port 22 + Protocol 2 +# Cipher 3des +# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc +# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 +# EscapeChar ~ +# Tunnel no +# TunnelDevice any:any +# PermitLocalCommand no +# VisualHostKey no +# ProxyCommand ssh -q -W %h:%p gateway.example.com +# RekeyLimit 1G 1h + SendEnv LANG LC_* + HashKnownHosts yes + GSSAPIAuthentication yes + GSSAPIDelegateCredentials no diff --git a/atlantislaptop/stopvpn.sh b/atlantislaptop/stopvpn.sh new file mode 100755 index 0000000..8022a50 --- /dev/null +++ b/atlantislaptop/stopvpn.sh @@ -0,0 +1 @@ +pkill openvpn diff --git a/atlantislaptop/sudoers b/atlantislaptop/sudoers new file mode 100755 index 0000000..ece9208 --- /dev/null +++ b/atlantislaptop/sudoers @@ -0,0 +1,31 @@ +# +# This file MUST be edited with the 'visudo' command as root. +# +# Please consider adding local content in /etc/sudoers.d/ instead of +# directly modifying this file. +# +# See the man page for details on how to write a sudoers file. +# +Defaults env_reset +Defaults mail_badpass +Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +# Host alias specification + +# User alias specification + +# Cmnd alias specification + +# User privilege specification +root ALL=(ALL:ALL) ALL + +# Allow members of group sudo to execute any command +%sudo ALL=(ALL:ALL) ALL +#ik15ydit ALL=(ALL) NOPASSWD: /sys/class/backlight/intel_backlight/brightness +ik15ydit ALL=(ALL) NOPASSWD: /bin/mount +ik15ydit ALL=(ALL) NOPASSWD: /bin/umount +ik15ydit ALL=(ALL) NOPASSWD: /usr/bin/openvpn_cip.sh +ik15ydit ALL=(ALL) NOPASSWD: /usr/bin/stopvpn.sh +# See sudoers(5) for more information on "#include" directives: + +#includedir /etc/sudoers.d diff --git a/herbstluftwm/hl_panel_content.py b/herbstluftwm/hl_panel_content.py index 86358e7..54f704f 100755 --- a/herbstluftwm/hl_panel_content.py +++ b/herbstluftwm/hl_panel_content.py @@ -25,6 +25,8 @@ def color_panel(s,hex_code,seper=True): return "^fg(#" + hex_code + ") " + s + "^bg()"+sep def get_color(nr,start,end): + if nr == 88: + return hex(GREEN) if end == start or nr >= end: return hex(GREEN) else: diff --git a/zshrc b/zshrc index 59ed5f7..85c3fb2 100644 --- a/zshrc +++ b/zshrc @@ -122,6 +122,7 @@ function qfind { } alias pcolor='for i in {0..255} ; do printf "\x1b[38;5;${i}mcolour${i} "; if [[ $(((($i+3)/6)*6)) -eq $(($i+3)) ]]; then echo; fi; done' alias "ipconf"="ip addr show" +alias 'vpn?'='ps -ef | grep openvpn | grep -v grep' ## General ## if [[ $HOST =~ atlantis* ]]; then From a65be426b20b4fc69da1a8e0cc2bb7d37b5b29cc Mon Sep 17 00:00:00 2001 From: Sheppy Date: Wed, 24 May 2017 00:00:04 +0200 Subject: [PATCH 13/13] more config --- atlantislaptop/auth.txt.gpg | 1 + atlantislaptop/copyfiles.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 atlantislaptop/auth.txt.gpg diff --git a/atlantislaptop/auth.txt.gpg b/atlantislaptop/auth.txt.gpg new file mode 100755 index 0000000..1bd7cc9 --- /dev/null +++ b/atlantislaptop/auth.txt.gpg @@ -0,0 +1 @@ + )vgneS&_}$TfE&[qbN*2Six[gcR7HHFd');<* J 6YZV>̋Z \ No newline at end of file diff --git a/atlantislaptop/copyfiles.sh b/atlantislaptop/copyfiles.sh index b5b9162..9ec77cd 100644 --- a/atlantislaptop/copyfiles.sh +++ b/atlantislaptop/copyfiles.sh @@ -10,4 +10,6 @@ cp $CONF_DIR/edurom /etc/wicd/encryption/templates/ #scripts in path cp $CONF_DIR/openvpn_cip.sh /usr/bin/ cp $CONF_DIR/stopvpn.sh /usr/bin/ -echo "auth.txt expected in /etc/openvpn/" + +gpg --output /etc/openvpn/auth.txt -d auth.txt.gpg +chmod 500 /etc/openvpn/auth.txt