-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_aliases
More file actions
71 lines (52 loc) · 3.61 KB
/
Copy path.bash_aliases
File metadata and controls
71 lines (52 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
# Do not allow deletion of content at the root level, /, and prompt the user once before removing more than three files or when removing files and directories recursively.
alias rm='rm -I -v --preserve-root'
# Enable common command confirmations with additional verbosity.
alias mv='mv -iv'
alias cp='cp -iv'
alias ln='ln -i'
# Enable color output on common commands.
alias ip='ip --color=auto'
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# List content, including hidden files and folders, of a directory in long format.
alias ll='ls -A -F -b -h -l -v --time-style=long-iso'
# Enable a traditional login shell when using sudo or su.
alias root='sudo -i'
alias su='sudo -i'
# Clear out the bash history and clear the screen.
alias scram='history -c; clear; /usr/bin/env rm -rf ${XDG_DATA_HOME}/nvim/shada/ ${XDG_DATA_HOME}/nvim/undo/; /usr/bin/env rm -rf ${XDG_CACHE_HOME}/'
# Find the top 5 largest files within the current, and sub, directories.
alias findbig='find . -type f -exec ls -lha {} \; | sort --stable --parallel=2 -t" " -k5rh | head -5'
# Quickly find and print the top five processes consuming CPU cycles.
alias pscpu='ps aux | sort --stable --parallel=2 -k3rh | head -n 5'
# Quickly find and print the top five processes consuming memory.
alias psmem='ps aux | sort --stable --parallel=2 -k4rh | head -n 5'
# Show a tree view of all processes owned by the current user.
alias processes='ps xf'
# Create and launch a Debian-based development environment to house most day-to-day development work.
# TODO: Switch from Ubuntu to Debian when it is natively supported in Toolbox.
# TODO: Switch to Ubuntu 26.04 once sudo works as expected in this environment (https://github.com/containers/toolbox/issues/1807)
alias home='toolbox enter --distro ubuntu --release 24.04'
# Update system packages.
alias updateSystem='sudo apt update && sudo apt full-upgrade && sudo apt autoremove'
# Reset our GPG environment to work with a different Yubikey (One Yubikey was removed from the system and another Yubikey key was plugged in.)
alias yubiset='rm -rf ~/.gnupg/private-keys-v1.d/ && gpgconf --kill gpg-agent && gpgconf --launch gpg-agent'
# List file extensions in use, starting at the current working directory and searching recursively.
alias fileExtensions='find . -type f | egrep -i -E -o "\.{1}\w*$" | sort | uniq -c | sort -n'
# Convert each zip file in the current, and sub, directories to a compressed Tar archive.
alias convertDirectoryZips='export -f convertZip && find . -type f -name "*.zip" -not -path "*/.*" -print | xargs -I % bash -c "convertZip \"%\""'
# Create a personal copy of a DVD onto my primary device as backup in case the legally acquired disk is lost or destroyed.
alias backupMyDVD='dvdbackup --mirror --input /dev/dvd --output ~/Videos/ --progress --verbose'
# Shortcut to query LLM via OpenCode in the current directory.
alias agent='opencode run'
# Provision Dev Container workspace from `.devcontainer/` configuration file in the current working directory.
# The `--secret` flag mounts the Devsy-managed OpenCode API key into the workspace as an in-memory file, which
# `install.sh` references from a workspace-only OpenCode config, keeping the plaintext key off
# the container filesystem.
alias workspaceUp='devsy workspace build . --verbose && devsy workspace up . --verbose --secret OPENCODE_KEY,type=mount,target=opencode.key'
# Shutdown and delete the Dev Container workspace for the current working directory.
alias workspaceDown='devsy workspace stop . --verbose && devsy workspace delete . --verbose'