2023-08-07 11:05:54 +05:00
|
|
|
|
|
|
|
# vars
|
|
|
|
PATH=$HOME/.scripts:/opt:/home/shihaam/.local/bin:$HOME/.shortcuts/wineprograms:$HOME/Applications:$PATH
|
2022-11-19 01:23:53 +05:00
|
|
|
HISTSIZE=999999
|
|
|
|
HISTFILESIZE=999999
|
2023-08-20 11:26:07 +05:00
|
|
|
HISTCONTROL=ignoreboth:erasedups
|
2023-01-09 13:42:55 +05:00
|
|
|
|
2023-01-09 13:27:29 +05:00
|
|
|
export GPG_TTY=$(tty) #Set GPG_TTY veriable, needed for signing git commits other gpg stuff
|
2022-11-19 01:23:53 +05:00
|
|
|
|
2023-03-13 09:19:24 +05:00
|
|
|
#export SSH_CA_FILES=/home/shihaam/git/alliedmaldives/ops/ssh-ca
|
2023-08-07 11:05:54 +05:00
|
|
|
export SSH_CA_FILES=$HOME/.ssh
|
2023-03-13 09:19:24 +05:00
|
|
|
export SSH_CA_REVOCATION_LIST=$HOME/git/alliedmaldives/ops/ssh-ca/revoked_keys
|
2023-08-07 11:05:54 +05:00
|
|
|
export SSL_FILES=$HOME/git/alliedmaldives/ops/ssl-certs
|
2022-11-19 01:23:53 +05:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
2022-12-14 20:38:29 +05:00
|
|
|
|
2023-01-09 13:27:29 +05:00
|
|
|
####### ALIASES ##########
|
2023-08-07 11:05:54 +05:00
|
|
|
alias nano='nano -l'
|
2022-11-19 01:25:36 +05:00
|
|
|
alias hdd='cd /mnt/hdd'
|
2023-08-07 11:05:54 +05:00
|
|
|
alias drag=ripdrag
|
2023-01-09 13:27:29 +05:00
|
|
|
#########################
|
|
|
|
|
2022-11-19 01:23:53 +05:00
|
|
|
|
2022-12-14 20:38:29 +05:00
|
|
|
#Adding output colors
|
|
|
|
alias ls='ls --color=always'
|
2023-01-09 13:27:29 +05:00
|
|
|
alias grep='grep --color=auto'
|
2022-12-14 20:38:29 +05:00
|
|
|
alias less='less -R'
|
|
|
|
|
2022-11-19 01:23:53 +05:00
|
|
|
|
2023-01-09 13:27:29 +05:00
|
|
|
##################### Some cool funcations hehe ###############################
|
|
|
|
# do math in shell
|
2022-11-19 01:23:53 +05:00
|
|
|
math(){ echo $1 | bc;}
|
2023-01-09 13:27:29 +05:00
|
|
|
# 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);}
|
2023-03-13 09:19:24 +05:00
|
|
|
#root(){ su -c "$@";}
|
|
|
|
# view md file on cli
|
|
|
|
catmd() { pandoc $1 | lynx -stdin;}
|
2023-03-22 15:09:25 +05:00
|
|
|
# replace white spaces in file name with underscores
|
|
|
|
rmspace() { for file in *; do mv -- "$file" "${file// /_}"; done;}
|
2023-01-09 13:27:29 +05:00
|
|
|
###############################################################################
|
|
|
|
|
2023-03-19 09:15:58 +05:00
|
|
|
### 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
|
|
|
|
}
|
|
|
|
|
2022-11-19 01:23:53 +05:00
|
|
|
|
|
|
|
#load neofetch
|
2023-03-13 09:19:24 +05:00
|
|
|
#neofetch
|