Example: # apt install anacron
- Make sure your new script is executable
| # Shell aliases specific for Macs | |
| # Upgrade all brew applications while deferring the automatic cache cleanup until after all upgrades are complete | |
| alias brew-upgrade='export HOMEBREW_NO_INSTALL_CLEANUP=1 ; brew update && brew upgrade && brew upgrade --cask ; brew cleanup' ; |
| #!/bin/sh | |
| ## | |
| # Best to run these commands separately | |
| ## | |
| ## |
| # Add this function to your ~/.bash_alises | |
| # Or ~/.bash_secrets if you've looked at my other Gists ;) | |
| # overthewire.org | |
| # otw game level [port] | |
| # otw bandit 0 | |
| otw () { | |
| if [ $# == 0 ]; then | |
| echo "SSH to an OverTheWire wargame" ; |
| # git graph | |
| git config --global alias.graph 'log --all --decorate --oneline --graph' |
| feat: add hat wobble | |
| ^--^ ^------------^ | |
| | | | |
| | +-> Summary in present tense. | |
| | | |
| +-------> Type: chore, docs, feat, fix, refactor, style, or test. |
| # 1. redo last command but as root | |
| sudo !! | |
| # 2. open an editor to run a command | |
| ctrl+x+e | |
| # 3. create a super fast ram disk | |
| mkdir -p /mnt/ram | |
| mount -t tmpfs tmpfs /mnt/ram -o size=8192M |
| # Start windows and panes at 1, not 0 | |
| set -g base-index 1 | |
| setw -g pane-base-index 1 | |
| # Fix broken colored prompt - This doesn't work with MacOs? | |
| set -g default-terminal "tmux-256color" | |
| # Open a bottom pane to edit .tmux.conf | |
| bind-key M split-window -v "nano ~/.tmux.conf" | |
| # Reload .tmux.conf |
| ## BASIC | |
| alias x='exit' | |
| alias c='clear' | |
| alias ll='ls -lh' # List files/dirs, `-l` with more details, `-h` show filesize in human-readable format | |
| alias grep='grep --color=auto' # COLORSS! | |
| ## Routine | |
| alias update='sudo apt update && apt list --upgradeable' # Check for updates | |
| alias upgrade='sudo apt upgrade --auto-remove' # Install those updates | |
| alias autoremove='sudo apt autoremove && sudo apt autoclean' # Run every few months to clear apt cache | |
| alias aptinstall='sudo apt install' # Install something from apt |