77 lines
2.1 KiB
Bash
77 lines
2.1 KiB
Bash
PATH=$HOME/.scripts:/opt:/home/shihaam/.local/bin:$HOME/.shortcuts/wineprograms:$PATH
|
|
HISTSIZE=999999
|
|
HISTFILESIZE=999999
|
|
|
|
export GPG_TTY=$(tty) #Set GPG_TTY veriable, needed for signing git commits other gpg stuff
|
|
|
|
#export SSH_CA_FILES=/home/shihaam/git/alliedmaldives/ops/ssh-ca
|
|
export SSH_CA_FILES=/home/shihaam/.ssh
|
|
export SSH_CA_REVOCATION_LIST=$HOME/git/alliedmaldives/ops/ssh-ca/revoked_keys
|
|
export SSL_FILES=/home/shihaam/ssl/allied
|
|
|
|
#load ble.sh
|
|
source ~/.local/share/blesh/ble.sh
|
|
|
|
#load seafly prompt
|
|
source ~/.bash-seafly-prompt/command_prompt.bash
|
|
|
|
|
|
#always open last dir
|
|
cd(){ builtin cd "$@" && pwd > ~/.cache/whereami;}
|
|
cdl(){ cd $(cat ~/.cache/whereami);};cdl
|
|
|
|
|
|
####### ALIASES ##########
|
|
alias nano='nano -i'
|
|
alias hdd='cd /mnt/hdd'
|
|
#########################
|
|
|
|
|
|
#Adding output colors
|
|
alias ls='ls --color=always'
|
|
alias grep='grep --color=auto'
|
|
alias less='less -R'
|
|
|
|
|
|
##################### Some cool funcations hehe ###############################
|
|
# do math in shell
|
|
math(){ echo $1 | bc;}
|
|
# Simpleway to see IP resolved to DNS record
|
|
checkip(){ dig $1 +short;}
|
|
# search for term and edit first file with that specific text
|
|
edit(){ nano $(grep $1 * -R | awk '{print $1}'|cut -f1 -d ':' | head -n1);}
|
|
#root(){ su -c "$@";}
|
|
# view md file on cli
|
|
catmd() { pandoc $1 | lynx -stdin;}
|
|
###############################################################################
|
|
|
|
### Enter container
|
|
#enter () {
|
|
# local container="$(echo "$1" | cut -d'_' -f1)"
|
|
# if docker ps | grep "$container" >/dev/null 2>&1; then
|
|
# docker exec -it "$container" bash
|
|
# elif podman ps | grep "$container" >/dev/null 2>&1; then
|
|
# podman exec -it "$container" bash
|
|
# else
|
|
# echo "Error: Container '$container' not found" >&2
|
|
# return 1
|
|
# fi
|
|
#}
|
|
|
|
enter () {
|
|
local container="$1"
|
|
# local container="$(echo "$1" | cut -d'_' -f1)"
|
|
if docker ps | grep "$container" >/dev/null 2>&1; then
|
|
docker exec -it "$container" bash
|
|
elif podman ps | grep "$container" >/dev/null 2>&1; then
|
|
podman exec -it "$container" bash
|
|
else
|
|
echo "Error: Container '$container' not found" >&2
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
|
|
#load neofetch
|
|
#neofetch
|