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
| #!/bin/bash | |
| # Adapted from original by Jaime Preciado-Beas (jpreciad@nd.edu) | |
| # To export env variables to current shell | |
| # run: . user-mfa.sh | |
| # check for user's mfa serial number | |
| : ${AWS_MFA_SERIAL?"Need to set AWS_MFA_SERIAL. Locate at the bottom of your user page under AWS Console -> Identity and Access Management -> Users -> Your netID. Field is labeled 'Multi-Factor Authentication Device'"} | |
| unset AWS_ACCESS_KEY_ID |
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
| #!/bin/bash | |
| # Here short description of this script | |
| # This is just a template to be used for writing new bash scripts | |
| ### | |
| # Based on Google Style Guide: https://google.github.io/styleguide/shell.xml | |
| # General remarks | |
| # * Executables should have no extension (strongly preferred) or a .sh extension. | |
| # * Libraries must have a .sh extension and should not be executable |
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
| def verify_sign(public_key_loc, signature, data): | |
| ''' | |
| Verifies with a public key from whom the data came that it was indeed | |
| signed by their private key | |
| param: public_key_loc Path to public key | |
| param: signature String signature to be verified | |
| return: Boolean. True if the signature is valid; False otherwise. | |
| ''' | |
| from Crypto.PublicKey import RSA | |
| from Crypto.Signature import PKCS1_v1_5 |
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
| import json | |
| import boto | |
| from django.db import models | |
| from django.conf import settings | |
| from django.contrib.auth.models import User | |
| class UploadToken(models.Model): | |
| user = models.ForeignKey(User) | |
| created = models.DateTimeField(auto_now_add=True) |
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
| import java.util.*; | |
| import java.io.*; | |
| import java.security.*; | |
| public class ChangePassword | |
| { | |
| private final static JKS j = new JKS(); | |
| public static void main(String[] args) throws Exception | |
| { |
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
| # http://stuvel.eu/files/python-rsa-doc | |
| # You can `pip install rsa` | |
| import rsa | |
| ### KEY GENERATION ### | |
| ### Run once, on your dev environment | |
| ### Store the private key in a secure place; add the pubkey to your program | |
| (pubkey, privkey) = rsa.newkeys(1024) |
NewerOlder