From 7ea52669e049b6c7093c999362488894a965d82b Mon Sep 17 00:00:00 2001 From: Nathan Steel Date: Sat, 7 Aug 2021 19:08:32 +0100 Subject: [PATCH 1/4] Add start of a wsl install script - Copied installs from debain_ scripts for now --- installs/wsl/wsl.sh | 112 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100755 installs/wsl/wsl.sh diff --git a/installs/wsl/wsl.sh b/installs/wsl/wsl.sh new file mode 100755 index 0000000..8142ef4 --- /dev/null +++ b/installs/wsl/wsl.sh @@ -0,0 +1,112 @@ +# This install script is for a WSL install + +# This install will install only tools for CLI use + +# Update and Upgrade the system first +apt update && apt upgrade -y + +# Install essential tools required for other installs +apt install sudo build-essential ssh -y + +# Make the user a sudoer (If passed to the script) +adduser nathan sudo + +# System Utilities +apt install perl wget curl man -y + +# Make the terminal usable* +apt install tmux zsh -y + +## Text Editors +apt install vim neovim -y +apt install groff -y + +## Git +apt install git tig -y + +# Compression Utilities +apt install gzip zip tar bzip2 unrar -y + +# Install terminal system utilities +apt install neofetch htop -y + +# Backups +apt install rsync rdiff-backup -y + +HOME=/home/nathan/ +# lf file manager +sudo -H -u nathan bash -c "mkdir $HOME/.local $HOME/.local/bin" +sudo -H -u nathan bash -c "curl -LO https://github.com/gokcehan/lf/releases/latest/download/lf-linux-amd64.tar.gz | tar -xf -C $HOME/.local/bin" + +# Vi mode terminal and local bin +# This also happens in dotfiles, so kinda redundant +sudo -H -u nathan bash -c "mkdir $HOME/.local/bin" +echo "set -o vi\nexport PATH=\$HOME/.local/bin:\$PATH" >> .zshrc +echo "export PATH=\$HOME/.local/bin/*:\$PATH" >> .zshrc +# Add to path for this session +export PATH=\$HOME/.local/bin/:$PATH +export PATH=\$HOME/.local/bin/dmenu:$PATH + +# *Make the terminal usable +## Change default shell to zsh +chsh nathan -s /bin/zsh + +## Oh my Zsh +sudo -H -u nathan bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended + +## Audio +#TODO + +# Music Player (daemon, and utilities) +apt install mpd mpc mcmpcpp -y + +# RSS Reader +apt install newsboat -y + +# Mail Client +apt install neomutt -y + +# Download Utilities (Legallity, uncertain) +## Youtube-dl +curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl +chmod a+rx /usr/local/bin/youtube-dl + +## Torrenting (Seperate script?) +apt install transmission-daemon transmission-cli transmission-remote-cli -y +#systemctl stop transmission-daemon.service +#/lib/systemd/system/tranmission-daemon.service # Change debian-transmission to $USER +# systemctl daemon-reload +# start/restart service +# /etc/transmission-daemon/settings.json # edit whitelist, blocklist, password +# Setup the user for transmission-daemon + +HOME=/home/nathan + +mkdir2() { + for DIR + do + if [ ! -d $DIR ]; then + mkdir $DIR + fi + done +} + +# Create directories +sudo -H -u nathan bash -c "cd ~" +mkdir2 documents/ downloads/ misc/ music/ pictures/ + +# Set location to download source code and other repos +REPO=$HOME/agitrepo +sudo -H -u nathan bash -c "mkdir $REPO" + +# Muh scripties +sudo -H -u nathan bash -c "git clone https://github.com/aney/scripts $REPO/ascripts/" +# create a sym link. Will change to cp if others start using my install.sh +ln -s $REPO/ascripts/config/ $HOME/.local/bin/ +ln -s $REPO/ascripts/backup/ $HOME/.local/bin/ + +# dotfiles +# This will overwrite existing dotfiles... +sudo -H -u nathan bash -c "git clone https://github.com/aney/dotfiles $REPO/adotfiles/" +cp $REPO/adotfiles/.[^.]* $HOME + From bdf1d3533f755491b1139f6dbe365a20ee3d6c96 Mon Sep 17 00:00:00 2001 From: Nathan Steel Date: Sat, 7 Aug 2021 19:46:10 +0100 Subject: [PATCH 2/4] Remove programs not needed in workflow - Remove a small selection of programs - Add a comment to mention this is based on debian/ubuntu WSL --- installs/wsl/wsl.sh | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/installs/wsl/wsl.sh b/installs/wsl/wsl.sh index 8142ef4..90454ab 100755 --- a/installs/wsl/wsl.sh +++ b/installs/wsl/wsl.sh @@ -1,5 +1,6 @@ # This install script is for a WSL install +# For debian based WSL. Tested on Ubuntu # This install will install only tools for CLI use # Update and Upgrade the system first @@ -19,7 +20,6 @@ apt install tmux zsh -y ## Text Editors apt install vim neovim -y -apt install groff -y ## Git apt install git tig -y @@ -63,25 +63,10 @@ apt install mpd mpc mcmpcpp -y # RSS Reader apt install newsboat -y -# Mail Client -apt install neomutt -y - -# Download Utilities (Legallity, uncertain) ## Youtube-dl curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl chmod a+rx /usr/local/bin/youtube-dl -## Torrenting (Seperate script?) -apt install transmission-daemon transmission-cli transmission-remote-cli -y -#systemctl stop transmission-daemon.service -#/lib/systemd/system/tranmission-daemon.service # Change debian-transmission to $USER -# systemctl daemon-reload -# start/restart service -# /etc/transmission-daemon/settings.json # edit whitelist, blocklist, password -# Setup the user for transmission-daemon - -HOME=/home/nathan - mkdir2() { for DIR do From 17b4022ab0085c77bcfd8122f141f6e344dc3b52 Mon Sep 17 00:00:00 2001 From: Nathan Steel Date: Sat, 7 Aug 2021 19:52:49 +0100 Subject: [PATCH 3/4] Fix anything reliant on $HOME variable - lf install - Creating basic directories --- installs/wsl/wsl.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/installs/wsl/wsl.sh b/installs/wsl/wsl.sh index 90454ab..9124347 100755 --- a/installs/wsl/wsl.sh +++ b/installs/wsl/wsl.sh @@ -33,10 +33,10 @@ apt install neofetch htop -y # Backups apt install rsync rdiff-backup -y -HOME=/home/nathan/ +HOME=/home/nathan # lf file manager sudo -H -u nathan bash -c "mkdir $HOME/.local $HOME/.local/bin" -sudo -H -u nathan bash -c "curl -LO https://github.com/gokcehan/lf/releases/latest/download/lf-linux-amd64.tar.gz | tar -xf -C $HOME/.local/bin" +sudo -H -u nathan bash -c "curl -L https://github.com/gokcehan/lf/releases/latest/download/lf-linux-amd64.tar.gz | tar xzC ~/.local/bin" # Vi mode terminal and local bin # This also happens in dotfiles, so kinda redundant @@ -78,10 +78,10 @@ mkdir2() { # Create directories sudo -H -u nathan bash -c "cd ~" -mkdir2 documents/ downloads/ misc/ music/ pictures/ +mkdir2 $HOME/documents/ $HOME/downloads/ $HOME/misc/ # Set location to download source code and other repos -REPO=$HOME/agitrepo +REPO=/home/nathan/agitrepo sudo -H -u nathan bash -c "mkdir $REPO" # Muh scripties From 60ad4d1ee386b010dcba52da74adf5c1d25f99e9 Mon Sep 17 00:00:00 2001 From: Nathan Steel Date: Sat, 7 Aug 2021 19:53:30 +0100 Subject: [PATCH 4/4] Fix dotfiles not all getting copied to home - Added a -r flag to the copy, as some of the dotfiles are directories --- installs/wsl/wsl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installs/wsl/wsl.sh b/installs/wsl/wsl.sh index 9124347..b3c6061 100755 --- a/installs/wsl/wsl.sh +++ b/installs/wsl/wsl.sh @@ -93,5 +93,5 @@ ln -s $REPO/ascripts/backup/ $HOME/.local/bin/ # dotfiles # This will overwrite existing dotfiles... sudo -H -u nathan bash -c "git clone https://github.com/aney/dotfiles $REPO/adotfiles/" -cp $REPO/adotfiles/.[^.]* $HOME +cp -r $REPO/adotfiles/.[^.]* $HOME