This file contains hidden or 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
| #NOTE: For to edit key combinations, press CTRL+V in terminal, followed by the desired key combination. | |
| # When entereing this into inputrc, replace the first two characters shown with \e | |
| # For example, my terminal shows "^[[1;5D" if I do CTRL+Backspace (I make sure Ctrl+V is done first) | |
| # When using this, I use "\e[1;5D" instead. | |
| # On TAB, first show suggestions if there are multiple, then cycle through them on next TAB | |
| TAB: menu-complete | |
| set show-all-if-ambiguous on | |
| set menu-complete-display-prefix on | |
| "\e[Z": "\e-1\C-i" #Shift+TAB cycles in reverse |
This file contains hidden or 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 | |
| virsh nodedev-list --cap pci | grep $( echo pci_.*"$(lspci | grep "$1" | awk '{ print $1 }' | tr ':' '_' | tr '.' '_' )" ) | |
This file contains hidden or 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
| relpath(){ python -c "import os.path; print os.path.relpath('$1','${2:-$PWD}')" ; } | |
| show_latest () { | |
| if [ -z "$1" ] | |
| then | |
| local dir=$PWD | |
| else | |
| local dir="$1" | |
| fi | |
| ls --sort=time --reverse "$dir" | tail -1 ; | |
| } |
This file contains hidden or 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 | |
| # Append to ~/.bashrc | |
| # Usage: | |
| # Default editor from /etc/alternatives/editor: $ nf python ~/scripy.py | |
| # Custom editor: $ nf python ~/script.py vi | |
| nf() { | |
| STR=$( echo "#!"`which "$1"` ) | |
| if [ ! -f "$2" ]; then | |
| echo $STR > "$2" | |
| echo "" >> "$2" |