Check These Out
Given a requirements.txt file with unpinned package names, output the packages pinned to the latest version. Handy to copy/paste back into your requirements.txt when you start a new project. Note that this will download packages but not install them.
Opens a file or URL in the user's preferred application.
This command will format your alias or function to a single line, trimming duplicate white space and newlines and inserting delimiter semi-colons, so it continues to work on a single line.
################################################################################
# get all modified files since last commit and zip them to upload to live server
################################################################################
# delete previous tar output file
rm mytarfile.tar -rf
#rm c:/tarOutput/*.* -rf
# get last commit id and store in variable
declare RESULT=$(git log --format="%H" | head -n1)
# generate file list and export to tar file
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $RESULT | xargs tar -rf mytarfile.tar
# extract tar files to specified location
tar -xf mytarfile.tar -C c:/tarOutput
Installs pip packages defining a proxy
Make sure to run this command in your git toplevel directory. Modify `-j4` as you like. You can also run any arbitrary command beside `git pull` in parallel on all of your git submodules.
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token.
This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use:
`awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'`
You must adapt the command line to include:
* $MFA_IDis ARN of the virtual MFA or serial number of the physical one
* TTL for the credentials
The improvement is that you can re-attach to the screen at a later point.