Hacker Newsnew | past | comments | ask | show | jobs | submit | 0fflineuser's commentslogin

I love it. It is so simple and flexible.

But a life saver is using it with <https://github.com/skeeto/passphrase2pgp>.

This means we don't need to move gpg/ssh keys we can just recreate them by remembering their passphrase (and other stuff like the date if we want).

  # gpg key for the encryption of the password-store
  passphrase2pgp --subkey --protect=2 --uid "helloworld" | gpg --import

  #for access to the git remote repo add to it this public key :
  passphrase2pgp -u emergency -f ssh -p > ~/.ssh/emergency.pub
  #only use it to install a non-emergency key as a new authorized key :
  passphrase2pgp -u emergency -f ssh | ssh-add -
I read a blog post for the above but can't remember what it was, but it's amazing now It's very easy to download and access the password-store from any devices, I use it in window, linux and termux.

Funnily enough I never used `pass generate` once, even tough I have more than 3700 passwords. I always used the `pwgen` command, I don't know if there really is a big difference between the 2 (except pass generate being already in pass).

As for how to structure, here are some example of how I do it :

  <service>/email
  <service>/otp
  work/<service>/password
  homelab/<service>/username
They are all only one line except some backup codes which use multiline.

Then it's very easy to get the password or the otp, just bind `passmenu`, `passmenu-otp` in your window manager or directly use the command line for multiline stuff.


Don't you just need to install git-lfs https://git-lfs.com/ and then run `git lfs pull` ?


Oh I guess I didn't run `git lfs pull` lol thanks


Personnally I use bash, so I made so my history is eternal (as is the content never get deleted) and I use FZF_CTRL_R_OPTS to customize the ctrl-r of fzf.

Also the history is reloaded after each command so if I type multiple commands in a tmux pane x, and then go to another tmux pane y I just have to type something (just press the enter key) in pane y and I have the full history of what happened in pane x.

Here is how to do it, just add the following to your .bashrc for the eternal history :

```

  export HISTFILESIZE=
  export HISTSIZE=
  export HISTTIMEFORMAT="[%F %T] "
  export HISTFILE=~/.bash_eternal_history
  export HISTCONTROL=ignoreboth
  shopt -s histappend
  shopt -s checkwinsize
  filtered_history_save() {
      local last_command=$(history 1 | awk '{print $4}')
      # Don't store some commands in the history.
      if [[ ! "$last_command" =~ (mpv|pass|yt-dlp|wtwitch) ]]; then
          history -a
      fi
      history -c
      history -r
  }
  export PROMPT_COMMAND="filtered_history_save; $PROMPT_COMMAND"

  # Sources :
  # http://stackoverflow.com/questions/9457233/unlimited-bash-history
  # http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login
  # http://superuser.com/questions/20900/bash-history-loss

```

And for the custom fzf ctrl-r :

```

  # Source fzf (should already be here if fzf is installed)
  if [ -f /usr/share/fzf/completion.bash ]; then
    . /usr/share/fzf/completion.bash
  fi

  if [ -f /usr/share/fzf/key-bindings.bash ]; then
    . /usr/share/fzf/key-bindings.bash
  fi


  # Customize ctrl-r
  export FZF_CTRL_R_OPTS="
    --preview 'echo {2..} | bat --color=always -pl sh'
    --preview-window right:wrap
    --bind 'ctrl-/:toggle-preview'
    --bind 'ctrl-t:track+clear-query'
    --bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort'
    --color header:italic
    --header 'Press CTRL-Y to copy command into clipboard'"

```


Newsraft, before I was using Newsboat.

https://codeberg.org/newsraft/newsraft

Here is a video to see how it works. https://www.youtube.com/watch?v=gE-PhXnvp30


Personnaly, I use https://gitlab.com/shackra/goimapnotify , you can add a `~/.config/imapnotify/{{ youremailaddresshere }}.yaml` config file for each of your email addresses and enable and start it as a systemd service with `systemctl --user enable ---now goimapnotify@{{ youremailaddresshere }}.service`

Here is and example of a config file for a gmail address :

```

  host: imap.gmail.com
  port: 993
  tls: true
  tlsOptions:
    rejectUnauthorized: false
  username: {{ youremailaddresshere }}
  password: ''
  passwordCMD: pass mw/{{ youremailaddresshere }} | head -n1
  onNewMail: mailsync {{ youremailaddresshere }} | while read OUTPUT; do notify-send "" "$OUTPUT"; done
  onNewMailPost: ''
  onDeletedMail: ''
  onDeletedMailPost: ''
  boxes:
    - INBOX
```


> format

indent it with 2+ spaces

  like
  this


Thanks!


> tlsOptions:

> rejectUnauthorized: false

Means trust any cert?


Yes, thanks for pointing it out, it should be true.

I took it from my config which I did a long time ago and I guess I didn't pay attention enough when doing it, my bad !


I am also curious.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: