Compare commits

..

9 Commits

8 changed files with 131 additions and 0 deletions

5
config.sh Normal file
View File

@ -0,0 +1,5 @@
export _url="hugo-skeleton.home"
export _user='ray'
export _node_version=v12.16.1
export _node_distro=linux-x64

24
config/tmux.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
set -e
if command -v apt-get ; then
apt-get -y install tmux git
else
echo "Error - no package installer found."
exit 1
fi
mkdir -p /home/"$_user"/.config
cd /home/"$_user"
rm -Rf .config/tmux
if [ -h .tmux ] ; then
rm .tmux
elif [ -f .tmux ] ; then
mv .tmux .tmux.backup
fi
su ray -c 'git clone https://git.rayelliott.dev/dots/tmux.git .config/tmux'
su ray -c 'ln -bfs .config/tmux/tmux.conf .tmux.conf'
su ray -c 'ln -bfs .config/tmux/tmux .tmux'
cd .config/tmux
ln -bfs tmux.colours-base16.conf tmux.colours.conf

24
config/zsh.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
set -e
if command -v apt-get ; then
apt-get -y install zsh git
else
echo "Error - no package installer found."
exit 1
fi
# clone configuration
mkdir -p /home/"$_user"/.config
cd /home/"$_user"
rm -Rf .config/zsh
su ray -c 'git clone https://git.rayelliott.dev/dots/zsh.git .config/zsh'
su ray -c 'git clone https://github.com/tarjoilija/zgen.git .config/zsh/zgen'
su ray -c 'ln -bfs .config/zsh/zshrc .zshrc'
# set interactive shell
_zsh=$(command -v zsh)
if [ -f "$_zsh" ] ; then
chsh ray -s "$_zsh"
fi

16
deploy-script.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
if [ -z "$1" ] ; then
echo "deploy-script.sh: Error - Must supply script as argument"
exit
else
_script="$1"
fi
. ./config.sh
cat config.sh "$_script" | ssh root@"$_url" "cat >/tmp/deploy-script.sh"
ssh root@"$_url" '/bin/bash /tmp/deploy-script.sh'
ssh root@"$_url" '/bin/bash -c "rm /tmp/deploy-script.sh"'

21
dev-setup/node.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
set -e
if command -v apt-get ; then
apt-get -y install gnupg
else
echo "Error - no package installer found."
exit 1
fi
cd /tmp
wget https://nodejs.org/dist/"$_node_version"/node-"$_node_version"-"$_node_distro".tar.xz
sudo mkdir -p /usr/local/lib/nodejs
tar -xJvf node-"$_node_version"-"$_node_distro".tar.xz -C /usr/local/lib/nodejs
echo "PATH=/usr/local/lib/nodejs/node-$_node_version-$_node_distro/bin:$PATH" >> /home/"$_user"/.profile
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt-get update && sudo apt-get -y install yarn

22
dev-setup/nvim.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -e
if command -v apt-get ; then
apt-get -y install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip
cd /tmp
git clone https://github.com/neovim/neovim
cd neovim
make CMAKE_BUILD_TYPE=Release
mv /tmp/neovim/runtime /usr/local/share/nvim
mv /tmp/neovim/build/bin/nvim /usr/local/bin/nvim
else
echo "Error - no package installer found."
exit 1
fi
mkdir -p /home/"$_user"/.config
cd /home/"$_user"
rm -Rf .config/nvim
su ray -c 'git clone https://git.rayelliott.dev/dots/nvim.git .config/nvim'

19
user.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
useradd -m -s /bin/bash "$_user"
groupadd sudo
usermod -aG sudo "$_user"
mkdir /home/"$_user"/.ssh
cp /root/.ssh/authorized_keys /home/"$_user"/.ssh/
chown "$_user": /home/"$_user"/.ssh/authorized_keys
passwd -d "$_user"
chage -d 0 "$_user"
if command -v apt-get ; then
apt-get update && apt-get -y upgrade && apt-get -y install sudo
else
echo "Error - no package installer found."
exit 1
fi
# TODO ensure group sudo is allowed sudo