-
Notifications
You must be signed in to change notification settings - Fork 2
Riad's commit #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MRIT03
wants to merge
1
commit into
thelebdev:master
Choose a base branch
from
MRIT03:test-branch
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #!/bin/bash | ||
|
|
||
| function passgen() { | ||
| if [ $1 == 'Windows' ] || [ $1 == 'WINDOWS' ] || [ $1 == 'windows' ] | ||
| then | ||
| cp win_version.sh ~ | ||
| echo "source ./win_version.sh" >> ~/.bashrc | ||
| echo "Installed the Windows version. Tell me you're basic without telling me you're basic." | ||
| elif [ $1 == 'MacOS' ] || [ $1 == 'macos' ] || [ $1 == 'MACOS' ] || [ $1 == 'MacOs' ] || [ $1 == 'macOs' ] || [ $1 == 'Macos' ] | ||
| then | ||
| cp mac_version.sh ~ | ||
| echo "source ./mac_version.sh" >> ~/.bashrc | ||
| echo "Installed the mac version. Imagine using a mac. Ew. *cries without M1 chip*" | ||
| else | ||
| echo "You either wrote inalid input or a OS that we do not support. Either way sucks to be you." | ||
| fi | ||
| } | ||
|
|
||
|
|
||
| passgen $1 2> /dev/null |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/bin/bash | ||
| ############# | ||
| # File name: run.sh | ||
| # Purpose: When executed, this will copy a complex password to the user's clipboard | ||
| # Created by: Christophe El-Khoury (thelebdev) | ||
| # Created at: 24-02-2021, Byblos - Lebanon | ||
| ########### | ||
|
|
||
| passgen(){ | ||
|
|
||
| # Array holding all of the characters used in the password | ||
| DICTIONARY=(a b c d e f g h i j k l m n o p q r s t u v w x y n z A B C D E F G H I J K L M N O P Q R S T U V W X Y N Z ! \" \# \$ \% \& \' \( \) \* \+ \, \- \. \/ \: \; \< \= \> \? \@ \[ \\ \] \^ \_ \` \{ \| \} \~ ) | ||
|
|
||
| # User's input, the password's length | ||
| PASSWORD_LENGTH=$1 | ||
|
|
||
| ### | ||
| # This function will validate a user's confirmation choice | ||
| ### | ||
| function VALIDATE_CONFIRMATION { | ||
| read CONFIRMATION | ||
| echo $CONFIRMATION | ||
| if [[ $CONFIRMATION != "y" ]] && [[ $CONFIRMATION != "Y" ]] | ||
| then | ||
| echo "Aborting..." | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| if [ -z $PASSWORD_LENGTH ] | ||
| then | ||
| PASSWORD_LENGTH=14 | ||
| echo "Generating password of length ${PASSWORD_LENGTH} (default)" | ||
| else | ||
| echo "Generating password of length ${PASSWORD_LENGTH} (custom)" | ||
| fi | ||
|
|
||
|
|
||
| if [ $PASSWORD_LENGTH -lt 6 ] | ||
| then | ||
| echo "You are generating a weak password ($PASSWORD_LENGTH characters). Are you sure you want to continue? (y/n)" | ||
| VALIDATE_CONFIRMATION | ||
| fi | ||
|
|
||
| if [ $PASSWORD_LENGTH -gt 30 ] | ||
| then | ||
| echo "You are generating a very long password ($PASSWORD_LENGTH characters). Are you sure you want to continue? (y/n)" | ||
| VALIDATE_CONFIRMATION | ||
| fi | ||
|
|
||
|
|
||
| PASSWORD="" | ||
|
|
||
| for (( c=0; c<$PASSWORD_LENGTH; c++ )) | ||
| do | ||
| PASSWORD=$PASSWORD${DICTIONARY[$RANDOM % ${#DICTIONARY[@]}]} | ||
| done | ||
| echo "Password copied in your clipboard" | ||
| echo $PASSWORD | pbcopy | ||
|
|
||
| } | ||
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #!/bin/bash | ||
| ############# | ||
| # File name: run.sh | ||
| # Purpose: When executed, this will copy a complex password to the user's clipboard | ||
| # Created by: Christophe El-Khoury (thelebdev) | ||
| # Created at: 24-02-2021, Byblos - Lebanon | ||
| ########### | ||
|
|
||
| passgen(){ | ||
|
|
||
| # Array holding all of the characters used in the password | ||
| DICTIONARY=(a b c d e f g h i j k l m n o p q r s t u v w x y n z A B C D E F G H I J K L M N O P Q R S T U V W X Y N Z ! \" \# \$ \% \& \' \( \) \* \+ \, \- \. \/ \: \; \< \= \> \? \@ \[ \\ \] \^ \_ \` \{ \| \} \~ ) | ||
|
|
||
| # User's input, the password's length | ||
| PASSWORD_LENGTH=$1 | ||
|
|
||
| ### | ||
| # This function will validate a user's confirmation choice | ||
| ### | ||
| function VALIDATE_CONFIRMATION { | ||
| read CONFIRMATION | ||
| echo $CONFIRMATION | ||
| if [[ $CONFIRMATION != "y" ]] && [[ $CONFIRMATION != "Y" ]] | ||
| then | ||
| echo "Aborting..." | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| if [ -z $PASSWORD_LENGTH ] | ||
| then | ||
| PASSWORD_LENGTH=14 | ||
| echo "Generating password of length ${PASSWORD_LENGTH} (default)" | ||
| else | ||
| echo "Generating password of length ${PASSWORD_LENGTH} (custom)" | ||
| fi | ||
|
|
||
|
|
||
| if [ $PASSWORD_LENGTH -lt 6 ] | ||
| then | ||
| echo "You are generating a weak password ($PASSWORD_LENGTH characters). Are you sure you want to continue? (y/n)" | ||
| VALIDATE_CONFIRMATION | ||
| fi | ||
|
|
||
| if [ $PASSWORD_LENGTH -gt 30 ] | ||
| then | ||
| echo "You are generating a very long password ($PASSWORD_LENGTH characters). Are you sure you want to continue? (y/n)" | ||
| VALIDATE_CONFIRMATION | ||
| fi | ||
|
|
||
|
|
||
| PASSWORD="" | ||
|
|
||
| for (( c=0; c<$PASSWORD_LENGTH; c++ )) | ||
| do | ||
| PASSWORD=$PASSWORD${DICTIONARY[$RANDOM % ${#DICTIONARY[@]}]} | ||
| done | ||
| echo "Password copied in your clipboard" | ||
| echo $PASSWORD | clip | ||
|
|
||
| } | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the Created by part of the documentation and the file name