Last active
June 23, 2021 14:34
-
-
Save thanakijwanavit/860aeaa79a2ebe86c30c11d5e08c9e9d to your computer and use it in GitHub Desktop.
aws key installation in colab with aes pw encryption
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
from nicHelper.colab import autoSetupAws | |
from getpass import getpass | |
path = '/content/drive/MyDrive/.test' | |
autoSetupAws(path=path, | |
password = getpass('enter your password').encode(), | |
region='ap-southeast-1' ) |
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
!pip install -q nicHelper | |
!apt install --q awscli | |
from nicHelper.colab import saveAwsPw, autoSetupAws | |
from getpass import getpass | |
### only do this once then delete the password | |
saveAwsPw(awskey = b'test', awssecret=b'password', path = '/content/drive/MyDrive/.awsKey', password = b'test') | |
## this function encrypt awskey and secret with aes using your password | |
############ | |
# load password and set it to aws | |
autoSetupAws(path='/content/drive/MyDrive/.awsKey',password = getpass().encode()) |
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
from nicHelper.colab import saveAwsPw | |
from getpass import getpass | |
awskey = getpass('enter your aws key').encode() | |
awssecret = getpass('enter your aws Secret').encode() | |
password = getpass('set your password').encode() | |
path = '/content/drive/MyDrive/.test' | |
saveAwsPw(awskey=awskey, awssecret=awssecret, path=path, password=password) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note that password needs to be the same when using autosetup as when using save