Skip to content

Instantly share code, notes, and snippets.

@s-urbaniak s-urbaniak/
Last active Sep 20, 2018

What would you like to do?
#!/usr/bin/env bash
set -euxo pipefail
echo "installing core packages"
apt-get update -y
apt install -y apt-transport-https curl
curl -sS | sudo apt-key add -
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt-get update -y
apt install -y --force-yes \
binutils \
curl \
direnv \
emacs25-nox \
firewalld \
gcc \
git \
jq \
libpcap-dev \
libpam-systemd \
make \
mercurial \
mosh \
nodejs \
policykit-1 \
psmisc \
software-properties-common \
sudo \
tmux \
unzip \
vim \
yarn \
echo "configuring firewall"
for s in mosh openvpn; do
firewall-cmd --permanent --zone=public --add-service=${s}
firewall-cmd --reload
systemctl start firewalld
systemctl enable firewalld
echo "installing npm"
curl -sL | bash -
apt install -y nodejs
npm config --global set prefix /home/sur/.npm
echo "installing Go"
curl -OLSf#${GOVERSION}.linux-amd64.tar.gz
tar -C /usr/local -xzf go${GOVERSION}.linux-amd64.tar.gz
rm go${GOVERSION}.linux-amd64.tar.gz
echo "installing kubectl"
curl -OL#
tar xvzf kubernetes-client-linux-amd64.tar.gz
mv kubernetes/client/bin/kubectl /usr/local/bin/
chmod a+x /usr/local/bin/kubectl
echo "installing ripgrep"
curl -OL#
tar xvzf ripgrep-0.7.1-x86_64-unknown-linux-musl.tar.gz
mv ripgrep-0.7.1-x86_64-unknown-linux-musl/rg /usr/local/bin/
echo "setting up user"
sed -i.bak 's/sudo\tALL=(ALL:ALL) ALL/sudo\tALL=(ALL:ALL) NOPASSWD: ALL/g' /etc/sudoers
adduser \
--shell /bin/bash \
--ingroup sudo --disabled-password \
--gecos '' \
mkdir -p /home/sur/.ssh
curl -LSfs >>/home/sur/.ssh/authorized_keys
chown -R sur:sudo /home/sur/.ssh
chmod 600 /home/sur/.ssh/authorized_keys
cat <<EOF | runuser -l sur --
mkdir -p ~/src
cd ~/src
git clone
cd dotfiles
curl -sSf | bash -s -- '-y'
cp /etc/skel/.profile ~/.profile
cd ~
cat <<EOD >>~/.envrc
PATH_add /usr/local/go/bin
PATH_add ~/.cargo/bin
PATH_add ~/.npm/bin
direnv allow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.