Last active
April 15, 2018 15:50
-
-
Save alysivji/19878dc6e418a14f528160d0e62de858 to your computer and use it in GitHub Desktop.
Unix snippets
This file contains 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 uuid; uuid.uuid4().hex |
This file contains 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
""" | |
Pseudo-random django secret key generator. | |
- Does print SECRET key to terminal which can be seen as unsafe. | |
""" | |
import string | |
import random | |
# Just use letters and digits to simplfy setting values from user_data.txt | |
chars = ''.join([string.ascii_letters, string.digits]) | |
SECRET_KEY = ''.join([random.SystemRandom().choice(chars) for i in range(50)]) | |
print SECRET_KEY |
This file contains 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
git reset --soft HEAD~$(git rev-list --count HEAD ^master) | |
git add -A | |
git commit -m "[JIRA-001] Feature name squashed commit" | |
git push -f |
This file contains 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
remove docker images | |
docker rm $(docker ps -a | grep google/cloud-sdk | awk {'print $1}') | |
docker rmi $(docker images | grep '<none>' | awk {'print $3}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment