Skip to content

Instantly share code, notes, and snippets.

@ninadsp
Last active August 22, 2017 10:36
Show Gist options
  • Save ninadsp/8e0afe5d3d1f0729206d794d1ea6f71d to your computer and use it in GitHub Desktop.
Save ninadsp/8e0afe5d3d1f0729206d794d1ea6f71d to your computer and use it in GitHub Desktop.
A bunch of bash functions and aliases for Harry Potter fans...
# Harry Potter comes to your bash
# All ye muggles, make life a little magical
accio() {
# Bring files here (to $CWD)
mv $@ .;
};
stupefy() {
# Temporarily stop processes
kill -STOP $@;
};
enervate() {
# Continue processes
kill -CONT $@;
};
geminio() {
# Make a copy
cp $1 $2;
};
# Thou shalt do my bidding
alias imperio='sudo'
locomotor() {
# Move things about
mv $1 $2;
}
# Who else is around?
alias homenum-revelio='who'
# BEWARE!!! DRAGONS AHEAD
# Do not ever use this alias without proper backups or understanding what it does
#
# alias avada-kedavra='rm -rf --no-preserve-root /'
#
# This variant is much less malicious, and should probably be useable outside of a lab
# alias avada-kedavra='pkill'
#
# This has been commented out so that you do not damage any system by mistake
# Other candidates
# alias lumos='ls'
# alias apparate='ssh'
# alias legilimens='top'
# Any more suggestions? Feel free to fork this gist!

Source this file in your ~/.bash_rc or ~/.bash_profile, or copy the contents to ~/.bash_aliases.

This gist is available under the MIT License:
Copyright 2017, Ninad Pundalik (ninadsp)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment