Compare commits

...

3 commits

Author SHA1 Message Date
b7728cf9ca console: ssh-agent for termux
Some checks failed
Update Site / trigger_update (push) Has been cancelled
2025-03-06 10:56:35 +03:00
8264a067e9 emacs: round number at point 2025-03-06 10:51:05 +03:00
53b19728b7 console: pv, turn off bat 2025-03-06 10:50:50 +03:00
6 changed files with 67 additions and 6 deletions

View file

@ -29,7 +29,7 @@ xhost +local:root > /dev/null 2>&1
# Startup & environment:5 ends here
# [[file:Console.org::*Startup & environment][Startup & environment:6]]
export MANPAGER="sh -c 'sed -e s/.\\\\x08//g | bat -l man -p'"
# export MANPAGER="sh -c 'sed -e s/.\\\\x08//g | bat -l man -p'"
# Startup & environment:6 ends here
# [[file:Console.org::*Startup & environment][Startup & environment:7]]

View file

@ -1,5 +1,6 @@
(specifications->manifest
'(
"man-db"
"aria2"
"openssl"
"ncdu"

View file

@ -615,6 +615,25 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq accent-custom '((a (ā))
(A (Ā)))))
(defun my/round-number-at-point (word signs)
(interactive
(list (or (when (region-active-p)
(buffer-substring-no-properties
(region-beginning)
(region-end)))
(thing-at-point 'number 'no-properties))
(read-number "Decimal signs: " 2)))
(when (stringp word)
(setq word (string-to-number word)))
(let ((number (/ (float (round (* (expt 10 signs) word)))
(expt 10 signs))))
(save-excursion
(replace-string-in-region
(number-to-string word)
(number-to-string number)
(line-beginning-position)
(line-end-position)))))
(use-package projectile
:straight t
:config
@ -8192,6 +8211,7 @@ base toot."
"qwen2.5:32b" "qwen2.5-coder:32b"
"eva-qwen2.5-q4_k_l-32b:latest"
"t-pro-1.0-q4_k_m:latest"
"t-lite-it-1.0-q4_k_m:latest"
(llava-phi3:latest
:capabilities (media)
:mime-types ("image/jpeg" "image/png")))))

View file

@ -51,11 +51,18 @@ fi
# SSL Certs:1 ends here
# [[file:Console.org::*ssh-agent][ssh-agent:1]]
SSH_AGENT_DIR="/tmp"
if [ "$IS_ANDROID" == "true" ]; then
SSH_AGENT_DIR="/data/data/com.termux/files/tmp"
mkdir -p $SSH_AGENT_DIR
fi
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent -t 1h > "/tmp/ssh-agent.env"
ssh-agent -t 1h > "$SSH_AGENT_DIR/ssh-agent.env"
fi
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
source "/tmp/ssh-agent.env" >/dev/null
source "$SSH_AGENT_DIR/ssh-agent.env" >/dev/null
fi
# ssh-agent:1 ends here

View file

@ -109,11 +109,18 @@ I'm paranoid so I encrypt my SSH keys.
Got the idea for below from [[https://wiki.archlinux.org/title/SSH_keys#SSH_agents][ArchWiki]]:
#+begin_src bash
SSH_AGENT_DIR="/tmp"
if [ "$IS_ANDROID" == "true" ]; then
SSH_AGENT_DIR="/data/data/com.termux/files/tmp"
mkdir -p $SSH_AGENT_DIR
fi
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env"
ssh-agent -t 1h > "$SSH_AGENT_DIR/ssh-agent.env"
fi
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
source "$SSH_AGENT_DIR/ssh-agent.env" >/dev/null
fi
#+end_src
** Guix settings
@ -345,7 +352,7 @@ xhost +local:root > /dev/null 2>&1
Set manpager to bat
#+begin_src bash
export MANPAGER="sh -c 'sed -e s/.\\\\x08//g | bat -l man -p'"
# export MANPAGER="sh -c 'sed -e s/.\\\\x08//g | bat -l man -p'"
#+end_src
[[https://codeberg.org/akib/emacs-eat][eat]] integration
@ -974,6 +981,8 @@ keymap_mode = "vim-insert"
| ncdu | disk usage analyzer |
| openssl | |
| aria2 | Download tool |
| man-db | |
| pv | |
** ripgrep config
Occasionally I can't exclude certain files from ripgrep via the VCS settings, so here is a simple config to ignore certain files globally.

View file

@ -1083,6 +1083,28 @@ Input accented characters.
(setq accent-custom '((a (ā))
(A (Ā)))))
#+end_src
*** Random editing tricks
**** Round number at point
#+begin_src emacs-lisp
(defun my/round-number-at-point (word signs)
(interactive
(list (or (when (region-active-p)
(buffer-substring-no-properties
(region-beginning)
(region-end)))
(thing-at-point 'number 'no-properties))
(read-number "Decimal signs: " 2)))
(when (stringp word)
(setq word (string-to-number word)))
(let ((number (/ (float (round (* (expt 10 signs) word)))
(expt 10 signs))))
(save-excursion
(replace-string-in-region
(number-to-string word)
(number-to-string number)
(line-beginning-position)
(line-end-position)))))
#+end_src
** Working with projects
Packages related to managing projects.
@ -10835,6 +10857,7 @@ Or you can load up Element for a moment to see what the mention was, if that's e
(setq telega-emoji-use-images nil)
(setq telega-chat-fill-column 80)
(setq telega-completing-read-function #'completing-read)
(setq telega-sticker-size '(12 . 24))
(add-to-list 'savehist-additional-variables 'telega-msg-add-reaction)
(remove-hook 'telega-chat-mode-hook #'telega-chat-auto-fill-mode)
(general-define-key
@ -11180,6 +11203,7 @@ I don't have access to any proprietary APIs, but LLaMA 3.1 8b with [[https://oll
"qwen2.5:32b" "qwen2.5-coder:32b"
"eva-qwen2.5-q4_k_l-32b:latest"
"t-pro-1.0-q4_k_m:latest"
"t-lite-it-1.0-q4_k_m:latest"
(llava-phi3:latest
:capabilities (media)
:mime-types ("image/jpeg" "image/png")))))