Add COF changes
This commit is contained in:
parent
d1cd61fc24
commit
1e392aa7a7
30
emacs/.emacs.d/config/init-cof.el
Normal file
30
emacs/.emacs.d/config/init-cof.el
Normal file
@ -0,0 +1,30 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
(defun set-proxy (proxy)
|
||||
(setq url-proxy-services
|
||||
`(("https" . ,proxy)
|
||||
("http" . ,proxy)
|
||||
("no_proxy" . "^\\(127\\.0\\.0\\.1\\|localhost\\|.*local\\|169\\.254\\.169\\.254\\|.*kdc\\.capitalone\\.com\\|.*cloud\\.capitalone\\.com\\|.*clouddqt\\.capitalone.com\\)")))
|
||||
(setenv "https_proxy" proxy)
|
||||
(setenv "http_proxy" proxy)
|
||||
(setenv "no_proxy" "127.0.0.1,localhost,.local,.internal,169.254.169.254,.kdc.capitalone.com,.cloud.capitalone.com,.clouddqt.capitalone.com,.cloud.uk.capitalone.com,.clouddqt.uk.capitalone.com"))
|
||||
|
||||
(defun cofproxy ()
|
||||
(interactive)
|
||||
(request "http://127.0.0.1:44444/proxy.pac"
|
||||
:sync t
|
||||
:success (cl-function
|
||||
(lambda (&key data &allow-other-keys)
|
||||
(let ((line))
|
||||
(with-temp-buffer
|
||||
(insert data)
|
||||
(search-backward "return \"PROXY")
|
||||
(setq line (string-trim (thing-at-point 'line t))))
|
||||
(setq line (string-trim-right
|
||||
(string-trim-left line "return \"PROXY ") "\";"))
|
||||
(setq line (concat "http://" line))
|
||||
(set-proxy line)
|
||||
(message "Proxy Set: %s" line))))))
|
||||
|
||||
(add-hook 'after-init-hook #'cofproxy)
|
||||
|
||||
(provide 'init-cof)
|
@ -4,8 +4,8 @@
|
||||
(use-package dashboard
|
||||
:demand t
|
||||
:config
|
||||
(when (file-exists-p (expand-file-name "~/Sync/pictures/hallows.png"))
|
||||
(setq dashboard-startup-banner (expand-file-name "~/Sync/pictures/hallows.png")))
|
||||
(when (file-exists-p (expand-file-name "~/Pictures/hallows.png"))
|
||||
(setq dashboard-startup-banner (expand-file-name "~/Pictures/hallows.png")))
|
||||
(dashboard-setup-startup-hook)
|
||||
(evil-collection-dashboard-setup)
|
||||
:custom
|
||||
|
@ -1,6 +1,7 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package nov
|
||||
:straight (:host github :repo "wasamasa/nov.el")
|
||||
:mode (("\\.epub\\'" . nov-mode))
|
||||
:config
|
||||
(evil-collection-nov-setup))
|
||||
|
@ -13,6 +13,8 @@
|
||||
|
||||
;; Doom themes are the best themes!
|
||||
(use-package doom-themes)
|
||||
(use-package shrink-path
|
||||
:straight (:host github :repo "zbelial/shrink-path.el"))
|
||||
(use-package doom-modeline
|
||||
:config
|
||||
(doom-modeline-mode 1))
|
||||
|
@ -117,6 +117,7 @@
|
||||
(require 'init-elfeed)
|
||||
(require 'init-1pass)
|
||||
(require 'init-wallabag)
|
||||
(require 'init-cof)
|
||||
(require 'init-lola)
|
||||
(require 'handwriting)
|
||||
|
||||
|
17
zsh/.zshrc
17
zsh/.zshrc
@ -162,3 +162,20 @@ vterm_prompt_end() {
|
||||
}
|
||||
setopt PROMPT_SUBST
|
||||
PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
|
||||
|
||||
# Workaround for COF VPN issues
|
||||
function nukevpn() {
|
||||
for x in `ps aux | grep svpn | grep -v grep | awk '{ print $2 }'`
|
||||
do
|
||||
printf "\n Killing... \n `ps ${x}` \n"
|
||||
kill -15 $x
|
||||
done
|
||||
printf "\n Checking for running processes...(grep is expected) \n"
|
||||
sleep 3
|
||||
printf "\n `ps aux | grep svpn` \n"
|
||||
}
|
||||
|
||||
if [ -f /usr/local/cof/bin/cofproxy ] #source_cofproxy
|
||||
then
|
||||
cofproxy dev
|
||||
fi #source_cofproxy
|
||||
|
Loading…
Reference in New Issue
Block a user