Skip to content

Instantly share code, notes, and snippets.

View andrelcunha's full-sized avatar
:octocat:

Andre Luis da Cunha andrelcunha

:octocat:
View GitHub Profile
@andrelcunha
andrelcunha / awsCLIAutomation.sh
Created February 22, 2024 03:02 — forked from rodgtr1/awsCLIAutomation.sh
Script to authenticate with AWS CLI with MFA token
#!/bin/bash
set -e
# specify your MFA_DEVICE_ARN
MFA_DEVICE_ARN=YOURMFAARN
PATH_TO_CREDENTIALS_FILE=/path/to/.aws/credentials
echo $PATH_TO_CREDENTIALS_FILE
#1H = 3600
#2H = 7200
#3H = 10800
@andrelcunha
andrelcunha / community_to_shell.py
Created September 5, 2017 19:27 — forked from biwin/community_to_shell.py
Use PyCharm community Python Console as Django Shell.
# Change the run script on `settings> Build Execution and Deployment > Console > Python Console` to
# hoping you have your settings at project/project/settings.py (if not, change accordingly;)
import os,sys,django;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])
os.environ['DJANGO_SETTINGS_MODULE'] = WORKING_DIR_AND_PYTHON_PATHS.split('/')[-1]+'.settings'
print('Python {0} on {1} using {2} as settings'.format(sys.version, sys.platform, os.environ['DJANGO_SETTINGS_MODULE']))
django.setup()