From bc3257729acdd2b8d1bb112cf70b94137ae69cae Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Fri, 26 Apr 2024 20:23:13 +0000 Subject: [PATCH] deploy: fe93b0adc9a9839ef40e79434c18e57e6b0f2c38 --- 404.html | 3 + _cv/index.html | 3 + categories/index.html | 3 + categories/index.xml | 2 +- configs/console/index.html | 3 + configs/desktop/index.html | 13 ++- configs/emacs/index.html | 137 ++++++++++++++++++++----- configs/guix/index.html | 3 + configs/index.html | 3 + configs/index.xml | 2 +- configs/mail/index.html | 7 ++ configs/readme/index.html | 3 + emacs-packages/index.html | 3 + index.html | 5 +- packages/avy-dired/index.html | 3 + packages/biome/index.html | 3 + packages/elfeed-summary/index.html | 3 + packages/elfeed-sync/index.html | 3 + packages/eshell-atuin/index.html | 3 + packages/exwm-modeline/index.html | 3 + packages/index.html | 3 + packages/lyrics-fetcher/index.html | 3 + packages/micromamba/index.html | 3 + packages/org-clock-agg/index.html | 3 + packages/org-journal-tags/index.html | 3 + packages/password-store-ivy/index.html | 3 + packages/perspective-exwm/index.html | 3 + packages/pomm/index.html | 3 + packages/reverso/index.html | 3 + posts/2021-02-27-gmail/index.html | 3 + posts/2021-05-01-org-python/index.html | 3 + posts/2021-09-07-emms/index.html | 3 + posts/2021-10-04-emacs-i3/index.html | 3 + posts/2022-01-03-exwm/index.html | 3 + posts/2022-02-12-literate/index.html | 3 + posts/2022-05-09-pdf/index.html | 3 + posts/2022-09-16-vosk/index.html | 3 + posts/2023-01-02-gource/index.html | 3 + posts/2023-04-13-emacs/index.html | 3 + posts/2023-11-11-index/index.html | 3 + posts/hello-world/index.html | 3 + posts/index.html | 3 + stats/all.png | Bin 122767 -> 122964 bytes stats/emacs-vim.png | Bin 62032 -> 62315 bytes stats/literate-config.png | Bin 69816 -> 67802 bytes tags/elfeed/index.html | 3 + tags/elfeed/index.xml | 2 +- tags/emacs/index.html | 3 + tags/emacs/index.xml | 2 +- tags/emms/index.html | 3 + tags/emms/index.xml | 2 +- tags/exwm/index.html | 3 + tags/exwm/index.xml | 2 +- tags/i3wm/index.html | 3 + tags/i3wm/index.xml | 2 +- tags/index.html | 3 + tags/index.xml | 20 ++-- tags/mail/index.html | 3 + tags/mail/index.xml | 2 +- tags/org-mode/index.html | 3 + tags/org-mode/index.xml | 2 +- tags/org/index.html | 3 + tags/org/index.xml | 2 +- tags/orgmode/index.html | 3 + tags/orgmode/index.xml | 2 +- 65 files changed, 296 insertions(+), 46 deletions(-) diff --git a/404.html b/404.html index 68435fe..a62ddc7 100644 --- a/404.html +++ b/404.html @@ -20,6 +20,9 @@ + + + diff --git a/_cv/index.html b/_cv/index.html index 410e609..ae610ff 100644 --- a/_cv/index.html +++ b/_cv/index.html @@ -20,6 +20,9 @@ + + + diff --git a/categories/index.html b/categories/index.html index 41abd28..73a6f3e 100644 --- a/categories/index.html +++ b/categories/index.html @@ -21,6 +21,9 @@ + + + diff --git a/categories/index.xml b/categories/index.xml index 37a4550..80c48cc 100644 --- a/categories/index.xml +++ b/categories/index.xml @@ -4,7 +4,7 @@ Categories on SqrtMinusOne https://sqrtminusone.xyz/categories/ Recent content in Categories on SqrtMinusOne - Hugo -- gohugo.io + Hugo en-us diff --git a/configs/console/index.html b/configs/console/index.html index d5e0c05..7d891f7 100644 --- a/configs/console/index.html +++ b/configs/console/index.html @@ -20,6 +20,9 @@ + + + diff --git a/configs/desktop/index.html b/configs/desktop/index.html index 5a56d43..b7064ab 100644 --- a/configs/desktop/index.html +++ b/configs/desktop/index.html @@ -20,6 +20,9 @@ + + + @@ -4336,6 +4339,13 @@ #:respawn? #t #:start (make-forkexec-constructor '("sudo" "opensnitch-ui")) #:stop (make-kill-destructor))) +

ollama

+
(define ollama
+  (make <service>
+    #:provides '(ollama)
+    #:respawn? #t
+    #:start (make-forkexec-constructor '("/home/pavel/bin/ollama" "serve"))
+    #:stop (make-kill-destructor)))
 

Shepherd config

For some reason, running start on a one-shot service started to hang shepherd, not sure why… Turining these off for now.

Register services:

@@ -4357,7 +4367,7 @@ vnstatd ;; opensnitchd ;; opensnitch-ui - ) + ollama)

Daemonize shepherd

(action 'shepherd 'daemonize)
 

Run services

@@ -4736,6 +4746,7 @@
  • Davmail
  • vnstatd
  • opensnitch
  • +
  • ollama
  • Shepherd config
  • diff --git a/configs/emacs/index.html b/configs/emacs/index.html index cb4b94f..dac23bb 100644 --- a/configs/emacs/index.html +++ b/configs/emacs/index.html @@ -20,6 +20,9 @@ + + + @@ -3369,7 +3372,7 @@ Emacs is also particularly great at writing Lisp code, e.g. Clojure, Common Lisp (unless (and (fboundp #'org-src-edit-buffer-p) (org-src-edit-buffer-p)) (py-isort-buffer)) (python-black-buffer)))) -

    sphinx-doc

    +

    OFF sphinx-doc

    A package to generate sphinx-compatible docstrings.

    (use-package sphinx-doc
       :straight t
    @@ -3378,6 +3381,18 @@ Emacs is also particularly great at writing Lisp code, e.g. Clojure, Common Lisp
       (my-leader-def
         :keymaps 'sphinx-doc-mode-map
         "rd" 'sphinx-doc))
    +

    numpydoc

    +

    numpydoc.el is a package to generate docstring in Python functions.

    +
    (use-package numpydoc
    +  :straight t
    +  :commands (numpydoc-generate)
    +  :init
    +  (my-leader-def
    +    :keymaps 'python-ts-mode-map
    +    "rd" #'numpydoc-generate)
    +  :config
    +  (setq numpydoc-insertion-style 'prompt)
    +  (setq numpydoc-insert-return-without-typehint nil))
     

    pytest

    pytest is a unit testing framework for Python.

    Once again a function to set pytest executable from pipenv.

    @@ -3799,27 +3814,29 @@ Emacs is also particularly great at writing Lisp code, e.g. Clojure, Common Lisp
    (with-eval-after-load-norem 'org
       (general-define-key
        :keymaps 'org-mode-map
    -   "C-c d" 'org-decrypt-entry
    -   "C-c e" 'org-encrypt-entry
    -   "M-p" 'org-latex-preview
    -   "M-o" 'org-redisplay-inline-images)
    +   "C-c d" #'org-decrypt-entry
    +   "C-c e" #'org-encrypt-entry
    +   "M-p" #'org-latex-preview
    +   "M-o" #'org-redisplay-inline-images)
     
       (general-define-key
        :keymaps 'org-mode-map
        :states '(normal emacs)
    -   "L" 'org-shiftright
    -   "H" 'org-shiftleft
    -   "S-<next>" 'org-next-visible-heading
    -   "S-<prior>" 'org-previous-visible-heading
    -   "M-0" 'org-next-visible-heading
    -   "M-9" 'org-previous-visible-heading
    -   "M-]" 'org-babel-next-src-block
    -   "M-[" 'org-babel-previous-src-block)
    +   "L" #'org-shiftright
    +   "H" #'org-shiftleft
    +   "S-<next>" #'org-next-visible-heading
    +   "S-<prior>" #'org-previous-visible-heading
    +   "M-0" #'org-next-visible-heading
    +   "M-9" #'org-previous-visible-heading
    +   "C-0" #'org-forward-heading-same-level
    +   "C-9" #'org-backward-heading-same-level
    +   "M-]" #'org-babel-next-src-block
    +   "M-[" #'org-babel-previous-src-block)
     
       (general-define-key
        :keymaps 'org-agenda-mode-map
    -   "M-]" 'org-agenda-later
    -   "M-[" 'org-agenda-earlier)
    +   "M-]" #'org-agenda-later
    +   "M-[" #'org-agenda-earlier)
     
       (general-nmap :keymaps 'org-mode-map "RET" 'org-ctrl-c-ctrl-c))
     
    @@ -3921,6 +3938,13 @@ Emacs is also particularly great at writing Lisp code, e.g. Clojure, Common Lisp "Refresh Jupyter languages" (interactive) (org-babel-jupyter-aliases-from-kernelspecs t)) +

    A function to load jupyter. The problem with doing that on startup is that it tried to locate the jupyter executable, which I have only in an environment.

    +
    (defun my/org-load-jupyter ()
    +  (interactive)
    +  (org-babel-do-load-languages
    +   'org-babel-load-languages
    +   '((jupyter . t)))
    +  (my/jupyter-refesh-langs))
     

    Hy

    (use-package ob-hy
       :after (org)
    @@ -3991,7 +4015,6 @@ Emacs is also particularly great at writing Lisp code, e.g. Clojure, Common Lisp
          (shell . t)
          (plantuml . t)
          (octave . t)
    -     ,@(unless my/is-termux '((jupyter . t)))
          (sparql . t)
          (gnuplot . t)))
     
    @@ -4943,7 +4966,18 @@ Emacs is also particularly great at writing Lisp code, e.g. Clojure, Common Lisp
     
  • Me at 15:05: Sh*t
  • Okay, I will set up org-alert some custom alert system.

    -

    I want to have multiple warnings, let it be 10 minutes in advance and 1 minute in advance for now.

    +

    There’s also org-yaap by Amy Grinn, but I opt for my system for now.

    +
    (use-package org-yaap
    +  :straight (org-yaap :type git :host gitlab :repo "SqrtMinusOne/org-yaap")
    +  :after (org)
    +  :if (not my/nested-emacs)
    +  :disabled t
    +  :config
    +  (org-yaap-mode 1)
    +  (setq org-yaap-alert-before '(10 1))
    +  (setq org-yaap-alert-title "PROXIMITY ALERT")
    +  (setq org-yaap-todo-keywords-only '("FUTURE")))
    +

    I want to have multiple warnings, let it be 10 minutes in advance and 1 minute in advance for now.

    (setq my/org-alert-notify-times '(600 60))
     

    And IDK if that makes much sense, but I’ll try to avoid re-creating timers. So, here are functions to schedule showing some label at some time and to check whether the label is scheduled:

    (setq my/org-alert--alerts (make-hash-table :test #'equal))
    @@ -7709,7 +7743,7 @@ Didn’t work out as I expected, so I’ve made org-journal-tagsRunning it from Emacs
     

    Running the program from Emacs is rather straightforward with asyncronous processes.

    I’m using an English-language-only model because that’s the only language I need at the moment.

    -
    (defun my/invoke-whisper--direct (input output-dir remove-wav)
    +
    (defun my/invoke-whisper--direct (input output-dir &optional remove-wav)
       "Extract subtitles from a WAV audio file.
     
     INPUT is the absolute path to audio file, OUTPUT-DIR is the path to
    @@ -7718,8 +7752,8 @@ Didn’t work out as I expected, so I’ve made org-journal-tags	 (buffer (generate-new-buffer "whisper"))
     	 (proc (start-process
     		"whisper" buffer
    -		"whisper-cpp" "--model" "/home/pavel/.whisper/ggml-medium.en.bin"
    -		"-otxt" "-ovtt" "-osrt" input)))
    +		"whisper-cpp" "--model" "/home/pavel/.whisper/ggml-medium.bin"
    +		"-otxt" "-ovtt" "-osrt" "-l" "auto" input)))
         (set-process-sentinel
          proc
          (lambda (process _msg)
    @@ -8455,6 +8489,7 @@ Didn’t work out as I expected, so I’ve made org-journal-tags  ;; Hide spoilers by default
       (setq-default mastodon-toot--content-warning t)
       (setq mastodon-media--avatar-height 40)
    +  (setq mastodon-tl--timeline-posts-count "40")
       (setq mastodon-tl--show-avatars t)
       ;; The default emojis take two characters for me
       (setq mastodon-tl--symbols
    @@ -8774,7 +8809,7 @@ Didn’t work out as I expected, so I’ve made org-journal-tags  :straight (:host github :repo "alphapapa/ement.el")
       :commands (ement-connect)
       :init
    -  (my-leader-def "ai" #'my/ement)
    +  (my-leader-def "ax" #'my/ement)
       :config
       (setq ement-room-list-auto-update t)
       (setq ement-room-mark-rooms-read 'send)
    @@ -9082,7 +9117,9 @@ Didn’t work out as I expected, so I’ve made org-journal-tags      (google-translate-at-point-reverse)))
       (setq google-translate-translation-directions-alist
     	'(("en" . "ru")
    -	  ("ru" . "en"))))
    +	  ("ru" . "en")
    +	  ("de" . "en")
    +	  ("en" . "de"))))
     
     (my-leader-def
       :infix "at"
    @@ -9217,6 +9254,53 @@ Didn’t work out as I expected, so I’ve made org-journal-tags   (sx-question-mode-content :background nil))
       (add-hook 'sx-question-mode-hook #'doom-modeline-mode)
       (add-hook 'sx-question-list-mode-hook #'doom-modeline-mode))
    +

    LLM

    +

    Trying out LLM integrations.

    +

    I don’t have access to any proprietary APIs, but LLaMA 3 8b with ollama works for some purposes.

    +

    gptel

    +

    gtpel is a package that provides an interface to chat with LLMs.

    +
    (use-package gptel
    +  :straight t
    +  :init
    +  (my-leader-def
    +    :infix "ai"
    +    "" '(:wk "AI")
    +    "i" #'gptel)
    +  :commands (gptel gptel-send gptel-menu)
    +  :config
    +  (setq gptel-model "llama3:latest")
    +  (setq gptel-backend
    +	(gptel-make-ollama "Ollama"
    +	  :host "localhost:11434"
    +	  :stream t
    +	  :models '("llama3:latest")))
    +  (general-define-key
    +   :keymaps '(gptel-mode-map)
    +   :states '(insert normal)
    +   "C-<return>" 'gptel-send))
    +

    ellama

    +

    ellama provides commands that feed things from Emacs buffers into LLMs with various prompts.

    +
    (use-package ellama
    +  :straight t
    +  :init
    +  (setq ellama-language "English")
    +  :config
    +  (require 'llm-ollama)
    +  (my-leader-def
    +    "aie" '(:wk "ellama" :keymap ellama-command-map))
    +  (which-key-add-key-based-replacements
    +    (rx "SPC a i e a") "ask"
    +    (rx "SPC a i e c") "code"
    +    (rx "SPC a i e d") "define"
    +    (rx "SPC a i e i") "improve"
    +    (rx "SPC a i e m") "make"
    +    (rx "SPC a i e p") "provider"
    +    (rx "SPC a i e s") "summarize"
    +    (rx "SPC a i e t") "translate/complete"
    +    (rx "SPC a i e x") "context")
    +  (setq ellama-provider (make-llm-ollama
    +			 :chat-model "llama3:latest"
    +			 :embedding-model "llama3:latest")))
     

    Declarative filesystem management

    My filesystem is, shall we say, not the most orderly place.

    @@ -10823,7 +10907,8 @@ I’ve seen a couple of cases where people would swap their username and ema
  • OFF (OFF) yapf
  • black
  • isort
  • -
  • sphinx-doc
  • +
  • OFF sphinx-doc
  • +
  • numpydoc
  • pytest
  • code-cells
  • tensorboard
  • @@ -11032,6 +11117,12 @@ I’ve seen a couple of cases where people would swap their username and ema
  • StackExchange
  • +
  • LLM + +
  • Declarative filesystem management