Manage New Post Logout Login

#!/bin/jdorfman

bash hacks, web performance, open source & whatever else

Tag Generator

« Back to blog

Easy password generator using bash on Mac OS X

Prerequisites:

  • homebrew
  • .bashrc/.bash_profile 
  • OS X 10.8+

Install

$ brew install pwgen

Configure

$ vim ~/.bash_profile

# Paste the following function
genpasswd() {
    pwgen -Bs $1 1 |pbcopy |pbpaste; echo "Has been copied to clipboard"
}

Usage

$ genpasswd 25
VyxjFrRnoFkAP7bpAzRKB2t4k
Has been copied to clipboard
Tags
  • bash
  • Generator
  • password
Upvote Upvoted 1
Tweet
Posted

Justin Dorfman

@jdorfman
Browse the Archive »
Subscribe by email » We'll email you when there are new posts here.
You're following this blog. Unfollow »
Follow this Posthaven »
Enter your email address to get email alerts about new posts on this site. Unsubscribe anytime.
Email address is invalid.

Tags

  • s3 2
  • bash 2
  • cdn 2
  • maxcdn 2
  • las vegas 1
  • transportation 1
  • ls 1
  • open source 1
  • ssh 1
  • password 1
  • See all 27 tags »