gitea repo
This commit is contained in:
commit
f610209aff
66 changed files with 2439 additions and 0 deletions
23
dotfiles/bash_files/all_hosts/bashrc
Normal file
23
dotfiles/bash_files/all_hosts/bashrc
Normal file
|
@ -0,0 +1,23 @@
|
|||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
#dont put duplicate lines or lines starting with space in the history
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
HISTFILESIZE=-1
|
||||
HISTSIZE=-1
|
||||
export PROMPT_COMMAND='history -a'
|
||||
|
||||
if [ -f ~/.bash_local ]; then
|
||||
. ~/.bash_local
|
||||
fi
|
||||
|
||||
|
||||
PS1="\[\e[32m\][\[\e[m\]\[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]\[\e[32m\]]\[\e[m\]\[\e[34m\]\W\[\e[m\]\[\e[36m\]\\$\[\e[m\] "
|
||||
if [ ! -z "$SSH_CLIENT" ]
|
||||
then
|
||||
PS1="\[\e[32m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]\[\e[31m\]@\[\e[m\]\[\e[31m\]\h\[\e[m\]\[\e[32m\]]\[\e[m\]\[\e[34m\]\W\[\e[m\]\[\e[36m\]\\$\[\e[m\] "
|
||||
fi
|
||||
|
||||
export PATH=$PATH:$HOME/bin
|
||||
|
19
dotfiles/bash_files/all_hosts/config
Normal file
19
dotfiles/bash_files/all_hosts/config
Normal file
|
@ -0,0 +1,19 @@
|
|||
alias cp="cp -i" # confirm before overwriting something
|
||||
alias df='df -h' # human-readable sizes
|
||||
alias free='free -m' # show sizes in MB
|
||||
alias du='du -h'
|
||||
alias diff='diff --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias ip='ip -color=auto'
|
||||
alias ls='ls --color=auto'
|
||||
alias vm='mv'
|
||||
alias cat='bat -pp'
|
||||
alias ll="ls -lhA"
|
||||
|
||||
rnd() {
|
||||
echo $((RANDOM%10000+1000))
|
||||
}
|
||||
|
||||
### NIX ###
|
||||
alias rebuild="sudo nixos-rebuild switch --flake ~/nixos#$NIXHOST"
|
||||
alias search="nix search nixpkgs"
|
38
dotfiles/bash_files/desk/docker
Normal file
38
dotfiles/bash_files/desk/docker
Normal file
|
@ -0,0 +1,38 @@
|
|||
### Docker ###
|
||||
alias dps="docker ps --format '{{.Names}}'"
|
||||
|
||||
d_term(){
|
||||
docker exec -it $1 /bin/bash
|
||||
}
|
||||
|
||||
d_up(){
|
||||
path=~/docker
|
||||
if [[ -z "$1" && $(pwd) == "$path/"* ]]; then
|
||||
docker compose up -d
|
||||
elif [[ -z "$1" && $(pwd) != "$path/"* ]]; then
|
||||
echo "not in compose folder"
|
||||
elif [[ -n "$1" ]]; then
|
||||
if ls "$path" | grep -q "$1"; then
|
||||
(cd "$path/$1" && docker compose up -d)
|
||||
else
|
||||
echo "container $1 not found"
|
||||
ls "$path"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
d_down(){
|
||||
path=~/docker
|
||||
if [[ -z "$1" && $(pwd) == "$path/"* ]]; then
|
||||
docker compose down
|
||||
elif [[ -z "$1" && $(pwd) != "$path/"* ]]; then
|
||||
echo "not in compose folder"
|
||||
elif [[ -n "$1" ]]; then
|
||||
if ls "$path" | grep -q "$1"; then
|
||||
(cd "$path/$1" && docker compose down)
|
||||
else
|
||||
echo "container $1 not found"
|
||||
ls "$path"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
23
dotfiles/bash_files/desk/methods
Normal file
23
dotfiles/bash_files/desk/methods
Normal file
|
@ -0,0 +1,23 @@
|
|||
mp(){
|
||||
nohup mousepad $1 </dev/null >/dev/null 2>&1 &
|
||||
disown
|
||||
}
|
||||
|
||||
cs(){
|
||||
# cp -l fullpath fullpath/Documents/cheatsheet
|
||||
# path=~/Documents/cheatsheet
|
||||
path=/solid/dir/reference/cheatsheet/
|
||||
if [[ -z "$1" ]]; then
|
||||
ls $path
|
||||
else
|
||||
if [[ $2 = "-e" ]]; then
|
||||
vim $path/$1
|
||||
else
|
||||
bat -pp $path/$1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
timer(){
|
||||
while true; do printf '%s\r' "$(date)"; done
|
||||
}
|
7
dotfiles/bash_files/desk/shortcuts
Normal file
7
dotfiles/bash_files/desk/shortcuts
Normal file
|
@ -0,0 +1,7 @@
|
|||
alias ctllist="systemctl --type=service"
|
||||
alias esc='setxkbmap -option "caps:swapescape"'
|
||||
alias checkip="curl ipinfo.io"
|
||||
alias hold='hold=$(pwd)'
|
||||
|
||||
alias ollama_up="./scripts/VM/VMmanager.sh macvtap; sudo virsh start ollama_vm"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue