diff --git a/emacs/init.org b/emacs/init.org index 33d0f26..b5187aa 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -309,6 +309,14 @@ The same function but for commands that need to run in a shell: (buffer-substring-no-properties (point-min) (point-max)))))) #+END_SRC +Running a shell command as sudo: +#+BEGIN_SRC emacs-lisp + (defun sudo-shell-command (command) + (with-temp-buffer + (cd "/sudo::/") + (shell-command command))) +#+END_SRC + * Customization File I don't want anything to write to my init.el, so save customizations in a separate file: #+BEGIN_SRC emacs-lisp @@ -2857,6 +2865,12 @@ The aws-mfa command: (leader-def-key "ao" #'op-copy-password) #+END_SRC +** Resetting DNSResponder +#+BEGIN_SRC emacs-lisp + (defun reset-dnsresponsder () + (interactive) + (sudo-shell-command "killall -HUP mDNSResponder")) +#+END_SRC * StumpWM A handy keybinding to connect to the StumpWM SBCL process via SLIME: #+BEGIN_SRC emacs-lisp