From df4e5f1eb9f9d523555d7c7cb51b3d32ba09c6bb Mon Sep 17 00:00:00 2001 From: Ken Fallon Date: Wed, 26 Jul 2023 06:49:25 +0200 Subject: [PATCH] database changed --- sql/hpr.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/hpr.sql b/sql/hpr.sql index cdf48d9..995f3f2 100644 --- a/sql/hpr.sql +++ b/sql/hpr.sql @@ -19978,7 +19978,9 @@ INSERT INTO `eps` (`id`, `date`, `title`, `duration`, `summary`, `notes`, `hosti (3905,'2023-07-21','Presenting Fred Black',1105,'I have a short talk to present Fred Black.','\n',309,0,0,'CC-BY-SA','school,podcasts,instrument,quiz',0,0,1), (3906,'2023-07-24','The Oh No! News.',1741,'Sgoti discusses the threat of convenience.','

The Oh No! news.

\n

Oh No! News is Good\nNews.

\n\n
\n

InfoSec; the language\nof security.

\n\n
\n\n
\n\n',391,74,0,'CC-BY-SA','Oh No News, InfoSec, browser security, session tokens, session id',0,0,1); INSERT INTO `eps` (`id`, `date`, `title`, `duration`, `summary`, `notes`, `hostid`, `series`, `explicit`, `license`, `tags`, `version`, `downloads`, `valid`) VALUES (3908,'2023-07-26','Emacs package curation, part 2',667,'Let\'s go through every single package installed in my Emacs configuration. File 2 of 3.','

We discuss the packages installed in the second of three files that\nmake up my emacs config.

\n
;;; init-base.el ---  The basics\n;;; Commentary:\n;;; Packages for my personal and work laptop, but not termux.\n\n;;; Code:\n\n;;;;;;;;;;;;;;;\n;;; Writing ;;;\n;;;;;;;;;;;;;;;\n\n;; Focused writing mode\n(use-package olivetti\n  :hook (olivetti-mode . typewriter-mode-toggle)\n  :bind ("C-x C-w" . olivetti-mode)\n  :custom (olivetti-body-width 64)\n  :config\n      (defvar-local typewriter-mode nil\n      "Typewriter mode, automatically scroll down to keep cursor in\n      the middle of the screen. Setting this variable explicitly will\n      not do anything, use typewriter-mode-on, typewriter-mode-off\n      and typewriter-mode-toggle instead.")\n      (defun typewriter-mode-on()\n      "Automatically scroll down to keep cursor in the middle of screen."\n        (interactive)\n        (setq-local typewriter-mode t)\n        (centered-cursor-mode +1))\n      (defun typewriter-mode-off()\n      "Automatically scroll down to keep cursor in the middle of screen."\n        (interactive)\n        (kill-local-variable 'typewriter-mode)\n        (centered-cursor-mode -1))\n      (defun typewriter-mode-toggle()\n        "Toggle typewriter scrolling mode on and off."\n        (interactive)\n        (if typewriter-mode (typewriter-mode-off) (typewriter-mode-on))))\n\n(use-package centered-cursor-mode)\n\n;; Check for weasel words and some other simple rules\n(use-package writegood-mode\n  :bind ("C-c g" . writegood-mode))\n\n;; spellchecking\n(use-package flyspell-correct\n  :after flyspell\n  :bind (:map flyspell-mode-map\n              ("C-;" . flyspell-correct-wrapper)))\n\n;; show correction options in a popup instead of the minibuffer\n(use-package flyspell-correct-popup\n  :after (flyspell-correct))\n\n;online thesaurus service from powerthesaurus.org\n(use-package powerthesaurus)\n\n;; WordNet Thesaurus replacement\n(use-package synosaurus\n  :custom (synosaurus-choose-method 'default)\n  :config (when window-system\n            (if (string= (x-server-vendor) "Microsoft Corp.")\n              (setq synosaurus-wordnet--command "C:\\\\Program Files (x86)\\\\WordNet\\\\2.1\\\\bin\\\\wn.exe"))))\n\n;; WordNet search and view\n(use-package wordnut\n  :bind ("C-c s" . wordnut-search)\n  :config (when window-system\n            (if (string= (x-server-vendor) "Microsoft Corp.")\n                (setq wordnut-cmd "C:\\\\Program Files (x86)\\\\WordNet\\\\2.1\\\\bin\\\\wn.exe"))))\n\n;; fill and unfill with the same key\n(use-package unfill\n  :bind ("M-q" . unfill-toggle))\n\n;; Markdown...\n(use-package markdown-mode)\n\n;;;;;;;;;;;;;;\n;;; Coding ;;;\n;;;;;;;;;;;;;;\n\n;; Syntax checking\n(use-package flycheck\n  :diminish\n  :init (global-flycheck-mode))\n\n(use-package flycheck-popup-tip\n  :after (flycheck)\n  :hook (flycheck-mode-hook . flycheck-popup-tip-mode))\n\n;; Web design\n(use-package emmet-mode\n  :hook (sgml-mode . emmet-mode) ;; Auto-start on any markup modes\n        (css-mode . emmet-mode)) ;; enable Emmet's css abbreviation.\n\n(use-package sass-mode)\n\n(use-package web-mode)\n\n;; Python\n(use-package python\n  :mode ("\\\\.py\\\\'" . python-mode)\n  :interpreter ("python" . python-mode))\n\n;; highlight todo items everywhere\n(use-package hl-todo\n  :straight (:host github :repo "tarsius/hl-todo")\n  :custom (hl-todo-keyword-faces\n             `(("FIXME" error bold)\n             ("STUB" error bold)\n             ("REPLACETHIS" error bold)\n             ("REVISIT" error bold)))\n          (hl-todo-exclude-modes nil)\n  :config (add-to-list 'hl-todo-include-modes 'org-mode)\n  :init (global-hl-todo-mode))\n\n;; git\n(use-package magit)\n\n(use-package git-timemachine)\n\n;; rest APIs via org source block\n(use-package ob-restclient)\n\n;;; END ;;;\n\n(provide 'init-base)\n;;; init-base.el ends here
\n',399,0,0,'CC-BY-SA','emacs,elisp',0,0,1), -(3918,'2023-08-09','Emacs package curation, part 3',864,'Let\'s go through every single package installed in my Emacs configuration. The last one.','

We discuss the packages installed in the second of three files that\nmake up my emacs config.

\n

Since recording, I pulled in some EXWM (the Emacs X Window Manager,\nthat\'s right), even though I\'m not actually using it, I\'m still using\nstumpWM.

\n

I have also added pass, the password manager, khardel, an emacs\npackage for the khard CLI address book application.

\n

I also moved (server-start) to this file, so that it\'ll only happen\nwhen I\'m on linux.

\n
;;; init-extra.el --- Extra init stuff\n;;; Commentary:\n;;; Stuff just for my personal laptop, not for my work laptop or termux, for example.\n\n;;; Code:\n\n;;;;;;;;;;;;;;;;\n;;; org-roam ;;;\n;;;;;;;;;;;;;;;;\n\n(use-package org-roam\n  :demand t\n  :straight (:host github :repo "org-roam/org-roam"\n             :files (:defaults "extensions/*"))\n  :custom (org-roam-mode-sections (list #'org-roam-backlinks-section\n                                        #'org-roam-reflinks-section\n                                        #'org-roam-unlinked-references-section))\n  :init (setq org-roam-directory "~/org/roam/"\n              org-roam-capture-templates\n                 '(("o" "outline" plain\n                     "%?"\n                     :if-new\n                     (file+head "${slug}.org" "#+title: ${title}\\n#+filetags: :outline:\\n")\n                     :immediate-finish t\n                     :unnarrowed t)\n                  ("r" "reference" plain "%?"\n                     :if-new\n                     (file+head "${slug}.org" "#+title: ${title}\\n")\n                     :immediate-finish t\n                     :unnarrowed t)\n                  ("m" "memo" entry "* ${title}\\n%?"\n                     :if-new\n                     (file "memos.org")\n                     :immediate-finish t\n                     :unnarrowed t)))\n  :bind (("C-c n l" . org-roam-buffer-toggle)\n         ("C-c n f" . org-roam-node-find)\n         ("C-c n g" . org-roam-graph)\n         ("C-c n i" . org-roam-node-insert)\n         ("C-c n c" . org-roam-capture)\n         ;; Dailies\n         ("C-c n j" . org-roam-dailies-capture-today))\n  :config\n  ;; If you're using a vertical completion framework, you might want a more informative completion interface\n  (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))\n  (org-roam-db-autosync-mode)\n  ;; If using org-roam-protocol\n  (require 'org-roam-protocol))\n\n;; citations\n(use-package citar\n  :after org-roam\n  :custom (org-cite-insert-processor 'citar)\n          (org-cite-follow-processor 'citar)\n          (org-cite-activate-processor 'citar)\n          (citar-bibliography '("~/org/biblio.bib"))\n          (citar-notes-paths '("~/org/roam"))\n          (citar-file-note-extensions '("org"))\n  :hook (LaTeX-mode . citar-capf-setup)\n        (org-mode . citar-capf-setup)\n  :bind (("C-c n b" . #'citar-open-notes)\n          :map org-mode-map :package org\n          ("C-c b" . #'org-cite-insert)))\n\n;; view your org-roam notes on a map\n(use-package org-roam-ui\n  :after org-roam\n  :custom (org-roam-ui-sync-theme t)\n          (org-roam-ui-follow t)\n          (org-roam-ui-update-on-save t)\n          (org-roam-ui-open-on-start t))\n\n;; archive web pages in org attachments\n(use-package org-board\n  :after org\n  :custom (org-board-default-browser #'browse-url)\n          (org-board-property "ROAM_REFS")\n  :bind (:map org-mode-map\n          ("C-c B a" . org-board-archive)\n          ("C-c B o" . org-board-open)\n          ("C-c B D" . org-board-delete-all)))\n\n;;;;;;;;;;;;;;;\n;;; Writing ;;;\n;;;;;;;;;;;;;;;\n\n; something like grammarly, but open source\n(use-package langtool)\n\n;; better than docview, for pdf\n(use-package pdf-tools)\n\n;; annotating docs in org files\n(use-package org-noter)\n\n;; epub\n(use-package nov\n :mode ("\\\\.epub$" . nov-mode))\n\n;;; Invoke quick emacs windows to edit anything anywhere.\n;;; bind a key in xorg to ~emacsclient -c (emacs-everywhere)~\n(use-package emacs-everywhere)\n\n;;;;;;;;;;;;;;\n;;; Auctex ;;;\n;;;;;;;;;;;;;;\n(straight-use-package '( auctex\n  :host nil :repo "https://git.savannah.gnu.org/git/auctex.git"\n  :pre-build (("./autogen.sh")\n                  ("./configure" "--without-texmf-dir" "--with-lispdir=.")\n                  ("make"))))\n\n  (setq TeX-data-directory (expand-file-name "straight/repos/auctex" user-emacs-directory)\n      TeX-lisp-directory TeX-data-directory)\n\n  (eval-after-load 'info\n      '(add-to-list 'Info-additional-directory-list\n          (expand-file-name "straight/repos/auctex/doc" user-emacs-directory)))\n  (load (expand-file-name "straight/repos/auctex/auctex.el" user-emacs-directory) nil t t)\n  (load (expand-file-name "straight/repos/auctex/preview-latex.el" user-emacs-directory) nil t t)\n\n(use-package evil-tex)\n\n(use-package latex-preview-pane\n  :custom (latex-preview-pane-use-frame t))\n\n(use-package adaptive-wrap)\n\n;;; END AUCTEX ;;;\n\n;;;;;;;;;;;;;;;;;;;\n;;; Programming ;;;\n;;;;;;;;;;;;;;;;;;;\n\n;; downloading and viewing Dash documentation files\n(use-package dash-docs\n  :init (defun elisp-doc ()\n            (setq-local consult-dash-docsets '("Emacs Lisp")))\n        (add-hook 'emacs-lisp-mode-hook 'elisp-doc)\n  :custom (dash-docs-docsets-path (expand-file-name "docsets" user-emacs-directory))\n          (dash-docs-browse-func 'eww))\n\n(use-package consult-dash\n  :straight (:host codeberg :repo "rahguzar/consult-dash")\n  :bind (("M-s d" . consult-dash))\n  :after consult\n  :config\n  ;; Use the symbol at point as initial search term\n  (consult-customize consult-dash :initial (thing-at-point 'symbol)))\n\n;;;;;;;;;;;;;\n;;; Email ;;;\n;;;;;;;;;;;;;\n\n(use-package notmuch\n  :commands notmuch\n  :config (defun notmuch-show-view-html ()\n            "Open the text/html part of the current message using\n            `notmuch-show-view-part'. From https://emacs.stackexchange.com/a/63457"\n            (interactive)\n            (save-excursion\n                (goto-char (prop-match-beginning\n                            (text-property-search-forward\n                            :notmuch-part "text/html"\n                            (lambda (value notmuch-part)\n                                (equal (plist-get notmuch-part :content-type)\n                            value)))))\n            (notmuch-show-view-part)))\n          ;; Enable link to message via org-store-link\n          (load-file (expand-file-name "org-notmuch.el" user-emacs-directory))\n          (require 'org-notmuch)\n  :bind (:map notmuch-show-mode-map\n              (". v" . notmuch-show-view-html))\n  :custom (notmuch-draft-folder "local/drafts")\n          (notmuch-search-oldest-first nil)\n          (notmuch-fcc-dirs "fastmail/sent")\n          (notmuch-tagging-keys '(("r" ("+receipt" "-inbox") "Receipt")))\n          (sendmail-program (executable-find "msmtp"))\n          (message-sendmail-f-is-evil t)\n          (message-sendmail-extra-arguments '("--read-envelope-from")))\n\n(use-package khardel\n  :after notmuch\n  :bind (:map notmuch-message-mode-map\n         ("C-c M-k" . khardel-insert-email)))\n\n;;;;;;;;;;;;\n;;; PASS ;;;\n;;;;;;;;;;;;\n\n(use-package pass)\n\n;;;;;;;;;;;;\n;;; EXWM ;;;\n;;;;;;;;;;;;\n\n(use-package xelb\n  :disabled t\n  :straight (:host github :repo "ch11ng/xelb"))\n\n(use-package exwm\n  :disabled t\n  :straight (:host github :repo "ch11ng/exwm")\n  :defer t\n  :config (require 'exwm-systemtray)\n          (require 'exwm-randr)\n          (setq xcb:connection-timeout 20)\n          (exwm-systemtray-enable)\n          (add-hook 'exwm-update-class-hook\n                  (lambda ()\n                  (exwm-workspace-rename-buffer exwm-class-name)))\n          (add-hook 'exwm-randr-screen-change-hook\n                    (lambda ()\n                      (start-process-shell-command\n                       "autorandr" nil "autorandr -c")))\n          (defun exwm-randr-mobile()\n          "Load a xrandr profile to use only the laptop screen."\n          (interactive)\n          (start-process-shell-command "xrandr" nil "xrandr --output eDP-1 --auto --output DP-1 --off"))\n          (defun exwm-randr-docked()\n          "Load a xrandr profile to use only the connected external screen DP-1."\n          (interactive)\n          (start-process-shell-command "xrandr" nil "xrandr --output eDP-1 --off --output DP-1 --auto"))\n          (defun exwm-randr-chair()\n          "Load a xrandr profile to use both the laptop screen and the connected screen."\n          (interactive)\n          (start-process-shell-command "xrandr" nil "xrandr --output HDMI-1 --auto --scale 1.3 --output eDP-1 --off"))\n          (defun exwm-randr-all()\n          "Load a xrandr profile to use both the laptop screen and the connected screen."\n          (interactive)\n          (start-process-shell-command "xrandr" nil "xrandr --output eDP-1 --primary --output DP-1 --above eDP-1")\n          (setq exwm-randr-workspace-output-plist '(0 "eDP-1" 1 "DP-1"))\n          )\n          (exwm-randr-enable)\n    :custom (exwm-input-global-keys\n              `((,(kbd "s-r") . exwm-reset)\n                (,(kbd "s-w") . exwm-workspace-switch)\n                (,(kbd "s-a") . exwm-randr-all)\n                (,(kbd "s-c") . exwm-randr-chair)\n                (,(kbd "s-d") . exwm-randr-docked)\n                (,(kbd "s-m") . exwm-randr-mobile)\n                (,(kbd "s-k") . exwm-input-release-keyboard)\n                (,(kbd "s-f") . exwm-layout-toggle-fullscreen)\n                (,(kbd "s-p") . pass)\n                (,(kbd "s-t") . exwm-workspace-switch-to-buffer)\n                (,(kbd "s-&") . (lambda (command)\n                                       (interactive (list (read-shell-command "$ ")))\n                                       (start-process-shell-command command nil command)))\n                ,@(mapcar (lambda (i)\n                       `(,(kbd (format "s-%d" i)) .\n                           (lambda ()\n                               (interactive)\n                               (exwm-workspace-switch-create ,i))))\n                     (number-sequence 0 9))\n                ))\n          )\n\n;; start emacs server\n(server-start)\n\n;;; END ;;;\n\n(provide 'init-extra)\n;;; init-extra.el ends here
\n',399,0,0,'CC-BY-SA','emacs,elisp',0,0,1); +(3918,'2023-08-09','Emacs package curation, part 3',864,'Let\'s go through every single package installed in my Emacs configuration. The last one.','

We discuss the packages installed in the second of three files that\nmake up my emacs config.

\n

Since recording, I pulled in some EXWM (the Emacs X Window Manager,\nthat\'s right), even though I\'m not actually using it, I\'m still using\nstumpWM.

\n

I have also added pass, the password manager, khardel, an emacs\npackage for the khard CLI address book application.

\n

I also moved (server-start) to this file, so that it\'ll only happen\nwhen I\'m on linux.

\n
;;; init-extra.el --- Extra init stuff\n;;; Commentary:\n;;; Stuff just for my personal laptop, not for my work laptop or termux, for example.\n\n;;; Code:\n\n;;;;;;;;;;;;;;;;\n;;; org-roam ;;;\n;;;;;;;;;;;;;;;;\n\n(use-package org-roam\n  :demand t\n  :straight (:host github :repo "org-roam/org-roam"\n             :files (:defaults "extensions/*"))\n  :custom (org-roam-mode-sections (list #'org-roam-backlinks-section\n                                        #'org-roam-reflinks-section\n                                        #'org-roam-unlinked-references-section))\n  :init (setq org-roam-directory "~/org/roam/"\n              org-roam-capture-templates\n                 '(("o" "outline" plain\n                     "%?"\n                     :if-new\n                     (file+head "${slug}.org" "#+title: ${title}\\n#+filetags: :outline:\\n")\n                     :immediate-finish t\n                     :unnarrowed t)\n                  ("r" "reference" plain "%?"\n                     :if-new\n                     (file+head "${slug}.org" "#+title: ${title}\\n")\n                     :immediate-finish t\n                     :unnarrowed t)\n                  ("m" "memo" entry "* ${title}\\n%?"\n                     :if-new\n                     (file "memos.org")\n                     :immediate-finish t\n                     :unnarrowed t)))\n  :bind (("C-c n l" . org-roam-buffer-toggle)\n         ("C-c n f" . org-roam-node-find)\n         ("C-c n g" . org-roam-graph)\n         ("C-c n i" . org-roam-node-insert)\n         ("C-c n c" . org-roam-capture)\n         ;; Dailies\n         ("C-c n j" . org-roam-dailies-capture-today))\n  :config\n  ;; If you're using a vertical completion framework, you might want a more informative completion interface\n  (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))\n  (org-roam-db-autosync-mode)\n  ;; If using org-roam-protocol\n  (require 'org-roam-protocol))\n\n;; citations\n(use-package citar\n  :after org-roam\n  :custom (org-cite-insert-processor 'citar)\n          (org-cite-follow-processor 'citar)\n          (org-cite-activate-processor 'citar)\n          (citar-bibliography '("~/org/biblio.bib"))\n          (citar-notes-paths '("~/org/roam"))\n          (citar-file-note-extensions '("org"))\n  :hook (LaTeX-mode . citar-capf-setup)\n        (org-mode . citar-capf-setup)\n  :bind (("C-c n b" . #'citar-open-notes)\n          :map org-mode-map :package org\n          ("C-c b" . #'org-cite-insert)))\n\n;; view your org-roam notes on a map\n(use-package org-roam-ui\n  :after org-roam\n  :custom (org-roam-ui-sync-theme t)\n          (org-roam-ui-follow t)\n          (org-roam-ui-update-on-save t)\n          (org-roam-ui-open-on-start t))\n\n;; archive web pages in org attachments\n(use-package org-board\n  :after org\n  :custom (org-board-default-browser #'browse-url)\n          (org-board-property "ROAM_REFS")\n  :bind (:map org-mode-map\n          ("C-c B a" . org-board-archive)\n          ("C-c B o" . org-board-open)\n          ("C-c B D" . org-board-delete-all)))\n\n;;;;;;;;;;;;;;;\n;;; Writing ;;;\n;;;;;;;;;;;;;;;\n\n; something like grammarly, but open source\n(use-package langtool)\n\n;; better than docview, for pdf\n(use-package pdf-tools)\n\n;; annotating docs in org files\n(use-package org-noter)\n\n;; epub\n(use-package nov\n :mode ("\\\\.epub$" . nov-mode))\n\n;;; Invoke quick emacs windows to edit anything anywhere.\n;;; bind a key in xorg to ~emacsclient -c (emacs-everywhere)~\n(use-package emacs-everywhere)\n\n;;;;;;;;;;;;;;\n;;; Auctex ;;;\n;;;;;;;;;;;;;;\n(straight-use-package '( auctex\n  :host nil :repo "https://git.savannah.gnu.org/git/auctex.git"\n  :pre-build (("./autogen.sh")\n                  ("./configure" "--without-texmf-dir" "--with-lispdir=.")\n                  ("make"))))\n\n  (setq TeX-data-directory (expand-file-name "straight/repos/auctex" user-emacs-directory)\n      TeX-lisp-directory TeX-data-directory)\n\n  (eval-after-load 'info\n      '(add-to-list 'Info-additional-directory-list\n          (expand-file-name "straight/repos/auctex/doc" user-emacs-directory)))\n  (load (expand-file-name "straight/repos/auctex/auctex.el" user-emacs-directory) nil t t)\n  (load (expand-file-name "straight/repos/auctex/preview-latex.el" user-emacs-directory) nil t t)\n\n(use-package evil-tex)\n\n(use-package latex-preview-pane\n  :custom (latex-preview-pane-use-frame t))\n\n(use-package adaptive-wrap)\n\n;;; END AUCTEX ;;;\n\n;;;;;;;;;;;;;;;;;;;\n;;; Programming ;;;\n;;;;;;;;;;;;;;;;;;;\n\n;; downloading and viewing Dash documentation files\n(use-package dash-docs\n  :init (defun elisp-doc ()\n            (setq-local consult-dash-docsets '("Emacs Lisp")))\n        (add-hook 'emacs-lisp-mode-hook 'elisp-doc)\n  :custom (dash-docs-docsets-path (expand-file-name "docsets" user-emacs-directory))\n          (dash-docs-browse-func 'eww))\n\n(use-package consult-dash\n  :straight (:host codeberg :repo "rahguzar/consult-dash")\n  :bind (("M-s d" . consult-dash))\n  :after consult\n  :config\n  ;; Use the symbol at point as initial search term\n  (consult-customize consult-dash :initial (thing-at-point 'symbol)))\n\n;;;;;;;;;;;;;\n;;; Email ;;;\n;;;;;;;;;;;;;\n\n(use-package notmuch\n  :commands notmuch\n  :config (defun notmuch-show-view-html ()\n            "Open the text/html part of the current message using\n            `notmuch-show-view-part'. From https://emacs.stackexchange.com/a/63457"\n            (interactive)\n            (save-excursion\n                (goto-char (prop-match-beginning\n                            (text-property-search-forward\n                            :notmuch-part "text/html"\n                            (lambda (value notmuch-part)\n                                (equal (plist-get notmuch-part :content-type)\n                            value)))))\n            (notmuch-show-view-part)))\n          ;; Enable link to message via org-store-link\n          (load-file (expand-file-name "org-notmuch.el" user-emacs-directory))\n          (require 'org-notmuch)\n  :bind (:map notmuch-show-mode-map\n              (". v" . notmuch-show-view-html))\n  :custom (notmuch-draft-folder "local/drafts")\n          (notmuch-search-oldest-first nil)\n          (notmuch-fcc-dirs "fastmail/sent")\n          (notmuch-tagging-keys '(("r" ("+receipt" "-inbox") "Receipt")))\n          (sendmail-program (executable-find "msmtp"))\n          (message-sendmail-f-is-evil t)\n          (message-sendmail-extra-arguments '("--read-envelope-from")))\n\n(use-package khardel\n  :after notmuch\n  :bind (:map notmuch-message-mode-map\n         ("C-c M-k" . khardel-insert-email)))\n\n;;;;;;;;;;;;\n;;; PASS ;;;\n;;;;;;;;;;;;\n\n(use-package pass)\n\n;;;;;;;;;;;;\n;;; EXWM ;;;\n;;;;;;;;;;;;\n\n(use-package xelb\n  :disabled t\n  :straight (:host github :repo "ch11ng/xelb"))\n\n(use-package exwm\n  :disabled t\n  :straight (:host github :repo "ch11ng/exwm")\n  :defer t\n  :config (require 'exwm-systemtray)\n          (require 'exwm-randr)\n          (setq xcb:connection-timeout 20)\n          (exwm-systemtray-enable)\n          (add-hook 'exwm-update-class-hook\n                  (lambda ()\n                  (exwm-workspace-rename-buffer exwm-class-name)))\n          (add-hook 'exwm-randr-screen-change-hook\n                    (lambda ()\n                      (start-process-shell-command\n                       "autorandr" nil "autorandr -c")))\n          (defun exwm-randr-mobile()\n          "Load a xrandr profile to use only the laptop screen."\n          (interactive)\n          (start-process-shell-command "xrandr" nil "xrandr --output eDP-1 --auto --output DP-1 --off"))\n          (defun exwm-randr-docked()\n          "Load a xrandr profile to use only the connected external screen DP-1."\n          (interactive)\n          (start-process-shell-command "xrandr" nil "xrandr --output eDP-1 --off --output DP-1 --auto"))\n          (defun exwm-randr-chair()\n          "Load a xrandr profile to use both the laptop screen and the connected screen."\n          (interactive)\n          (start-process-shell-command "xrandr" nil "xrandr --output HDMI-1 --auto --scale 1.3 --output eDP-1 --off"))\n          (defun exwm-randr-all()\n          "Load a xrandr profile to use both the laptop screen and the connected screen."\n          (interactive)\n          (start-process-shell-command "xrandr" nil "xrandr --output eDP-1 --primary --output DP-1 --above eDP-1")\n          (setq exwm-randr-workspace-output-plist '(0 "eDP-1" 1 "DP-1"))\n          )\n          (exwm-randr-enable)\n    :custom (exwm-input-global-keys\n              `((,(kbd "s-r") . exwm-reset)\n                (,(kbd "s-w") . exwm-workspace-switch)\n                (,(kbd "s-a") . exwm-randr-all)\n                (,(kbd "s-c") . exwm-randr-chair)\n                (,(kbd "s-d") . exwm-randr-docked)\n                (,(kbd "s-m") . exwm-randr-mobile)\n                (,(kbd "s-k") . exwm-input-release-keyboard)\n                (,(kbd "s-f") . exwm-layout-toggle-fullscreen)\n                (,(kbd "s-p") . pass)\n                (,(kbd "s-t") . exwm-workspace-switch-to-buffer)\n                (,(kbd "s-&") . (lambda (command)\n                                       (interactive (list (read-shell-command "$ ")))\n                                       (start-process-shell-command command nil command)))\n                ,@(mapcar (lambda (i)\n                       `(,(kbd (format "s-%d" i)) .\n                           (lambda ()\n                               (interactive)\n                               (exwm-workspace-switch-create ,i))))\n                     (number-sequence 0 9))\n                ))\n          )\n\n;; start emacs server\n(server-start)\n\n;;; END ;;;\n\n(provide 'init-extra)\n;;; init-extra.el ends here
\n',399,0,0,'CC-BY-SA','emacs,elisp',0,0,1), +(3909,'2023-07-27','Permission tickets. ',688,'Collective delusions of elective conclusions. ','

No special knowledge nor resources.
\nThis is a preview show for some future, self referential tangle of\ncryptographic distraction.

\n

So far, I see money as some social credit by proxy.
\nI recognise the utility of keeping track of resource recipes.
\nI also see dangers in over abstracting relations beyond robustly\nprovable outcomes.

\n',398,0,1,'CC-BY-SA','ledger , cryptographic , consensus , permission , integrity ',0,0,0), +(3911,'2023-07-31','An overview of the \'ack\' command',1255,'A Perl-based \'grep\'-like tool that can search by file type','
\n

Introduction

\n

I have occasionally been using a tool called ack for a\nfew years now. It’s billed as “an alternative to grep for\nprogrammers”.

\n

There are several features I find particularly useful:

\n\n

It is a very comprehensive and useful tool, though maybe quite\ncomplex to use. Personally I use it in special cases where I need its\npower, and otherwise use the usual grep.

\n

In this episode I will give you the flavour of its capabilities and\notherwise leave you to research more if it sounds interesting.

\n

Installing ack

\n

The tool can be found in repositories. I use Debian, and\nack is in the Debian repo and can be installed with:

\n
sudo apt install ack
\n

Installing it this way the version I have (and am describing here) is\n3.6.0. There is a new version, 3.7.0 available from the website.

\n

The documentation on the website suggests installing it as a Perl\nmodule using CPAN, which is something I will do soon I\nthink.

\n

Perl regular expressions

\n

These are very sophisticated.

\n

A project to convert the Perl regular expression capabilities into a\nportable library form was undertaken by Philip Hazel of Cambridge\nUniversity in 1997, and was called Perl Compatible Regular\nExpressions or PCRE.

\n

Philip Hazel was the originator of the exim mail\ntransfer agent (MTA, or mail server), and wanted to use PCRE within\nit.

\n

Since then PCRE (and later PCRE2) is the way regular expressions are\nimplemented in a lot of other software, which shows how widespread use\nof the Perl RE has become.

\n

The ack documentation refers to the Perl manual for\ndetails of this type of regular expression, and to a tutorial, if you\nwish to gain a deeper understanding.

\n

It should be noted that GNU grep can use Perl compatible\nregular expressions when matching lines in files, but this feature is\nmarked as experimental.

\n

File types

\n

The ack command has rules for recognising file types. It\ndoes this by looking at the name extensions (\'.html\' or\n\'.py\' for example), and in some cases by examining their\ncontents. The complete list of types can be found by running:

\n
ack --help-types
\n

… or, for a more detailed but less readable list:

\n
ack --dump
\n

Some examples are:

\n\n

These names can be used with the options -t TYPE and\n--type=TYPE and also by simply preceding them with two\ndashes (--TYPE). There are also ways of requesting files\nnot of a given type: -T TYPE, --type=noTYPE\nand --noTYPE.

\n

To check files in the current directory of type shell an\nack command like the following might be used and the\nfollowing type of output produced:

\n
$ ack --shell declare\nBash_snippet__using_coproc_with_SQLite/examples/coproc_test.sh\n11:declare -a com=('date +%F' 'whoami' 'id' 'echo "$BASH_VERSION"'
\n

Note that ack reports the file path and numbered lines\nwithin it that match.

\n

You can add your own file types to ack. There is a\nconfiguration file called .ackrc in which new types can be\ndeclared. See below for more information.

\n

The file type feature is one that makes me use ack again\nand again.

\n

The .ackrc file

\n

This file contains “command-line options that are prepended to\nthe command line before processing”.

\n

It’s a useful way to add new types (or even modify existing\nones).

\n

It can be located in a number of places. Mine is\n~/.ackrc with other configuration files in my home\ndirectory.

\n

It’s possible to generate a new .ackrc with the option\n--create-ackrc. This saves all the default settings in the\nfile which makes it simple to adjust anything you need to change.

\n

As an example of a change, I have Markdown files with the extension\n.mkd. However, by default ack only recognises\n.md, and .markdown. To add .mkd\nto the list I can add one of the following to the\n.ackrc:

\n
# Either add `.mkd` to the list\n--type-add=markdown:ext:mkd\n# or replace the list with a new one\n--type-set=markdown:ext:md,mkd,markdown
\n

Note that lines beginning with # are comments. Note also\nthat --type-add and --type-set have to be\nfollowed by an = sign, not a space in this file.

\n

If you examine the settings with ack --dump you will see\nthe default command and the one you have added. If you use\nack --help-types you will see the new extension added to\nthe default list.

\n
markdown     .md .markdown; .mkd
\n

If I use this to search files in the directory where I keep my HPR\nepisodes I see:

\n
$ ack --markdown 'inner ear'\nHacking_my_inner_ear/hpr2109_full_shownotes.mkd\n24:became fascinated by the structure of the human [inner ear][2], and studied it\n28:The human inner ear performs two major functions:\n.\n.\n.
\n

Quick review of selected\nack options

\n

Usage

\n

The ack command is designed to be similar in as many\nrespects as possible to grep. The command is used in\ngeneral as follows:

\n
ack [OPTION]... PATTERN [FILES OR DIRECTORIES]
\n

The [OPTION] part denotes any options (some discussed\nbelow) and PATTERN is the PCRE search pattern. There are\nsome cases where this must be omitted - such as when files of a\nparticular type are being listed. See example 1 below for such a\ncase.

\n

In some cases a particular file is being searched, or all files in\ncertain directories, and that is what\n[FILES OR DIRECTORIES] denotes.

\n

The full documentation for ack can be seen with the\nusual man ack command, and also using\nack --man. There is also an option --help\nwhich gives a summary of all of the available options.

\n

Options

\n

There are many options specific to ack and some in\ncommon with grep, and we’ll look at just a few here:

\n\n

Examples

\n

1. Find all Markdown\nfiles in a directory

\n

Using the -f option:

\n
$ ack --markdown -f Nitecore_Tube_torch/\nNitecore_Tube_torch/README.mkd\nNitecore_Tube_torch/container.mkd\nNitecore_Tube_torch/index.mkd\nNitecore_Tube_torch/shownotes.mkd
\n

Using the -g option:

\n
$ ack -g '\.mkd$' Nitecore_Tube_torch/\nNitecore_Tube_torch/README.mkd\nNitecore_Tube_torch/container.mkd\nNitecore_Tube_torch/index.mkd\nNitecore_Tube_torch/shownotes.mkd
\n

2. Names\nof files that contain a match, with a match count

\n

Using the -l and -c options:

\n
$ ack --markdown -lci '\bear\b'\nHacking_my_inner_ear/hpr2109_full_shownotes.mkd:11\nHacking_my_inner_ear/shownotes.mkd:3\nAn_overview_of_the_ack_command/shownotes.mkd:6
\n

The sequence \'\b\' in Perl regular expressions is a\nboundary such as a word boundary. So the pattern is looking for the word\n\'ear\' as opposed to the characters \'ear\' (as\nin \'pearl\' for example).

\n

Note how the single-letter options -l, -c\nand -i can be concatenated.

\n

3. Searching for words in\na simpler way

\n

In example 2 the \b boundaries ensured the pattern\nmatched words rather than letter sequences. This can be simplified by\nusing the -w option:

\n
$ ack --markdown -lci -w 'ear'\nHacking_my_inner_ear/hpr2109_full_shownotes.mkd:11\nHacking_my_inner_ear/shownotes.mkd:3\nAn_overview_of_the_ack_command/shownotes.mkd:6
\n

Links

\n\n\n\n
\n',225,11,1,'CC-BY-SA','search,grep,regular expression,Perl',0,0,0); /*!40000 ALTER TABLE `eps` ENABLE KEYS */; UNLOCK TABLES; @@ -20898,4 +20900,4 @@ UNLOCK TABLES; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2023-07-25 6:59:02 +-- Dump completed on 2023-07-26 4:48:35