Normalisation et nettoyage #4
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
function basedir() {
|
||||
(cd "$(dirname \"$-2\")" && pwd)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v bat &>/dev/null); then
|
||||
alias cat=bat
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (which colordiff &> /dev/null)
|
||||
then
|
||||
alias diff=colordiff
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Colors
|
||||
alias ls='ls --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Fun
|
||||
alias matrix='tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=unblock | GREP_COLOR="1;32" grep --color "[^ ]"'
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Cd
|
||||
alias cdup='cd ..'
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Git
|
||||
if [ -x /usr/bin/git ]; then
|
||||
alias gs='git status'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v 'gopass' && ! command -v pass ) &> /dev/null
|
||||
then
|
||||
alias pass='gopass'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# [ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
|
||||
if [ -n "${KITTY_INSTALLATION_DIR}" ]; then
|
||||
alias ssh="kitty +kitten ssh"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v kubectl &>/dev/null); then
|
||||
|
||||
# create some usefull aliases
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v lsd &> /dev/null)
|
||||
then
|
||||
alias ls='lsd'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (which mc &> /dev/null); then
|
||||
if [ "$TERM" = "rxvt-unicode" ]; then
|
||||
alias mc="TERM=rxvt-unicode-256color mc"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Vim Editor
|
||||
if [ -x ~/AppImages/nvim.appimage ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (which ovs-appctl &> /dev/null); then alias appctl='sudo ovs-appctl'; fi
|
||||
if (which ovs-vsctl &> /dev/null); then alias vsctl='sudo ovs-vsctl'; fi
|
||||
if (which ovs-ofctl &> /dev/null); then alias ofctl='sudo ovs-ofctl'; fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Power
|
||||
alias reboot='sudo reboot'
|
||||
alias halt='sudo halt'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Security
|
||||
alias rm='rm -i'
|
||||
alias mv='mv -i'
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
#!/bin/bash
|
||||
|
||||
# SSH
|
||||
alias ssh!='ssh -q -oStrictHostKeyChecking=no -oIdentitiesOnly=yes'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# System tools
|
||||
if [ -f /sbin/ifconfig ] && [ -x /sbin/ifconfig ]; then alias ifconfig='/sbin/ifconfig'; fi
|
||||
if [ -f /sbin/ip ] && [ -x /sbin/ip ]; then alias ip='/sbin/ip'; fi
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
#!/bin/bash
|
||||
|
||||
alias tree='tree -A -C'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Vim Editor
|
||||
if (command -v nvim &> /dev/null)
|
||||
then
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (which zfs &> /dev/null); then alias zfs='sudo zfs'; fi
|
||||
if (which zpool &> /dev/null); then alias zpool='sudo zpool'; fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f "${HOME}"/.nix-profile/etc/profile.d/hm-session-vars.sh ]; then
|
||||
source "${HOME}"/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v aws && command -v aws_completer) &>/dev/null; then
|
||||
complete -C aws_completer aws
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v chezmoi &>/dev/null); then
|
||||
source <(chezmoi completion bash)
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v flux &>/dev/null); then
|
||||
source <(flux completion bash)
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v glab &>/dev/null); then
|
||||
source <(glab completion)
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v helm &> /dev/null)
|
||||
then
|
||||
source <( helm completion bash )
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v k3d &>/dev/null); then
|
||||
source <(k3d completion bash)
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v kind &>/dev/null); then
|
||||
source <(kind completion bash)
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v kubectl &> /dev/null)
|
||||
then
|
||||
source <(kubectl completion bash)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v minikube &>/dev/null); then
|
||||
source <(minikube completion bash)
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v mise &>/dev/null); then
|
||||
source <(mise completion bash --include-bash-completion-lib)
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v podman &>/dev/null); then
|
||||
source <(podman completion bash)
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ( command -v poetry &> /dev/null )
|
||||
then
|
||||
source <(poetry completions bash)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v stern &> /dev/null)
|
||||
then
|
||||
source <(stern --completion bash)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v tea &>/dev/null); then
|
||||
source <(tea completion bash)
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
function devenv() {
|
||||
|
||||
local status
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ANSI CODES
|
||||
#Code Effect
|
||||
#0 All attributes off
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
function ip_to_hex ()
|
||||
{
|
||||
if test -e "$1" ; then echo "Usage : $0 XXX.XXX.XXX.XXX" ; return ; fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
note() {
|
||||
# if file doesn't exist, create it
|
||||
if [[ ! -f $HOME/.notes ]]; then
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
encpasswd() {
|
||||
local password_clear=$1
|
||||
local password_md5hash=$(openssl passwd -1 "$password_clear")
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
function ssh_clean_known_hosts() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "No arguments given. Cleaning ~/.ssh/known_hosts"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
function term_change_title {
|
||||
case $TERM in
|
||||
# Change the window title of X terminals
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
todo() {
|
||||
if [[ ! -f $HOME/.todo ]]; then
|
||||
touch $HOME/.todo
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
function urxvt_set_font
|
||||
{
|
||||
# set font
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
#!/bin/bash
|
||||
|
||||
function prettyxml () { sed -e 's,>,>\n,g'; }
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://github.com/riywo/anyenv
|
||||
|
||||
# git clone https://github.com/riywo/anyenv $HOME/.anyenv
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Customize history format
|
||||
export HISTSIZE=5000
|
||||
export HISTFILESIZE=20000
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v keychain &>/dev/null); then
|
||||
eval "$(keychain --inherit any --quiet --noask ~/.ssh/id_{rsa,ed25519})"
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v krew &>/dev/null); then
|
||||
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define prefered LANG
|
||||
export LANG=fr_FR.UTF-8
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Mail
|
||||
export MAILPATH=~/Mails/
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Customize PATH
|
||||
if [ -d $HOME/.bin ] ; then export PATH=$PATH:$HOME/.bin ; fi
|
||||
if [ -d $HOME/.local/bin ] ; then export PATH=$PATH:$HOME/.local/bin ; fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Proxy
|
||||
if [ -x /usr/bin/tsocks ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Defined prefered applications
|
||||
|
||||
# EDITOR
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ ${BLE_VERSION-} ]] && ble-attach
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ble.sh () installed from nix
|
||||
if (command -v blesh-share &>/dev/null); then
|
||||
source "$(blesh-share)"/ble.sh --attach=none # does not work currently
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v mise &>/dev/null); then
|
||||
|
||||
# activate mise-en-place (https://mise.jdx.dev/)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://github.com/riywo/anyenv
|
||||
|
||||
# git clone https://github.com/riywo/anyenv $HOME/.anyenv
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v broot &>/dev/null); then
|
||||
# This script was automatically generated by the broot program
|
||||
# More information can be found in https://github.com/Canop/broot
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Use cgroups
|
||||
if [ "$PS1" ] ; then
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
|
||||
if [[ -f ~/.dir_colors ]]; then
|
||||
eval `dircolors -b ~/.dir_colors`
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (asdf which direnv &>/dev/null); then
|
||||
# Hook direnv into your shell.
|
||||
eval "$(asdf exec direnv hook bash)"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v fzf &>/dev/null); then
|
||||
|
||||
# Shell integration
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v git && command -v fzf) &>/dev/null; then
|
||||
function gsb { git checkout "$(git branch --all | fzf | tr -d '[:space:]')"; }
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Customize shell history search
|
||||
|
||||
# Indicate your preference order for history tools
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Customize the prompt
|
||||
|
||||
# Indicate your preference order for prompt tools
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load RVM into a shell session *as a function*
|
||||
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# GNU Screen stuff
|
||||
if ( which screen &> /dev/null )
|
||||
then
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to update terminal/tmux title
|
||||
_update_terminal_title() {
|
||||
local kubecontext dir gitrepo gitremote icon title
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# GNU Screen stuff
|
||||
if (command -v tmux &>/dev/null); then
|
||||
if [ "$(pgrep -u "$UID" "tmux" | wc -l)" -gt 0 ]; then
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f ~/software/todo.txt-cli/todo.sh ]; then
|
||||
|
||||
export TODOTXT_DEFAULT_ACTION=ls
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
#URXVT_FONT_NAME="DejaVu Sans Mono"
|
||||
#URXVT_FONT_SIZE=16
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# INFO:
|
||||
# vivid is a generator for the LS_COLORS environment variable that controls the colorized output of ls, tree, fd, bfs, dust and many other tools.
|
||||
# ➜ https://github.com/sharkdp/vivid
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (command -v zoxide &>/dev/null); then
|
||||
eval "$(zoxide init bash)"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user