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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=Dl2n_fcDjkE | |
### Add this to your .bashrc | |
# custom fdisk | |
# - add color when called with -l or -x | |
# - prepend sudo | |
function fdisk () { |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=Dl2n_fcDjkE | |
### Add this to your .bashrc | |
# custom free | |
# - add common options | |
# - add color | |
# - add footer |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=lSOVozD7Iio | |
### Add this to your .bashrc | |
export LESS="--RAW-CONTROL-CHARS --quit-if-one-screen --clear-screen --tilde" | |
# version of less that scrolls | |
alias less="less --chop-long-lines --status-column --rscroll='>'" |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=cDlWF48xaGQ | |
# Add this to your .bashrc | |
# custom gpg | |
# - add color output | |
# - replace $HOME with ~ | |
# - Add footer with explanation of terms |
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
#!/usr/bin/env bash | |
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=cOYVjk26504 | |
red="\e[31m" | |
green="\e[32m" | |
reset="\e[0m" |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=z6Wee8o4x1s | |
# Put this in your .bashrc | |
# Record terminal to this file. | |
__terminal_recording_file="${HOME}/.cache/terminal_recording" | |
# Record terminal output. |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/shorts/mYfEIZFlIwo | |
# Put this in your .bashrc or something like that | |
# pretty_print_directory | |
# - replace $HOME with ~ | |
# - make everything before the last '/' green, and everything after white and | |
# bold |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/shorts/WVyqVkGYb4k | |
# Add this somewhere in ~/.bashrc | |
# write_message | |
# - write a message on the lower right corner of the terminal | |
function write_message () { | |
if [[ "$#" -eq 0 ]]; then |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=yYsmcfWIblg | |
# Add this somewhere in ~/.bashrc | |
# __edit_without_executing | |
# - Replacement for the "C-x e" Bash binding, but without executing the | |
# command immediately. (Good for validating before running, and for performing | |
# history expansion). |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=IyzNz1uPEGg | |
# deleteAllButMostRecentInTar | |
# source: https://stackoverflow.com/a/71666950/21567639 | |
function deleteAllButMostRecentInTar() | |
{ | |
local archive=$1 | |
local filesToDelete=$(mktemp) |