(refactor) - Refactoring all of dotfiles

(refactor) - Refactoring all of dotfiles
This commit is contained in:
Blake Ridgway 2022-09-15 21:54:36 -05:00 committed by GitHub
commit eb38291092
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 37 additions and 402 deletions

1
.gitignore vendored
View file

@ -1 +0,0 @@
/post_install_rewrite

View file

View file

@ -1,24 +0,0 @@
#!/bin/bash
###########################################
# Setup Docker in Alpine with this Script #
###########################################
# Adds the community repo
sh -c 'echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/community/" >> /etc/apk/repositories'
# Updates apk to include the new repo we just add
echo "Time to Update"
apk -qq update
# Just as it says, it installs Docker to the Machine
echo "Currently installing Docker"
apk add -qq docker
# This section adds Docker dameon to boot
echo "Enabling Docker at Boot"
rc-update add docker boot
# This starts the Docker daemon
echo "Starting Docker"
service docker start

View file

@ -1,20 +0,0 @@
#########################################
# Set up Docker on CentOS based Distros #
#########################################
# Removes older installs of Docker
echo 'Removing older Docker versions'
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
# Set ups the needed repos and deps
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# Installs DockerCE
sudo yum install docker docker-ce docker-ce-cli containerd.io
# Starts Docker
sudo systemctl start docker
# Tests to make sure Docker is running correctly
sudo docker run hello-world

View file

@ -1,34 +0,0 @@
#!/bin/bash
###################################################
# Setup Docker on Debian based installs with this #
###################################################
# Updates apt
echo "Updating Operating System"
apt update -y -qq
# Installs some pre-reqs
echo "Installing needed components for Docker"
apt install -y -qq apt-transport-https ca-certificates curl software-properties-common
# Adds GPG key for the Docker repo
echo "Adding GPGP Key for Docker"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#Add the Docker repository to APT source
echo "Adding Docker repositories"
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
# Updates apt once more
echo "Updating After adding the Dependices"
apt update -y -qq
# Installs Docker
echo "Installing Docker"
apt install -y -qq docker-ce
# Makes sure that docker is started and made to run at boot
echo "Enable Docker at boot and starting Docker"
systemctl enable docker
systemctl start docker

View file

@ -1,9 +0,0 @@
MIT License
Copyright 2019 Blake Ridgway
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,27 +0,0 @@
## Disclaimer
I am still currently learning BASH scripting and this is a new thing to me, I will end up making this script better and more user friendly as time comes.
The option-script.sh works on some of the Operating Systems but not all. I am faulting Dialog on this. I am starting work on getting the script to pull the type of uname the machine has and pull installers that way.
I might have to add a seperate script for AWS Linux machines if my CentOS script doesn't install for the machine
# Set up Docker on Linux Distros & macOS
The main purpose of this script is to be able to quickly install Docker on multiple Linux distros and there is an option to have it install for macOS.
# How to Use Script
How the script is supposed to be ran is to either download the subfolder you wish to install Docker on. The easiest way I suggest to have this ran is to download/clone the repo and run the option-script, this script has options of what you want to install on.
# Improvements
I am currently trying to figure out how to make it so it can auto-detect what OS architecture you are running, which would take out the entire need for user input.
But, that is to come in later revisions of this script.
# Extra
If you have a specific operating system you want added to this, please inform me and I will get it created and added to the script.

View file

@ -1,13 +0,0 @@
#!/bin/bash
echo "Installing Homebrew"
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Install Cask"
# Install Cask
brew install caskroom/cask/brew-cask
echo "Utilizing Cask to install Docker"
# Install docker toolbox
brew cask install docker-toolbox

View file

@ -1,13 +0,0 @@
#############################
# Set up Docker on openSUSE #
#############################
# Utilizes Zypper to install Docker and Docker Compose
echo "Installing Docker and Docker Compose!"
zypper install docker docker-compose
# Enables Docker to start on system boot
echo "Enabling Docker at boot!"
sudo systemctl enable docker

View file

@ -1,45 +0,0 @@
#!/bin/bash
#####################################################
# Option Based Script to Pick what OS to install on #
#####################################################
HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="Docker Installation"
TITLE="Chose your Operating System"
MENU="Choose one of the following options:"
OPTIONS=(1 "Alpine Linux"
2 "Debian"
3 "CentOS"
4 "macOS"
5 "openSUSE")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
sh ./Alpine/alpine-docker.sh
;;
2)
sh ./Debian/debian-docker.sh
;;
3)
sh ./CentOS/centos-docker.sh
;;
4)
sh ./macOS/macos-docker.sh
;;
5)
sh ./openSUSE/opensuse-docker.sh
;;
esac

View file

@ -26,9 +26,6 @@ alias grr="git remote remove origin"
alias gra="git remote add origin "
alias clonerepo="git fetch --all && git pull --all && git clone-branches"
# Bandwhich
alias band="sudo ~/.cargo/bin/bandwhich"
# Python
alias py='python3'
alias py3='python3'
@ -49,9 +46,6 @@ alias rc="rails c"
alias rs="rails s"
alias gi="gem install"
# Rust
alias rcc="rustc"
# Pretty print the path
alias path='echo $PATH | tr -s ":" "\n"'
@ -59,9 +53,6 @@ alias path='echo $PATH | tr -s ":" "\n"'
alias tmuxreload='source ~/.tmux.conf'
alias zshreload='source ~/.zshrc'
# SSH
# alias sshwork='ssh bridgway@0.0.0.0'
# nvim
alias vim=nvim
alias vi=nvim

View file

@ -3,31 +3,36 @@
# Relies on Flatpak to be installed
# Created by Blake Ridgway
# Verify flatpak is engaged properly
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
PACKAGE_LIST=(
dialog
discord
git
go
htop
neofetch
neovim
openjdk-11-jre
python3
python3-pip
solaar
steam
system76-keyboard-configurator
tilix
libvirt-daemon-driver-lxc
virt-manager
vlc
zsh
)
FLATPAK_LIST=(
com.github.fabiocolacio.marker
com.mattermost.Desktop
com.bitwarden.desktop
com.discordapp.Discord
com.jetbrains.GoLand
com.jetbrains.DataGrip
com.obsproject.Studio
net.cozic.joplin_desktop
net.veloren.Airshipper
com.slack.Slack
com.valvesoftware.Steam
net.davidotek.pupgui2
net.veloren.airshipper
org.videolan.VLC
sh.cider.Cider
)
echo #######################
@ -36,10 +41,10 @@ echo #######################
# iterate through package and installs them
for package_name in ${PACKAGE_LIST[@]}; do
if ! sudo apt list --installed | grep -q "^\<$package_name\>"; then
if ! sudo dnf list --installed | grep -q "^\<$package_name\>"; then
echo "Installing $package_name..."
sleep .5
sudo apt install "$package_name" -y
sudo dnf install "$package_name" -y
echo "$package_name has been installed"
else
echo "$package_name already installed"
@ -64,28 +69,6 @@ mkdir -p ~/.local/share/fonts
cp Hack\ Regular\ Nerd\ Font\ Complete.ttf ~/.local/share/fonts/
fc-cache -f -v
echo ##################################
echo # Downloading and Configuring Go #
echo ##################################
# Grabs and downloads Go for Google
wget https://golang.org/dl/go1.17.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.17.2.linux-amd64.tar.gz
echo ###################
echo # Installing Rust #
echo ###################
# Install Rust
curl https://sh.rustup.rs -sSf | sh
echo ######################
echo # Setting up SSH Key #
echo ######################
# SSH Key Gen
ssh-keygen -t ed25519 -C ${USER}@$(hostname --fqdn)
echo ######################
echo # Installing OhMyZSH #
echo ######################
@ -114,24 +97,20 @@ echo ############################
mkdir -p ~/.config/nvim/
echo $'set runtimepath^=~/.vim runtimepath+=~/.vim/after\nlet &packpath=&runtimepath\nsource ~/.vimrc' > ~/.config/nvim/init.vim
# wget https://github.com/OrangeDrangon/android-messages-desktop/releases/download/v5.1.1/AndroidMessages-v5.1.1-linux-amd64.deb
echo #######################
echo # Cleanup and Updates #
echo #######################
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y
sudo dnf upgrade --refresh
flatpak update
echo ################
echo # File Cleanup #
echo ################
rm -r *.ttf *.tar.gz
rm -r *.ttf *.tar.gz *.rpm
FILES=( 'vimrc' 'vim' 'zshrc' 'zsh' 'agignore' 'gitconfig' 'gitignore' 'gitmessage' )
FILES=( 'vimrc' 'vim' 'zshrc' 'zsh' 'agignore' 'gitconfig' 'gitignore' 'gitmessage' 'aliases' )
for file in ${FILES[@]}; do
echo ""
echo "Simlinking $file to $HOME"
@ -145,3 +124,18 @@ for file in ${FILES[@]}; do
fi
done
# Enable RPM Fusion
sudo dnf install \
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install \
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# Enable Mesa aco
sudo dnf copr enable gloriouseggroll/mesa-aco
# Enable fsync kernel
sudo dnf copr enable sentry/kernel-fsync
sudo dnf upgrade --refresh

View file

@ -1,164 +0,0 @@
#!/usr/bin/env bash
# A script for setting up post install
# Relies on Flatpak to be installed
# Created by Blake Ridgway
# Setup all System76 Software
sudo dnf copr enable szydell/system76
sudo dnf install system76-dkms system76-power system76-driver system76-firmware firmware-manager system76-io-dkms system76-acpi-dkms
sudo systemctl enable system76-power system76-power-wake system76-firmware-daemon
sudo systemctl start system76-power system76-firmware-daemon
systemctl enable --user com.system76.FirmwareManager.Notify.timer
# Verify flatpak is engaged properly
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
PACKAGE_LIST=(
dialog
git
htop
neofetch
neovim
java-11-openjdk
python3
python3-pip
solaar
tilix
virt-manager
vlc
zsh
)
FLATPAK_LIST=(
com.discordapp.Discord
com.mattermost.Desktop
com.obsproject.Studio
com.valvesoftware.Steam
net.veloren.airshipper
sh.cider.Cider
)
echo #######################
echo # Installing Packages #
echo #######################
# iterate through package and installs them
for package_name in ${PACKAGE_LIST[@]}; do
if ! sudo dnf list --installed | grep -q "^\<$package_name\>"; then
echo "Installing $package_name..."
sleep .5
sudo dnf install "$package_name" -y
echo "$package_name has been installed"
else
echo "$package_name already installed"
fi
done
for flatpak_name in ${FLATPAK_LIST[@]}; do
if ! flatpak list | grep -q $flatpak_name; then
flatpak install "$flatpak_name" -y
else
echo "$package_name already installed"
fi
done
# git submodule init
# git submodule update --recursive
echo ############
echo # Protonup #
echo ############
pip3 install protonup
echo #####################
echo # Install Nerd Font #
echo #####################
# Nerd Font install
wget https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf
mkdir -p ~/.local/share/fonts
cp Hack\ Regular\ Nerd\ Font\ Complete.ttf ~/.local/share/fonts/
fc-cache -f -v
echo ##################################
echo # Downloading and Configuring Go #
echo ##################################
# Grabs and downloads Go for Google
wget https://go.dev/dl/go1.18.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz
echo ######################
echo # Installing OhMyZSH #
echo ######################
# Oh-my-ZSH
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo ############################
echo # Setting up Powerlevel10k #
echo ############################
# POWERLEVEL10K
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
echo ##################################
echo # Copying p10k Config file to ~/
echo ##################################
# Copy p10k Config file
cp .p10k.zsh ~/
echo ############################
echo # Setting up nvim/init.vim #
echo ############################
mkdir -p ~/.config/nvim/
echo $'set runtimepath^=~/.vim runtimepath+=~/.vim/after\nlet &packpath=&runtimepath\nsource ~/.vimrc' > ~/.config/nvim/init.vim
echo #######################
echo # Cleanup and Updates #
echo #######################
sudo dnf update
flatpak update
echo ################
echo # File Cleanup #
echo ################
rm -r *.ttf *.tar.gz *.rpm
FILES=( 'vimrc' 'vim' 'zshrc' 'zsh' 'agignore' 'gitconfig' 'gitignore' 'gitmessage' 'aliases' )
for file in ${FILES[@]}; do
echo ""
echo "Simlinking $file to $HOME"
ln -sf "$PWD/$file" "$HOME/.$file"
if [ $? -eq 0 ]
then
echo "$PWD/$file ~> $HOME/.$file"
else
echo 'Install failed to symlink.'
exit 1
fi
done
# Enable RPM Fusion
# Run in Bash as Zsh cannot do `$(rpm -E %fedora)`
sudo dnf install \
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install \
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# EXECUTE LAST SO NOTHING BREAKS
# Enable Mesa aco
sudo dnf copr enable gloriouseggroll/mesa-aco
# Enable fsync kernel
sudo dnf copr enable sentry/kernel-fsync
sudo dnf update --refresh