mirror of
https://codeberg.org/vlw/dotfiles.git
synced 2025-09-13 19:03:40 +02:00
style(bash): clean up aliases and add section comments (#26)
Reviewed-on: https://codeberg.org/vlw/dotfiles/pulls/26
This commit is contained in:
parent
d7c6d4c783
commit
2f189c3cc0
1 changed files with 22 additions and 14 deletions
|
@ -1,7 +1,11 @@
|
||||||
# Make dir and cd into it
|
# Change PHP CLI binary
|
||||||
mkcdir () {
|
alias phpa="sudo update-alternatives --config php"
|
||||||
mkdir -p -- "$1" && cd -P -- "$1"
|
# Kill all code-server processes. Sometimes it hangs on startup
|
||||||
}
|
alias kvscode="ps uxa | grep .vscode-server | awk '{print $2}' | xargs kill -9"
|
||||||
|
|
||||||
|
# +-------------------+
|
||||||
|
# | Directory & Files |
|
||||||
|
# +-------------------+
|
||||||
|
|
||||||
# Preview contents of a file or list the contents of a directory
|
# Preview contents of a file or list the contents of a directory
|
||||||
l () {
|
l () {
|
||||||
|
@ -45,6 +49,15 @@ cdll () {
|
||||||
cp -P -- "$1" && ll
|
cp -P -- "$1" && ll
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Make a new directory and cd into it
|
||||||
|
mkcdir () {
|
||||||
|
mkdir -p -- "$1" && cd -P -- "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# +-----+
|
||||||
|
# | Git |
|
||||||
|
# +-----+
|
||||||
|
|
||||||
# Short-hands for various git functions
|
# Short-hands for various git functions
|
||||||
gitf () {
|
gitf () {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -84,19 +97,14 @@ gitf () {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# +-----+
|
||||||
|
# | SSH |
|
||||||
|
# +-----+
|
||||||
|
|
||||||
# SSH to machine in debug mode at local.vlw.se
|
# SSH to machine in debug mode at local.vlw.se
|
||||||
sshl () {
|
sshl () {
|
||||||
# Set login name from first argument or default to current user
|
# Set login name from first argument or default to current user
|
||||||
local user="${1:-$(whoami)}"
|
local user="${1:-$(whoami)}"
|
||||||
|
|
||||||
ssh -p 2222 "$user"@local.vlw.se
|
ssh -p 2222 "$user"@local.vlw.se
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate random 16byte HEX
|
|
||||||
alias rng16="head -c 16 /dev/random | xxd -p"
|
|
||||||
|
|
||||||
# Kill VSCode processes
|
|
||||||
alias killvscode="ps uxa | grep .vscode-server | awk '{print $2}' | xargs kill -9"
|
|
||||||
|
|
||||||
# Change PHP CLI binary
|
|
||||||
alias chphp="sudo update-alternatives --config php"
|
|
Loading…
Add table
Reference in a new issue