Skip to content

Instantly share code, notes, and snippets.

@this-is-r-gaurav
Last active October 11, 2021 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save this-is-r-gaurav/3e7df96ce55aced463487eae48263d85 to your computer and use it in GitHub Desktop.
Save this-is-r-gaurav/3e7df96ce55aced463487eae48263d85 to your computer and use it in GitHub Desktop.
List of Commands that is used most frequently by me ...
# To list all the status whether they are enabled or disabled.
systemctl list-unit-files --type=service
# Grep The ID of Docker image having some name NAME
NAME=$0
docker ps | grep $NAME | awk 'print ${0}'
# To find a file that is not executable and is of text type
find . -type f ! -executable -exec file {} + | grep -w text
# To generate Random String
python3 -c "import string; import secrets; alphabet = string.ascii_letters + string.digits + '\!@\#\$%^*~\`{}[]\|:;\"\'<>?/,.()'; password=''.join([secrets.choice(alphabet) for i in range(128)]);print(password);"
# only assigne ssh key to specific local repo
git config core.sshCommand "ssh -i ~/.ssh/id_rsa_example -F /dev/null"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment