Monday, June 20, 2016

aws CodeCommit The requested URL returned error: 403 with Apple-Git

If you faced with this problem, probably you are using codecommit over https with apple-git.

This problem occurs because of Apple-Git caches credentials inside to the keychain. AWS CLI generates new password everytime via secret and timestamp, so it changes everytime based on time.

To achive problem, you can use nicc777's script https://github.com/nicc777/macaws-codecommit-pwdel for remove cache in time interval or you can follow instructions below:

a). Go to Keychain Access, search for codecommit (or your repository name).
b). Right click on the row and select Get Info.
c). Click on Access Control and Remove git-credentials-osxkeychain from the list and save. This way Apple-Git will not try to read from the keychain.
(source : https://forums.aws.amazon.com/thread.jspa?messageID=647431#jive-message-651375)

Other solutions:
- Use another git (ex: brew install git)
- Connect codecommit through SSH

Sunday, June 19, 2016

Bash Find all mp4 and zip files and move them to the current directory [Terminal]

find . -regex ".*\.\(mp4\|zip\)" -exec mv {} . \;

This command finds all mp4 and zip files and moves them to the current directory.