This commit is contained in:
aynic.os
2021-06-16 12:19:52 +01:00
parent f0c10a3082
commit ce449b3966
80 changed files with 828 additions and 448 deletions
+18
View File
@@ -0,0 +1,18 @@
# ~/.bash_profile: executed by the command interpreter for bash login shell.
[ -f ~/.profile ] && source ~/.profile
# bash-completion
if ! shopt -oq posix && [ -z "${BASH_COMPLETION_VERSINFO-}" ]; then
if [ ${BASH_VERSINFO[0]} -gt 4 ] \
|| [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
shopt -q progcomp && for file in \
/{*/local,usr}/share/bash-completion/bash_completion \
/etc/bash_completion; do
[ -r "$file" ] && . "$file"
done
fi
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ]; then
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
fi
fi
@@ -0,0 +1,7 @@
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
@@ -0,0 +1 @@
alias ctop='docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock:ro quay.io/vektorlab/ctop:latest'
+38
View File
@@ -0,0 +1,38 @@
# ~/.profile: executed by the command interpreter for login shells.
# set -x
umask 027
# source ~/.*aliases and ~/.*functions files
for source in aliases functions; do
for file in "$HOME"/.*"$source"; do
[ -f "$file" ] || continue
# remove $HOME/. prefix from file
file="${file#${HOME}/.}"
# remove _$source suffix from $file
command="${file%_$source}"
# source file if command exists, ie ~/.bash_aliases
command -v "$command" >/dev/null 2>&1 && . "${HOME}/.$file"
# remove $source suffix from $file, ie ~/.aliases
command="${file%$source}"
# source file if command empty, ie ~/.aliases
[ -z "$command" ] && . "${HOME}/.$file"
done
done
# source ~/.*shrc
for file in "$HOME"/.*shrc; do
[ -f "$file" ] || continue
# remove $HOME/. prefix from file
file="${file#${HOME}/.}"
# source file if match current shell
[ "$(basename ${SHELL})" = "${file%rc}" ] && . "${HOME}/.$file"
done
# set PATH to include user's bin
for path in /*/local/sbin /*/local/bin /*/local/*/bin "${HOME}"/.*/bin; do
[ -d "$path" ] || continue
case ":${PATH}:" in
*:"$path":*) ;;
*) export PATH="${path}:$PATH" ;;
esac
done
+8
View File
@@ -0,0 +1,8 @@
alias DELETE='resty-delete'
alias GET='resty-get'
alias HEAD='resty-head'
alias OPTIONS='resty-options'
alias PATCH='resty-patch'
alias POST='resty-post'
alias PUT='resty-put'
alias TRACE='resty-trace'
+2
View File
@@ -0,0 +1,2 @@
gam () { "~/.gam/gam" "$@" ; }
gyb () { "~/.gyb/gyb" "$@" ; }
+5
View File
@@ -0,0 +1,5 @@
export EDITOR=vim
export GIT_PS1_SHOWUPSTREAM=auto
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_HIDE_IF_PWD_IGNORED=true
export PAGER=less
+1
View File
@@ -0,0 +1 @@
alias vi='vim'
@@ -1,11 +1,11 @@
# shellcheck shell=sh
## rc.sh calls user defined functions
# author: Yann "aya" Autissier
# license: MIT
# updated: 2021/03/04
# file rc.sh: Call user defined functions
## author: Yann "aya" Autissier
## license: MIT
## version: 20210620
case $- in
# if we are in an interactive shell
# if this is an interactive shell
*i*)
# load user stuff from ~/.rc.d/* files
for file in "${HOME}"/.rc.d/*; do
@@ -41,3 +41,5 @@ case $- in
unset IFS
;;
esac
# vim:ts=2:sw=2:sts=2:et
@@ -1,10 +1,10 @@
# shellcheck shell=sh
## rc_function.sh defines customs shell functions
# author: Yann "aya" Autissier
# license: MIT
# updated: 2021/03/04
# file rc_functions.sh: Define shell functions
## author: Yann "aya" Autissier
## license: MIT
## version: 20210620
## force() runs a command sine die
# function force: Run a command sine die
force() {
if [ $# -gt 0 ]; then
while true; do
@@ -14,7 +14,7 @@ force() {
fi
}
## force8() runs a command sine die if not already running
# function force8: Run a command sine die if not already running
force8() {
if [ $# -gt 0 ]; then
while true; do
@@ -38,13 +38,13 @@ force8() {
fi
}
## load_average() prints the current load average
# function load_average; Print the current load average
load_average() {
awk '{printf "%.1f\n" $1}' /proc/loadavg 2>/dev/null\
|| uptime 2>/dev/null |awk '{printf "%.1f\n", $(NF-2)}'
}
## process_count() prints number of "processes"/"running processes"/"D-state"
# function process_count: Print number of "processes"/"running processes"/"D-state"
process_count() {
ps ax -o stat 2>/dev/null |awk '
$1 ~ /R/ {process_running++};
@@ -52,7 +52,7 @@ process_count() {
END { print NR-1"/"process_running+0"/"process_dstate+0; }'
}
## prompt_set() exports custom PROMPT_COMMAND
# function prompt_set: Export custom PROMPT_COMMAND
prompt_set() {
case "${TERM}" in
screen*)
@@ -81,7 +81,7 @@ prompt_set() {
unset ESCAPE_CODE_DCS ESCAPE_CODE_ST
}
## ps1_set() exports custom PS1
# function ps1_set: Export custom PS1
ps1_set() {
case "$0" in
*sh)
@@ -164,7 +164,7 @@ ps1_set() {
PS1_USER PS1_USER_COLOR PS1_STATUS PS1_WORKDIR
}
## screen_attach() attaches existing screen session or creates a new one
# function screen_attach: Attach existing screen session or Create a new one
screen_attach() {
command -v screen >/dev/null 2>&1 || return
SCREEN_SESSION="$(id -nu)@$(hostname |sed 's/\..*//')"
@@ -182,12 +182,12 @@ screen_attach() {
unset SCREEN_SESSION
}
## screen_detach() detaches current screen session
# function screen_detach: Detach current screen session
screen_detach() {
screen -d
}
## ssh_add() loads all private keys in ~/.ssh/ to ssh agent
# function ssh_add: Load all private keys in ~/.ssh/ to ssh agent
ssh_add() {
command -v ssh-agent >/dev/null 2>&1 && command -v ssh-add >/dev/null 2>&1 || return
SSH_AGENT_DIR="/tmp/ssh-$(id -u)"
@@ -224,7 +224,7 @@ ssh_add() {
unset GREP_RECURSIVE_CHAR GREP_RECURSIVE_FLAG SSH_AGENT_DIR SSH_AGENT_SOCK SSH_PRIVATE_KEYS
}
## ssh_del() removes all private keys in ~/.ssh/ from ssh agent
# function ssh_del: removes all private keys in ~/.ssh/ from ssh agent
ssh_del() {
command -v ssh-add >/dev/null 2>&1 || return
# attach to agent
@@ -250,7 +250,7 @@ ssh_del() {
unset GREP_RECURSIVE_CHAR GREP_RECURSIVE_FLAG SSH_PRIVATE_KEYS
}
## tmux_attach() attaches existing tmux session or creates a new one
# function tmux_attach: Attach existing tmux session or Create a new one
tmux_attach() {
command -v tmux >/dev/null 2>&1 || return
TMUX_SESSION="$(id -nu)@$(hostname |sed 's/\..*//')"
@@ -263,12 +263,12 @@ tmux_attach() {
unset TMUX_SESSION
}
## tmux_detach() detaches current tmux session
# function tmux_detach: Detach current tmux session
tmux_detach() {
tmux detach
}
## user_count() prints number of "users sessions"/"users"/"logged users"
# function user_count: Print number of "users sessions"/"users"/"logged users"
user_count() {
ps ax -o user,tty 2>/dev/null |awk '
$2 ~ /^(pts|tty)/ { users_session++; logged[$1]++; };
@@ -1 +0,0 @@
github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==