mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.3 KiB
69 lines
1.3 KiB
5 years ago
|
#!/usr/bin/env bash
|
||
6 years ago
|
|
||
|
# Configure Terminal
|
||
|
|
||
5 years ago
|
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
|
||
|
cd $script_dir
|
||
6 years ago
|
. set.sh
|
||
|
|
||
|
# Makes bash case-insensitive
|
||
|
cat <<EOF>> /etc/inputrc
|
||
5 years ago
|
set completion-ignore-case
|
||
|
set show-all-if-ambiguous On
|
||
|
set show-all-if-unmodified On
|
||
6 years ago
|
EOF
|
||
|
|
||
|
# Enhance Linux prompt
|
||
|
cat <<EOF> /etc/issue
|
||
|
Kernel build: \v
|
||
|
Kernel package: \r
|
||
|
Date: \d \t
|
||
|
IP address: \4
|
||
|
Terminal: \l@\n.\O
|
||
|
|
||
|
EOF
|
||
|
|
||
|
# Enable Bash completion
|
||
|
apt-get -y install bash-completion
|
||
|
|
||
|
cat <<EOF>> /etc/bash.bashrc
|
||
|
if ! shopt -oq posix; then
|
||
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||
|
. /usr/share/bash-completion/bash_completion
|
||
|
elif [ -f /etc/bash_completion ]; then
|
||
|
. /etc/bash_completion
|
||
|
fi
|
||
|
fi
|
||
|
EOF
|
||
|
|
||
|
# Set-up all users
|
||
5 years ago
|
for dir in $(ls -1d /root /home/* 2>/dev/null ||:)
|
||
6 years ago
|
do
|
||
|
# Hide login informations
|
||
5 years ago
|
touch $dir/.hushlogin
|
||
6 years ago
|
|
||
|
# Add convenient aliases & behaviors
|
||
5 years ago
|
cat <<-'EOF'>> $dir/.bashrc
|
||
5 years ago
|
export LS_OPTIONS="--color=auto"
|
||
|
eval "`dircolors`"
|
||
|
|
||
6 years ago
|
alias df="df --si"
|
||
|
alias du="du -cs --si"
|
||
|
alias free="free -h --si"
|
||
5 years ago
|
alias l="ls $LS_OPTIONS -al --si"
|
||
|
alias less="less -i"
|
||
|
alias nano="nano -clDOST4"
|
||
6 years ago
|
alias pstree="pstree -palU"
|
||
5 years ago
|
|
||
|
GOPATH=$HOME/go
|
||
|
HISTCONTROL=ignoreboth
|
||
|
HISTFILESIZE=
|
||
|
HISTSIZE=
|
||
|
HISTTIMEFORMAT="%F %T "
|
||
6 years ago
|
EOF
|
||
|
|
||
|
# Fix rights
|
||
5 years ago
|
usr=$(echo "$dir" | rev | cut -d/ -f1 | rev)
|
||
|
chown -R $usr:$usr $dir ||:
|
||
6 years ago
|
done
|