Skip to content

Instantly share code, notes, and snippets.

@mcandre
Created May 21, 2019 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mcandre/17d96264961fb4e52c3ffad5f4073cae to your computer and use it in GitHub Desktop.
Save mcandre/17d96264961fb4e52c3ffad5f4073cae to your computer and use it in GitHub Desktop.
Homebrew install mkpasswd
$ brew install --build-from-source https://raw.githubusercontent.com/mcandre/homebrew-core/27757013b40567774c223a93faa720ed813ece71/Formula/whois.rb
@jfoliveira
Copy link

Hi, thanks for sharing this gist!
Tried to install it on macOS Catalina and ran into the following error message:

Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "whois"
Download failed: https://deb.debian.org/debian/pool/main/w/whois/whois_5.4.2.tar.xz

Any advice on how to workaround this issue and mkpasswd command available on my OSX?

Below I paste the full output log, in case it helps:

brew install --build-from-source https://raw.githubusercontent.com/mcandre/homebrew-core/27757013b40567774c223a93faa720ed813ece71/Formula/whois.rb
Warning: Unsupported installation from a commit URL!
Consider using `brew extract whois ...` instead!"
This will extract your desired whois version to a stable tap instead of
installing from a commit URL that cannnot receive updates or fixes!

######################################################################## 100.0%
Warning: whois 5.5.6 is available and more recent than version 5.4.2.
==> Installing dependencies for whois: openssl
==> Installing whois dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl@1.1-1.1.1f.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/72/724cd97c269952cdc28e24798e350fcf520a32c5985aeb26053ce006a09d8179?__gda__=exp=1586625665~hmac=f2559faad145c0051cde
######################################################################## 100.0%
==> Pouring openssl@1.1-1.1.1f.catalina.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl@1.1/certs

and run
  /usr/local/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/openssl@1.1/1.1.1f: 8,057 files, 18MB
==> Installing whois
==> Downloading https://deb.debian.org/debian/pool/main/w/whois/whois_5.4.2.tar.xz
#=#=#                                                                         
curl: (22) The requested URL returned error: 404 
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "whois"
Download failed: https://deb.debian.org/debian/pool/main/w/whois/whois_5.4.2.tar.xz

@tonidy
Copy link

tonidy commented May 24, 2021

@jfoliveira you could use my homebrew tap to install mkpasswd:

brew tap tonidy/tools-tap
brew install mkpasswd

@kgleason
Copy link

kgleason commented Jun 2, 2021

I just set up your tap, and I can see that I have mkpasswd available, but it doesn't seem to support sha-512 or sha-256, which seems odd to me.

Are you able to mkpasswd -m sha-256 or mkpasswd -m sha256 (I can never remember if the dash is required or not)

@tonidy
Copy link

tonidy commented Jun 3, 2021

@kgleason you can use libxcrypt library if you want to support sha256 / sha512. My own tap is using openssl from macOS/brew version that doesn't support sha256 / sha512

@ccouples
Copy link

Trying to build mkpasswd :-)

==> Tapping tonidy/tools-tap
Cloning into '/usr/local/Homebrew/Library/Taps/tonidy/homebrew-tools-tap'...
remote: Enumerating objects: 122, done.
remote: Counting objects: 100% (122/122), done.
remote: Compressing objects: 100% (75/75), done.
remote: Total 122 (delta 32), reused 100 (delta 20), pack-reused 0
Receiving objects: 100% (122/122), 15.56 KiB | 1.73 MiB/s, done.
Resolving deltas: 100% (32/32), done.
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/tonidy/homebrew-tools-tap/Formula/mkpasswd.rb
mkpasswd: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the tonidy/tools-tap tap (not Homebrew/brew or Homebrew/core):
/usr/local/Homebrew/Library/Taps/tonidy/homebrew-tools-tap/Formula/mkpasswd.rb:10

Error: Cannot tap tonidy/tools-tap: invalid syntax in tap!

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