74 lines
2.8 KiB
Bash
Executable File
74 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# autoreply config update dialog with no
|
|
if [[ ! -f /etc/apt/apt.conf.d/local ]] ; then
|
|
echo "Dpkg::Options {" >> /etc/apt/apt.conf.d/local
|
|
echo " "--force-confdef";" >> /etc/apt/apt.conf.d/local
|
|
echo " "--force-confold";" >> /etc/apt/apt.conf.d/local
|
|
echo "}" >> /etc/apt/apt.conf.d/local
|
|
fi
|
|
|
|
# update and upgrade
|
|
apt-get update
|
|
apt-get upgrade -y
|
|
|
|
# download and install packages
|
|
apt-get install -y sudo curl wget zip unzip git man-db cifs-utils nfs-common ntfs-3g parted libtalloc2 libwbclient0 net-tools gnupg apt-transport-https tmux gdisk bash-completion
|
|
|
|
# update templates
|
|
pveam update
|
|
|
|
# remove all motd
|
|
rm /etc/motd > /dev/null 2>&1
|
|
|
|
# set input preferences
|
|
if [[ ! -f /etc/inputrc.bak ]] ; then
|
|
cp /etc/inputrc /etc/inputrc.bak > /dev/null 2>&1
|
|
fi
|
|
rm /etc/inputrc > /dev/null 2>&1
|
|
cp /etc/inputrc.bak /etc/inputrc
|
|
echo "" >> /etc/inputrc
|
|
echo "set completion-ignore-case On" >> /etc/inputrc
|
|
|
|
# set bash preferences and aliases
|
|
if [[ -f /etc/bash.bashrc.default ]] ; then
|
|
mv /etc/bash.bashrc.default /etc/bash.bashrc.bak > /dev/null 2>&1
|
|
fi
|
|
if [[ ! -f /etc/bash.bashrc.bak ]] ; then
|
|
cp /etc/bash.bashrc /etc/bash.bashrc.bak > /dev/null 2>&1
|
|
fi
|
|
rm /etc/bash.bashrc > /dev/null 2>&1
|
|
cp /etc/bash.bashrc.bak /etc/bash.bashrc
|
|
echo "" >> /etc/bash.bashrc
|
|
echo "# custom settings and aliases" >> /etc/bash.bashrc
|
|
echo "set -o noclobber" >> /etc/bash.bashrc
|
|
echo "alias lsa='ls -alhvF'" >> /etc/bash.bashrc
|
|
echo "alias systart='sudo systemctl start'" >> /etc/bash.bashrc
|
|
echo "alias systop='sudo systemctl stop'" >> /etc/bash.bashrc
|
|
echo "alias sysrest='sudo systemctl restart'" >> /etc/bash.bashrc
|
|
echo "alias systat='sudo systemctl status'" >> /etc/bash.bashrc
|
|
echo "alias aptupy='sudo apt update && sudo apt upgrade -y'" >> /etc/bash.bashrc
|
|
echo "alias aptiy='sudo apt install -y'" >> /etc/bash.bashrc
|
|
echo "alias aptry='sudo apt remove -y'" >> /etc/bash.bashrc
|
|
echo "alias aptrpy='sudo apt remove --purge -y'" >> /etc/bash.bashrc
|
|
echo "alias aptary='sudo apt autoremove -y'" >> /etc/bash.bashrc
|
|
echo "alias apts='sudo apt search'" >> /etc/bash.bashrc
|
|
echo "alias aptl='sudo apt list --installed'" >> /etc/bash.bashrc
|
|
echo "alias aptsh='sudo apt show'" >> /etc/bash.bashrc
|
|
echo "alias aptac='sudo apt-get autoclean'" >> /etc/bash.bashrc
|
|
echo "alias dpkgi='sudo dpkg -i'" >> /etc/bash.bashrc
|
|
echo "alias tmxls='tmux ls'" >> /etc/bash.bashrc
|
|
echo "alias tmxa='tmux attach -t'" >> /etc/bash.bashrc
|
|
|
|
# create tmux config
|
|
rm /etc/tmux.conf* > /dev/null 2>&1
|
|
echo "unbind C-b" >> /etc/tmux.conf
|
|
echo "set-option -g prefix C-a" >> /etc/tmux.conf
|
|
echo "bind-key C-a send-prefix" >> /etc/tmux.conf
|
|
|
|
# git config
|
|
git config --global credential.helper store
|
|
git config --global user.name "akanealw"
|
|
git config --global user.email "akanealw@gmail.com"
|
|
git config --global init.defaultBranch main
|