Skip to content

Instantly share code, notes, and snippets.

@wheelq
Created May 11, 2020 16:37
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 wheelq/267ebc93bb25429a3a2efb95c6288d1c to your computer and use it in GitHub Desktop.
Save wheelq/267ebc93bb25429a3a2efb95c6288d1c to your computer and use it in GitHub Desktop.
Aliases for DNS, find files and ssh-keygen
alias dns="scutil --dns | grep 'nameserver\[[0-9]*\]'"
alias ffile='function __ffile(){if [ -z $2 ]; then _loc=".";else _loc="${2}";fi; if [ -z $1 ]; then echo "use: ffile [filename] [path]";else find "${_loc}" -type f -iname "*$1*" 2>/dev/null;unset -f __ffile;fi }; __ffile'
alias create-ssh-key='function _create(){SUFFIX=$(date +%Y%m%d_%H%M%S);ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519_${SUFFIX}_wheelq -C "id_ed25519_${SUFFIX}_wheelq"; unset -f _create;echo -e "Key: ${HOME}/.ssh/id_ed25519_${SUFFIX}_wheelq\n\n$(cat ${HOME}/.ssh/id_ed25519_${SUFFIX}_wheelq.pub)"};_create'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment