Skip to content

Commit

Permalink
fix: function names on shell scripts
Browse files Browse the repository at this point in the history
This also contains updating the copyright notice, fixing some
comments typos, and new config for ignoring environment variables.
  • Loading branch information
mdsanima committed Jan 3, 2024
1 parent bd889a8 commit 32a481e
Show file tree
Hide file tree
Showing 17 changed files with 320 additions and 228 deletions.
41 changes: 22 additions & 19 deletions .aliases
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
# Copyright © 2023 MDSANIMA
# Copyright (c) 2023-2024 MDSANIMA DEV. All rights reserved.
# Licensed under the MIT license.

# Custom alias definitions. This file must be include on `.bashrc` file.
# Custom alias definitions. This file must be included in the `.bashrc` file for
# proper functioning.

# Aliases for SSH connection to my home lab host.
alias rpi0='ssh [email protected]'
alias rpi1='ssh [email protected]'
alias rpi2='ssh [email protected]'
alias rpi3='ssh [email protected]'
alias rpi4='ssh [email protected]'
alias rpi5='ssh [email protected]'
alias rpi6='ssh [email protected]'
alias rpi7='ssh [email protected]'
alias jet1='ssh [email protected]'
alias jet2='ssh [email protected]'
alias macb='ssh [email protected]'

# Aliases for the weather script.
alias weahter='mdsanima-weather'
alias pogoda='mdsanima-weather'
# Aliases for SSH connection to my Home Labs hosts
alias rpi0="ssh [email protected]"
alias rpi1="ssh [email protected]"
alias rpi2="ssh [email protected]"
alias rpi3="ssh [email protected]"
alias rpi4="ssh [email protected]"
alias rpi5="ssh [email protected]"
alias rpi6="ssh [email protected]"
alias rpi7="ssh [email protected]"
alias jet1="ssh [email protected]"
alias jet2="ssh [email protected]"
alias macb="ssh [email protected]"

# Aliases for the K3S Clusters.
alias k='kubectl'
# Aliases for the weather script
alias weahter="mdsanima-weather"
alias pogoda="mdsanima-weather"

# Aliases for the Kubernetes Cluster
alias k="kubectl"
79 changes: 40 additions & 39 deletions .bashrc
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
# Copyright © 2023 MDSANIMA
# Copyright (c) 2023-2024 MDSANIMA DEV. All rights reserved.
# Licensed under the MIT license.

# Custom config `.bashrc` file for Ubuntu. You can use this script on all
# available hosts in the home labs network and a cloud servers thats you have.
# This is a custom configuration `.bashrc` file for Linux system. You can use
# this script for all available hosts in your network.

# Python script WARNING which is not on PATCH.

# Python script `WARNING` which is not on $PATH
export PATH=$HOME/.local/bin:$PATH

# If not running interactively, don't do anything.
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# Don't put duplicate lines or lines starting with space in the history.
# Don't put duplicate lines or lines starting with space in the history
HISTCONTROL=ignoreboth

# Append to the history file, don't overwrite it.
# Append to the history file, don't overwrite it
shopt -s histappend

# History settings.
HISTSIZE=50000 # History lines stored in memory.
HISTFILESIZE=20000 # History lines stored on disk.
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S " # Adding date time before each commands.
# History settings
HISTSIZE=50000 # History lines stored in memory
HISTFILESIZE=20000 # History lines stored on disk
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S " # Adding date time before each commands

# Check the window size after each command and, if necessary, update the values
# of LINES and COLUMNS.
# Check the window size after each command
shopt -s checkwinsize

# Make less more friendly for non-text input files.
# Make less more friendly for non-text input files
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# Set variable identifying the chroot you work in used in the prompt below.
# Set variable identifying the chroot you work in used in the prompt below
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# Set a fancy prompt non-color.
# Set a fancy prompt non-color
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac

# Shell color prompt.
# Shell color prompt
force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
Expand All @@ -52,13 +53,13 @@ if [ -n "$force_color_prompt" ]; then
fi

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\n\$ '
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\n\$ "
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\n\$ '
PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\n\$ "
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir on host.
# If this is an xterm set the title to user@host:dir on host
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
Expand All @@ -67,30 +68,30 @@ xterm*|rxvt*)
;;
esac

# Enable color support of ls and also add handy aliases.
# Enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias ls="ls --color=auto"
alias grep="grep --color=auto"
alias dir="dir --color=auto"
alias vdir="vdir --color=auto"

alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep="fgrep --color=auto"
alias egrep="egrep --color=auto"
fi

# Colored GCC warnings and errors.
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# Colored GCC warnings and errors
export GCC_COLORS="error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01"

# Some more ls aliases.
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Some more ls aliases
alias ll="ls -alF"
alias la="ls -A"
alias l="ls -CF"

# Add an alert alias for long running commands.
# Add an alert alias for long running commands
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Enable programmable completion features.
# Enable programmable completion features
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
Expand All @@ -99,18 +100,18 @@ if ! shopt -oq posix; then
fi
fi

# Cuda toolkit `nvcc` path on nVidia Jetson Nano.
if [[ $HOST == 'jet-1' || $HOST == 'jet-2' ]]; then
# Cuda toolkit `nvcc` path on nVidia Jetson Nano hosts
if [[ $HOST == "jet-1" || $HOST == "jet-2" ]]; then
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
fi

# Alias definitions from bash.
# Alias definitions for BASH
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# Alias definitions from zsh.
# Alias definitions for ZSH
if [ -f ~/.aliases ]; then
. ~/.aliases
fi
44 changes: 25 additions & 19 deletions .dircolors
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
# Copyright © 2023 MDSANIMA
# Copyright (c) 2023-2024 MDSANIMA DEV. All rights reserved.
# Licensed under the MIT license.

# This ia a custom colors definition for directory and specific files.
# This is a custom configuration for the colors definition for directories and
# specific files.

# Configuration file for dircolors, a utility to help you set the `LS_COLORS`
# environment variable used by GNU ls with the --color option.

# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Copying and distribution of this file, with or without modification,
# are permitted provided the copyright notice and this notice are preserved.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below are TERM entries, which can be a glob patterns, to match
# against the TERM environment variable to determine if it is colorizable.

# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the slackware version of
# dircolors) are recognized but ignored. Below are TERM entries, which can be
# a glob patterns, to match against the TERM environment variable to determine
# if it is colorizable.

# For information on dircolors files refer to dir_colors Linux Man Pages.
# https://www.systutorials.com/docs/linux/man/5-dir_colors/

# Documentation reference pages.
# http://www.mail-archive.com/[email protected]/msg11030.html

# Standard colors setup configuration info.

# Standard colors configuration information
# Attribute code: 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text code: 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Bacground code: 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white

# 256 colors setup configuration info.
# 256 colors configuration information
# Text code: 38;5;COLOR_NUMBER
# Bacground code: 48;5;COLOR_NUMBER
# Example basic: 48;5;147;01 - lavender background, bold
# Example 256: 48;5;167;38;5;193;04 - red background, lime-green text, underscore

# Term configuration setup.

# Term configuration
TERM Eterm
TERM ansi
TERM *color*
Expand Down Expand Up @@ -63,7 +69,7 @@ TERM tmux*
TERM vt100
TERM xterm*

# Global defaults configuration file formats colors setup.
# Global defaults configuration file formats
RESET 0 # reset to normal color
NORMAL 00 # no color
FILE 00 # normal
Expand All @@ -85,7 +91,7 @@ OTHER_WRITABLE 38;5;42;01 # cyan, bold
STICKY 48;5;67 # blue bg, white
STICKY_OTHER_WRITABLE 48;5;30 # teal bg, white

# Archives or compressed file formats colors setup.
# Archives or compressed file formats
.7z 38;5;147;01 # lavender, bold
.ace 38;5;147;01 # lavender, bold
.alz 38;5;147;01 # lavender, bold
Expand Down Expand Up @@ -135,7 +141,7 @@ STICKY_OTHER_WRITABLE 48;5;30 # teal bg, white
.zoo 38;5;147;01 # lavender, bold
.zst 38;5;147;01 # lavender, bold

# Audio file formats colors setup.
# Audio file formats
.aac 38;5;193 # lime
.au 38;5;193 # lime
.axa 38;5;193 # lime
Expand All @@ -154,7 +160,7 @@ STICKY_OTHER_WRITABLE 48;5;30 # teal bg, white
.wav 38;5;193 # lime
.xspf 38;5;193 # lime

# Image file formats colors setup.
# Image file formats
.bmp 38;5;229 # yellow
.cgm 38;5;229 # yellow
.CR2 38;5;229 # yellow
Expand Down Expand Up @@ -186,7 +192,7 @@ STICKY_OTHER_WRITABLE 48;5;30 # teal bg, white
.xwd 38;5;229 # yellow
.yuv 38;5;229 # yellow

# Video file formats colors setup.
# Video file formats
.anx 38;5;222 # orange
.asf 38;5;222 # orange
.avi 38;5;222 # orange
Expand Down Expand Up @@ -217,7 +223,7 @@ STICKY_OTHER_WRITABLE 48;5;30 # teal bg, white
.webm 38;5;222 # orange
.wmv 38;5;222 # orange

# Other file formats colors setup.
# Other file formats
.c 00 # noraml
.cc 00 # noraml
.cpp 00 # noraml
Expand Down Expand Up @@ -252,7 +258,7 @@ STICKY_OTHER_WRITABLE 48;5;30 # teal bg, white
*readme.txt 00 # noraml
*README.txt 00 # noraml

# Backup and logs uninportant file formats colors setup.
# Backup and logs uninportant file formats
.aux 38;5;248 # gray
.bak 38;5;248 # gray
.bbl 38;5;248 # gray
Expand All @@ -273,7 +279,7 @@ STICKY_OTHER_WRITABLE 48;5;30 # teal bg, white
.tmp 38;5;248 # gray
.toc 38;5;248 # gray

# Custom mdsanima file formats colors setup.
# Custom MDSANIMA file formats
.cfg 38;5;69 # violet
.conf 38;5;11 # yellow
.json 38;5;30 # blue
Expand Down
Loading

0 comments on commit 32a481e

Please sign in to comment.