by Devin Yang

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

在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

需要登入才可留言!

類似的文章


vim, macos

Ultisnips requires py >= 2.7 or py3 問題修正

如果你跟我一樣安裝Vim,執行terminal是否會出現需要python2.7或python3的錯誤,但是系統明明就有python 2.7呀, 本文說明我如何修正此問題。

linux

如何安裝monitor工具htop到CentOS上

Htop是一個基於Linux的免費(GPL)基於ncurses的程序monitor工具。 他類似於top,但允許您垂直和水平滾動,所以您可以看到運行在系統完整的命令行, 以及可將它們視為程序樹,選擇多個程序並進行操作。

Emoji, MacOS

⌘+control+空白 (Emoji on Mac)

⌘+control+空白 (Emoji on Mac)