Last active
June 18, 2018 08:23
-
-
Save roktas/aece03797a6e9fdc042026696a912d58 to your computer and use it in GitHub Desktop.
bcyrpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'bcrypt' | |
PASSWORD = ARGV[0] || 'boşluk_içermeyen_türkçe_karakterler_ı_ve_İ_dahil' | |
if BCrypt::Password.new( | |
`/usr/sbin/slappasswd -h '{BCRYPT}' -o module-load=/usr/local/lib/ldap/pw-bcrypt.so -n -s #{PASSWORD}`.sub(/{BCRYPT}[$]2b[$]/, '$2a$') | |
) == PASSWORD | |
puts 'OK' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure('2') do |config| | |
config.vm.box = 'ubuntu/bionic64' | |
config.vm.provision 'shell', privileged: false, inline: <<-SHELL | |
DEBIAN_FRONTEND=noninteractive sudo -E apt-get -y update | |
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y slapd | |
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y --no-install-recommends ruby-full build-essential | |
sudo gem install bcrypt | |
sudo tar -xf /vagrant/*.tar.gz -C / | |
/vagrant/bcrypt | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment