Compare commits
2 Commits
610046ce96
...
27e912d9a1
Author | SHA1 | Date |
---|---|---|
Lucien Cartier-Tilet | 27e912d9a1 | |
Lucien Cartier-Tilet | 00b40eca02 |
|
@ -40,34 +40,8 @@ APPEND and COMPARE-FN, see `add-to-list'."
|
|||
#+end_src
|
||||
|
||||
** Generate and insert random passwords
|
||||
#+begin_src emacs-lisp
|
||||
(defun my/generate-password (nb-chars)
|
||||
"Generate an alphanumeric password of NB-CHARS."
|
||||
(shell-command-to-string
|
||||
(concat "tr -dc 'A-Za-z0-9!@#$%^&*' < /dev/urandom | head -c "
|
||||
(number-to-string nb-chars))))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun my/copy-generated-password (&optional prefix)
|
||||
(interactive "P")
|
||||
(kill-new
|
||||
(my/generate-password (if prefix
|
||||
(string-to-number
|
||||
(completing-read "Amount of characters: " nil))
|
||||
32))))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun my/insert-generated-password (&optional prefix)
|
||||
(interactive "P")
|
||||
(insert
|
||||
(my/generate-password (if prefix
|
||||
(string-to-number
|
||||
(completing-read "Amount of characters: "
|
||||
nil))
|
||||
32))))
|
||||
#+end_src
|
||||
These functions got replaced by my custom package, see [[file:./misc.md#password-generator][Password
|
||||
generator]].
|
||||
|
||||
** Handle new windows
|
||||
The two functions below allow the user to not only create a new window
|
||||
|
|
|
@ -244,6 +244,20 @@ and builds a heatmap out of it.
|
|||
"Main Page")))) ; Default page
|
||||
#+end_src
|
||||
|
||||
** Password generator
|
||||
I used to have some simple Elisp functions in my config that would
|
||||
generate passwords on the fly, but they were a bit too limited in my
|
||||
opinion. So instead, I went on to create a full package that would
|
||||
help me create one from a transient menu with enough options for my
|
||||
liking.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package password-gen
|
||||
:straight (password-gen :build t
|
||||
:type git
|
||||
:repo "https://labs.phundrak.com/phundrak/password-gen.el.git")
|
||||
:defer t)
|
||||
#+end_src
|
||||
|
||||
** Pinentry
|
||||
I like to use Emacs as my pinentry program. Mainly because it’s the
|
||||
easiest way for me to type then when I’m SSHing into my machine, but
|
||||
|
|
|
@ -317,39 +317,23 @@ Here is the corresponding fish configuration:
|
|||
<<generate-abbr(table=abbr-cmake)>>
|
||||
#+END_SRC
|
||||
|
||||
**** Docker and Podman
|
||||
# And of course, when it comes to Docker Compose, I don't have time to write the
|
||||
# full command, so I use these instead. Actually, let me rephrase that: I used to use
|
||||
I used to use Docker on my machine, but I switched to Podman. Still,
|
||||
my muscle memory is really strong and I keep trying to type my old
|
||||
Docker abbreviations. So, I keep them, but I also have a slight
|
||||
variation for each one of them for Podman.
|
||||
|
||||
**** Docker
|
||||
And of course, when it comes to Docker Compose, I don't have time to write the
|
||||
full command, so I use these instead.
|
||||
#+NAME: abbr-docker
|
||||
| abbreviation | command |
|
||||
|--------------+------------------------------|
|
||||
| dc | podman-compose |
|
||||
| dcb | podman-compose build |
|
||||
| dcd | podman-compose down |
|
||||
| dcl | podman-compose logs |
|
||||
| dclf | podman-compose logs -f |
|
||||
| dcp | podman-compose pull |
|
||||
| dcr | podman-compose run --rm |
|
||||
| dcu | podman-compose up |
|
||||
| dcub | podman-compose up --build |
|
||||
| dcud | podman-compose up -d |
|
||||
| dcudb | podman-compose up -d --build |
|
||||
| pc | podman-compose |
|
||||
| pcb | podman-compose build |
|
||||
| pcd | podman-compose down |
|
||||
| pcl | podman-compose logs |
|
||||
| pclf | podman-compose logs -f |
|
||||
| pcp | podman-compose pull |
|
||||
| pcr | podman-compose run --rm |
|
||||
| pcu | podman-compose up |
|
||||
| pcub | podman-compose up --build |
|
||||
| pcud | podman-compose up -d |
|
||||
| pcudb | podman-compose up -d --build |
|
||||
| dc | docker-compose |
|
||||
| dcb | docker-compose build |
|
||||
| dcd | docker-compose down |
|
||||
| dcl | docker-compose logs |
|
||||
| dclf | docker-compose logs -f |
|
||||
| dcp | docker-compose pull |
|
||||
| dcr | docker-compose run --rm |
|
||||
| dcu | docker-compose up |
|
||||
| dcub | docker-compose up --build |
|
||||
| dcud | docker-compose up -d |
|
||||
| dcudb | docker-compose up -d --build |
|
||||
|
||||
Here is the corresponding fish configuration:
|
||||
#+BEGIN_SRC fish
|
||||
|
|
Loading…
Reference in New Issue