by Devin Yang

建立於: 8年前 ( 更新: 8年前 )

在Linux的~/.bashrc或是MacOS上的~/.bash

在終端機上測試(貼到終端機上執行即可):
env LC_CTYPE=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c "16" | xargs
如果您使用的shell是bash,可以把他加入./bash_profile中如下:
alias gpw='genpasswd'
genpasswd() {
env LC_CTYPE=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c "16" | xargs
}
記得更新一次 source ~/.bash_profile 生效。
然後我們只要輸入gpw就能夠,產生一組隨機的密碼囉。
password-generator

Tags: linux mac

Devin Yang

文章內容無法一一說明,如果您有什麼不了解處,歡迎提問哦:)

No Comment

Post your comment

需要登入才可留言!

類似的文章


linux, python, colab

如何從我們的Server透過ssh連線到colab?

介紹我寫的一支bash,用來透過ssh連線到colab vm內。 一行指令,搞定colab OpenSSH Server。

linux

舊版CentOS 6.2編譯git過程

本文使用的CentOS 6.2進行,進行重build curl及git過程。 主因是因為作業系統太舊,我直接由source build最新版本的git。

vpn,cli,macos

我如何在MacOS上用命令列撥VPN

我自己會有用MacOS在命令列撥VPN的需求,在這提供我的別名,設定方式