migrating to debian was a pain in the ass

This commit is contained in:
Reinaldy Rafli 2021-08-15 22:51:24 +07:00
parent c0f8944835
commit 4fd2faee20
19 changed files with 230 additions and 75 deletions

0
bash/.bash_logout Executable file → Normal file
View File

3
bash/.bashrc Executable file → Normal file
View File

@ -117,7 +117,7 @@ if ! shopt -oq posix; then
fi
# fnm
export PATH=$ME/.fnm:/opt/python/3.9.5/bin:$ME/.fly/bin:$ME/go/bin:$ME/dotfiles/bin:$PATH
export PATH=$ME/.fnm:/opt/julia/bin:/opt/python/3.9.6/bin:/opt/java/bin:$ME/.fly/bin:$ME/go/bin:$DOTFILES_PATH/bin:$PATH
eval "`fnm env`"
export LIBGL_ALWAYS_INDIRECT=1
@ -128,3 +128,4 @@ sudo /etc/init.d/dbus start &> /dev/null
. "$HOME/.cargo/env"
export EDITOR="micro"
export DOTFILES_PATH=/home/reinaldy/.dotfiles

0
bash/.profile Executable file → Normal file
View File

3
bin/gitlogpro Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
git log --color --decorate --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
fnm uninstall 14
fnm uninstall 16

27
scripts/clojure.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
function install () {
sudo ~
curl -O https://download.clojure.org/install/linux-install-1.10.3.943.sh
chmod +x linux-install-1.10.3.943.sh
sudo ./linux-install-1.10.3.943.sh
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
sudo chmod +x lein
sudo mv lein /usr/bin
sudo lein
sudo rm linux-install-1.10.3.943.sh
}
if [ "$1" == "install" ]; then
if test ! $(which java); then
./java.sh install
fi
install
elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
uninstall
else
echo "please specify args with install or uninstall"
fi

View File

@ -1,15 +1,17 @@
#!/bin/bash
#!/usr/bin/env bash
VERSION="1.16.6"
VERSION="1.16.7"
function install () {
echo "installing go"
sudo ~
wget https://golang.org/dl/go$VERSION.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go$VERSION.linux-amd64.tar.gz
rm go$VERSION.linux-amd64.tar.gz
sudo rm $HOME/.config/go/env
ln -s $HOME/dotfiles/go/env $HOME/.config/go/env
sudo rm go$VERSION.linux-amd64.tar.gz
sudo rm $HOME/.config/go
sudo mkdir $HOME/.config/go
sudo ln -s ${DOTFILES_PATH}/go/env $HOME/.config/go/env
}
function uninstall () {

22
scripts/java.sh Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
VERSION="16.0.2"
function install () {
cd ~
wget https://download.java.net/java/GA/jdk${VERSION}/d4a915d82b4c4fbb9bde534da945d746/7/GPL/openjdk-${VERSION}_linux-x64_bin.tar.gz
wget https://download.java.net/java/GA/jdk${VERSION}/d4a915d82b4c4fbb9bde534da945d746/7/GPL/openjdk-${VERSION}_linux-x64_bin.tar.gz.sha256
sha256sum openjdk-${VERSION}_linux-x64_bin.tar.gz
sudo tar xvf openjdk-${VERSION}_linux-x64_bin.tar.gz
sudo mv jdk-$VERSION /opt/java
sudo rm openjdk-${VERSION}_linux-x64_bin.tar.gz
sudo rm openjdk-${VERSION}_linux-x64_bin.tar.gz.sha256
}
if [ "$1" == "install" ]; then
install
# elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
# uninstall
else
echo "please specify args with install or uninstall"
fi

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
MINOR="1.6"
VERSION="1.6.2"
@ -8,9 +8,9 @@ function install () {
cd ~
wget https://julialang-s3.julialang.org/bin/linux/x64/$MINOR/julia-$VERSION-linux-x86_64.tar.gz
tar zxvf julia-$VERSION-linux-x86_64.tar.gz
mv julia-$VERSION julia
sudo mv julia-$VERSION julia
sudo mv julia /opt/julia
rm julia-$VERSION-linux-x86_64.tar.gz
sudo rm julia-$VERSION-linux-x86_64.tar.gz
}
function uninstall () {

View File

@ -1,13 +1,14 @@
#!/bin/bash
#!/usr/bin/env bash
function install () {
cd ~
git clone https://github.com/justinmeza/lci.git
cd lci
cmake .
make
sudo make
sudo make install
cd ..
rm -rf lci
cd ~
sudo rm -rf lci
}
function uninstall () {

28
scripts/lua.sh Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
VERSION="5.4.3"
function install () {
cd ~
wget https://www.lua.org/ftp/lua-$VERSION.tar.gz
sudo tar zxf lua-$VERSION.tar.gz
cd lua-$VERSION
make
sudo make install
cd ~
sudo rm -rf lua-$VERSION
sudo rm lua-$VERSION.tar.gz
}
function uninstall () {
sudo rm -rf /usr/local/bin/lua
sudo rm -rf /usr/local/lib/lua
}
if [ "$1" == "install" ]; then
install
elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
uninstall
else
echo "please specify args with install or uninstall"
fi

View File

@ -1,16 +1,19 @@
#!/bin/bash
#!/usr/bin/env bash
function install () {
curl https://getmic.ro | bash
sudo mv micro /usr/bin
ln -s $HOME/dotfiles/micro/settings.json $HOME/.config/micro/settings.json
ln -s $HOME/dotfiles/micro/bindings.json $HOME/.config/micro/bindings.json
mkdir ~/.config/micro/colorschemes
ln -s $HOME/dotfiles/micro/colorschemes/night-owl.micro $HOME/.config/micro/colorschemes/night-owl.micro
ln -s $HOME/dotfiles/micro/colorschemes/light-owl.micro $HOME/.config/micro/colorschemes/light-owl.micro
sudo rm $HOME/.config/micro/settings.json
sudo rm $HOME/.config/micro/bindings.json
sudo ln -s ${DOTFILES_PATH}/micro/settings.json $HOME/.config/micro/settings.json
sudo ln -s ${DOTFILES_PATH}/micro/bindings.json $HOME/.config/micro/bindings.json
sudo mkdir $HOME/.config/micro/colorschemes
sudo ln -s ${DOTFILES_PATH}/micro/colorschemes/night-owl.micro $HOME/.config/micro/colorschemes/night-owl.micro
sudo ln -s ${DOTFILES_PATH}/micro/colorschemes/light-owl.micro $HOME/.config/micro/colorschemes/light-owl.micro
micro -plugin install editorconfig
micro -plugin install filemanager
micro -plugin install go
micro -plugin install wakatime
}
function uninstall () {
@ -23,4 +26,4 @@ elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
uninstall
else
echo "please specify args with install or uninstall"
fi
fi

View File

@ -1,28 +0,0 @@
#!/bin/bash
VERSION="7.1.0"
function install () {
sudo apt install -y w3m
wget https://github.com/dylanaraps/neofetch/archive/refs/tags/${VERSION}.zip
unzip ${VERSION}.zip
rm $VERSION.zip
cd neofetch-$VERSION
sudo make install
cd ..
rm -rf neofetch-$VERSION
sudo rm $HOME/.config/neofetch/config.conf
ln -s $HOME/dotfiles/neofetch/config.conf $HOME/.config/neofetch/config.conf
}
function uninstall () {
sudo rm -rf /usr/bin/neofetch
}
if [ "$1" == "install" ]; then
install
elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
uninstall
else
echo "please specify args with install or uninstall"
fi

View File

@ -1,8 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
VERSION="v0.5.0"
function install () {
cd ~
wget https://github.com/neovim/neovim/releases/download/$VERSION/nvim.appimage
wget https://github.com/neovim/neovim/releases/download/$VERSION/nvim.appimage.sha256sum
sha256sum nvim.appimage
@ -15,7 +16,7 @@ function install () {
sudo rm -rf nvim.appimage
sudo rm -rf squashfs-root
mkdir $HOME/.config/nvim
ln -s $HOME/dotfiles/nvim/init.vim $HOME/.config/nvim/init.vim
ln -s ${DOTFILES_PATH}/nvim/init.vim $HOME/.config/nvim/init.vim
}
function uninstall () {

View File

@ -1,10 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
function install () {
echo "installing node js"
curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell
$ME/.fnm/fnm fnm install lts
npm i -g yarn pnpm npm-check-updates np add-gitignore commitizen
node-update
}
function uninstall () {

View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
VERSION="3.9.6"
function install () {
cd ~
curl -O https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
sudo tar -xvzf Python-${VERSION}.tgz
cd Python-${VERSION}
./configure \
--prefix=/opt/python/${VERSION} \
--enable-shared \
--enable-ipv6 \
LDFLAGS=-Wl,-rpath=/opt/python/${VERSION}/lib,--disable-new-dtags
make
sudo make install
cd ~
curl -O https://bootstrap.pypa.io/get-pip.py
sudo /opt/python/${VERSION}/bin/python3 get-pip.py
sudo rm Python-$VERSION.tgz
sudo rm -rf Python-$VERSION
sudo rm get-pip.py
/opt/python/${VERSION}/bin/python3 --version
}
if [ "$1" == "install" ]; then
install
# elif [ "$1" == "uninstall" ]; then
# uninstall
else
echo "Only install and uninstall"
fi

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
function install () {
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

View File

@ -1,19 +1,45 @@
#!/bin/bash
#!/usr/bin/env bash
function install_exa () {
EXA_VERSION="0.10.1"
cd ~
wget https://github.com/ogham/exa/releases/download/v$EXA_VERSION/exa-linux-x86_64-v$EXA_VERSION.zip
unzip exa-linux-x86_64-v$EXA_VERSION.zip -d exa
sudo mv exa/bin/exa /usr/local/bin/exa
rm exa-linux-x86_64-v$EXA_VERSION.zip
rm -rf exa
sudo rm exa-linux-x86_64-v$EXA_VERSION.zip
sudo rm -rf exa
}
function install_bat () {
BAT_VERSION="0.18.2"
cd ~
wget https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/bat_${BAT_VERSION}_amd64.deb
sudo dpkg -i bat_0.18.2_amd64.deb
rm bat_${BAT_VERSION}_amd64.deb
sudo rm bat_${BAT_VERSION}_amd64.deb
}
function install_curlie () {
CURLIE_VERSION="1.6.0"
cd ~
wget https://github.com/rs/curlie/releases/download/v${CURLIE_VERSION}/curlie_${CURLIE_VERSION}_linux_amd64.tar.gz
sudo tar -zxvf curlie_${CURLIE_VERSION}_linux_amd64.tar.gz curlie
sudo mv curlie /usr/local/bin/
sudo rm curlie_${CURLIE_VERSION}_linux_amd64.tar.gz
}
function install_neofetch () {
NEOFETCH_VERSION="7.1.0"
cd ~
wget https://github.com/dylanaraps/neofetch/archive/refs/tags/$NEOFETCH_VERSION.tar.gz
sudo tar -zxvf $NEOFETCH_VERSION.tar.gz
cd neofetch-$NEOFETCH_VERSION
sudo make install
cd ~
sudo rm -rf $HOME/.config/neofetch
sudo mkdir $HOME/.config/neofetch
sudo ln -s ${DOTFILES_PATH}/neofetch/config.conf $HOME/.config/neofetch/config.conf
sudo rm $NEOFETCH_VERSION.tar.gz
sudo rm -rf neofetch-$NEOFETCH_VERSION
}
if [ "$1" == "install" ]; then
@ -21,12 +47,18 @@ if [ "$1" == "install" ]; then
install_bat
elif [ "$2" == "exa" ]; then
install_exa
elif [ "$2" == "curlie" ]; then
install_curlie
elif [ "$2" == "neofetch" ]; then
install_neofetch
else
install_exa
install_bat
install_curlie
install_neofetch
fi
elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
uninstall
else
echo "please specify args with install or uninstall"
fi
fi

View File

@ -1,29 +1,58 @@
#!/bin/bash
#!/usr/bin/env bash
ME="/home/$(whoami)"
CFG="${ME}/.config"
DOTFILES="${ME}/dotfiles"
BINDIR="${ME}/dotfiles/bin"
sudo -v
echo "I'm assuming you're doing a fresh install. Send a SIGTERM anytime you like."
sudo apt install -y curl wget openssl tar unzip git
sudo apt-get install editorconfig
# Set dotfiles path
DOTFILES_PATH=$(pwd)
function set_symlink () {
sudo rm $HOME/.bashrc
sudo ln -s ${DOTFILES_PATH}/bash/.bashrc $HOME/.bashrc
echo "export DOTFILES_PATH=$(pwd)" >> $HOME/.bashrc
sudo rm $HOME/.bash_logout
sudo ln -s ${DOTFILES_PATH}/bash/.bash_logout $HOME/.bash_logout
sudo rm $HOME/.profile
sudo ln -s ${DOTFILES_PATH}/bash/.profile $HOME/.profile
sudo rm $HOME/.gitconfig
sudo ln -s ${DOTFILES_PATH}/git/.gitconfig $HOME/.gitconfig
sudo rm $HOME/.czcrc
sudo ln -s ${DOTFILES_PATH}/git/.czrc $HOME/.czrc
}
if [[ $(cat /etc/issue) = *"Ubuntu"* ]]; then
sudo apt update
sudo apt upgrade
sudo apt install -y curl wget openssl tar unzip git rlwrap editorconfig gpg build-essential libffi-dev libgdbm-dev libsqlite3-dev libssl-dev zlib1g-dev
set_symlink
elif [[ $(cat /etc/issue) = *"Debian"* ]]; then
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y curl wget openssl tar unzip git rlwrap editorconfig gpg build-essential libffi-dev libgdbm-dev libsqlite3-dev libssl-dev zlib1g-dev
set_symlink
else
echo "you will need to install curl, wget, openssl, gpg, and other stuff yourself"
fi
sudo chmod -R 755 ./scripts
sudo chmod -R 755 ./bin
if test ! $(which fnm); then
./scripts/node.sh install
fi
./scripts/python.sh install
if test ! $(which go); then
./scripts/go.sh install
fi
./scripts/node.sh install
if test ! $(which julia); then
./scripts/julia.sh install
fi
./scripts/go.sh install
if test ! $(which nvim); then
./scripts/neovim.sh install
fi
./scripts/julia.sh install
./scripts/rust.sh install
./scripts/micro.sh install
./scripts/utils.sh install