Merge branch 'master' of ssh://git.jrosset.ovh:4357/jrosset/consoleConfig

master
Julien Rosset 9 months ago
commit 2eab0ccc42

@ -17,7 +17,10 @@ autocmd BufEnter *.yml " Yml
\ set shiftwidth=4|
\ set expandtab
autocmd BufEnter gitconfig set syntax=gitconfig " Git
autocmd BufEnter gitconfig set syntax=gitconfig " Git
autocmd BufEnter .gitconfig.local set syntax=gitconfig " Git
autocmd BufEnter .ftpaccess set syntax=apachestyle
autocmd BufEnter *.vim set foldmethod=marker " Vim

@ -85,6 +85,8 @@ export MOZILLA_FIVE_HOME=/usr/lib/mozilla
alias -s pdf='okular'
setopt autocd correctall
setopt RE_MATCH_PCRE
# Alias
alias sudo='sudo ' # Permet d'utiliser les alias avec sudo
alias ls='ls --color=auto --group-directories-first -Fh'
@ -113,3 +115,30 @@ find_php() {
fi
find $arg_path -type f -iname "*.php" -print0 | xargs --null grep $arg_options $1
}
# fix_owning [<user>:current user (/home)] [<group>:www-data] [<dir>]
fix_owning() {
if [[ "$PWD" =~ '^(?:/mnt/part1/liens)?/home/([a-zA_Z0-9_]+)/' ]]; then
readonly user=${1:-$match[1]}
else
readonly user=${1:?"Please provide a user name"}
fi
readonly group=${2:-"www-data"}
readonly dir=${3:-"."}
sudo chown -Rvf $user:$group $dir
}
# fix_rights_dir [<rights>] [<dir>]
fix_rights_dir() {
readonly rights=${1:-"775"}
readonly dir=${2:-"."}
sudo find $dir -type d -exec chmod -vf $rights {} \;
}
# fix_rights_file [<rights>] [<dir>]
fix_rights_file() {
readonly rights=${1:-"664"}
readonly dir=${2:-"."}
sudo find $dir -type f -exec chmod -vf $rights {} \;
}

Loading…
Cancel
Save