Created
March 22, 2012 10:06
-
-
Save timurvafin/2157526 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
PASSWORD = "123456" | |
USERNAME = "user%d" | |
(1..3).each do |i| | |
user = USERNAME % i | |
puts `/usr/sbin/useradd --groups rvm #{user}` | |
puts `echo -e "#{PASSWORD}\n#{PASSWORD}" | (/usr/bin/passwd --stdin #{user})` | |
puts `echo -e "#{PASSWORD}\n#{PASSWORD}" | (/usr/bin/smbpasswd -a -s #{user})` | |
puts "Created #{user}" | |
end |
This file contains hidden or 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 | |
(1..15).each do |i| | |
`/usr/sbin/userdel --force --remove user#{i}` | |
puts "Removed user#{i}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment