Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate passphrase #472

Open
anstylian opened this issue Jan 12, 2025 · 3 comments
Open

Generate passphrase #472

anstylian opened this issue Jan 12, 2025 · 3 comments

Comments

@anstylian
Copy link

anstylian commented Jan 12, 2025

The suggested command for generating a passphrase is not working for me. Can you test it?

export CERTIFY_PASS=$(LC_ALL=C tr -dc 'A-Z1-9' < /dev/urandom | \
  tr -d "1IOS5U" | fold -w 30 | sed "-es/./ /"{1..26..5} | \
  cut -c2- | tr " " "-" | head -1) ; printf "\n$CERTIFY_PASS\n\n"

It fails with this error sed: -e expression #1, char 7: unknown option to 's'

As I understand the result should have this format:
1234-12345-12345-12345-12345-12345

To archive the about I have used this command

export CERTIFY_PASS=$(LC_ALL=C tr -dc 'A-Z1-9' < /dev/urandom \
| tr -d "1IOS5U" | fold -w 30 | sed 's/.\{5\}/& /g' | cut -c2- | tr " " "-" |\
 head -1 | sed 's/-$//') ; printf "\n$CERTIFY_PASS\n\n"

I am opening a PR with the above in case a change is needed.

@drduh
Copy link
Owner

drduh commented Mar 3, 2025

Which platform does this happen on?

@anstylian
Copy link
Author

I have taken the nixos image you provided and flashed it on sd card for the Raspberry Pi 3.

@anstylian
Copy link
Author

I have run your command now, at my desktop, and I see that works fine.
Also, what I wrote above is wrong:

As I understand the result should have this format:
1234-12345-12345-12345-12345-12345

Now I see that the correct format is '1234-1234-1234-1234-1234-1234', so the comment above should be adjusted to this:

export CERTIFY_PASS=$(LC_ALL=C tr -dc 'A-Z1-9' < /dev/urandom | \
tr -d "1IOS5U" | fold -w 24 | sed 's/.\{4\}/& /g'  | tr " " "-" | \
head -1 | sed 's/-$//') ; printf "\n$CERTIFY_PASS\n\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants