Created
February 5, 2013 10:06
-
-
Save andrewbolster/4713465 to your computer and use it in GitHub Desktop.
Handy Dandy Aliases
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
# Take the last command and try it again with sudo while deleting leading spaces | |
alias please='sudo $(history 2 | head -n1 | perl -pe "s/^\s*\d+\s+//") | |
# Python compilation check without execution (parse without exec) | |
alias pycheck='python -m py_compile' | |
# Python profiling | |
alias pryfile='python -m cProfile -o profile.run' | |
# Enhanced Sudo | |
alias sudo='sudo env PATH=$PATH' | |
# Open a file from the command line using the relevant editor | |
alias go='gnome-do' |
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
#!/bin/bash | |
# Idiot proof script to forcibly optimise execution. | |
application=`which $1` | |
# Assumes the program is called like 'pyopt accessible-script-name -someopt more options than -y oucouldshakeastickat' | |
python -O ${application} ${@:2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment