Add COF changes

This commit is contained in:
Jeremy Dormitzer 2021-10-15 10:40:32 -04:00
parent d1cd61fc24
commit 1e392aa7a7
6 changed files with 53 additions and 2 deletions

View 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)

View File

@ -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

View File

@ -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))

View File

@ -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))

View File

@ -117,6 +117,7 @@
(require 'init-elfeed)
(require 'init-1pass)
(require 'init-wallabag)
(require 'init-cof)
(require 'init-lola)
(require 'handwriting)

View File

@ -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