Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Configure ChromeOS Linux for a full stack developer.
#!/bin/sh
# Configure ChromeOS Linux for a full stack developer.
#
# 🚀 More stable setup script here:
# https://github.com/perguth/chromeos-playbook
#
sudo apt install -y git-svn
git config --global user.email "mail@perguth.de"
git config --global user.name "Per Guth"
# Apt sources and keys
## Docker
curl -sSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
sudo apt update && sudo apt install -y docker-ce
## Yggdrasil
gpg --fetch-keys https://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/key.txt
gpg --export 569130E8CA20FBC4CB3FDE555898470A764B32C9 | sudo apt-key add -
echo 'deb http://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/ debian yggdrasil' | sudo tee /etc/apt/sources.list.d/yggdrasil.list
sudo apt update && sudo apt install -y yggdrasil
## NodeJS
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt install -y gcc g++ make
### Yarn
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
echo 'export PATH="$PATH:`yarn global bin`"' >> ~/.bashrc
sudo apt update && sudo apt install -y nodejs yarn
## Syncthing
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt update && sudo apt install -y syncthing
# Binaries
## Linuxbrew/Homebrew
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >> .bashrc
## Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Old version?! ->
# sudo apt update && sudo apt install -y docker-compose
## Golang
wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.13.3.linux-amd64.tar.gz
rm go1.13.3.linux-amd64.tar.gz
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$GOPATH/bin:/usr/local/go/bin:$PATH' >> ~/.bashrc
## Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Apt installations
sudo apt update
sudo apt install -y nano htop nload nmap privoxy mosh screen build-essential iperf3
echo 'export MOSH_TITLE_NOPREFIX=1' >> ~/.bashrc
# Load new .bashrc
source ~/.bashrc
# IPFS
ipfs-update install $(ipfs-update versions | tail -1)
# Install Yarn packages
yarn global add standard diff-so-fancy
# Configure diff-so-fancy
git config --global core.pager "diff-so-fancy | less --tabs=2 -RFX"
git config --global color.ui true
git config --global color.diff-highlight.oldNormal "red bold"
git config --global color.diff-highlight.oldHighlight "red bold 52"
git config --global color.diff-highlight.newNormal "green bold"
git config --global color.diff-highlight.newHighlight "green bold 22"
git config --global color.diff.meta "11"
git config --global color.diff.frag "magenta bold"
git config --global color.diff.commit "yellow bold"
git config --global color.diff.old "red bold"
git config --global color.diff.new "green bold"
git config --global color.diff.whitespace "red reverse"
# Service configuration
sudo systemctl enable yggdrasil
sudo systemctl start yggdrasil
## Clean up Yggdrasil config
sed '/^[[:blank:]]*#/d;s/#.*//' /etc/yggdrasil.conf | sudo tee /etc/yggdrasil.conf > /dev/null
## Change Privoxy port
sudo sed -i 's/8118/8008/g' /etc/privoxy/config
sudo service privoxy restart
## Promt Chrome extensions
xdg-open https://chrome.google.com/webstore/detail/yggdrasil-on-chromeos/hcgljgobhoaeojnhikfmnhdpmgbmflec
xdg-open https://chrome.google.com/webstore/detail/ipfs-companion/nibjojkomfdiaoajekhjakgkdhaomnch
read -p 🍓 Is this a RaspberryPi?
## ChromeOS comes with unattended-upgrades enabled. So the Linux will keep itself up-to-date.
sudo apt install -y unattended-upgrades
sudo sed -i -e 's/\/\/ "origin=Debian,codename=${distro_codename}-updates";/ "origin=Debian,codename=${distro_codename}-updates";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo sed -i -e 's/\/\/Unattended-Upgrade::AutoFixInterruptedDpkg "true";/Unattended-Upgrade::AutoFixInterruptedDpkg "true";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo sed -i -e 's/\/\/Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";/Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo sed -i -e 's/\/\/Unattended-Upgrade::Remove-New-Unused-Dependencies "true";/Unattended-Upgrade::Remove-New-Unused-Dependencies "true";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo sed -i -e 's/\/\/Unattended-Upgrade::Automatic-Reboot "false";/Unattended-Upgrade::Automatic-Reboot "false";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo touch /var/run/reboot-required
sudo sed -i -e 's/\/\/Unattended-Upgrade::Automatic-Reboot-Time "02:00";/Unattended-Upgrade::Automatic-Reboot-Time "02:00";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo sed -i -e 's/\/\/ Unattended-Upgrade::SyslogEnable "false";/Unattended-Upgrade::SyslogEnable "false";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo service unattended-upgrades start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment