Last active
February 14, 2023 13:19
-
-
Save justalinko/2779579fb345e5569415dcc6bc4ffebb to your computer and use it in GitHub Desktop.
c9setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOCALUSER=$1 | |
if [ $LOCALUSER == "" ]; then | |
echo "./$0 <username>" | |
exit 1 | |
fi | |
echo "Cleaning ......." | |
sudo rm /var/lib/dpkg/lock | |
sudo rm /var/lib/dpkg/lock-frontend | |
echo "Installing dependencies ... " | |
sudo apt-get update && sudo apt-get -y install curl git build-essential python2.7 | |
echo "Installing Cloud9 IDE" | |
sudo apt-get update && sudo apt-get -y install curl git build-essential php unzip figlet dos2unix | |
curl -fsSL https://deb.nodesource.com/setup_10.x | sudo -E bash - &&\ | |
sudo apt-get install -y nodejs | |
git clone https://github.com/c9/core.git c9 | |
cd c9 | |
scripts/install-sdk.sh | |
mkdir ~/my-projects | |
sudo wget -q https://pastebin.com/raw/Zy5qKHdg -O /lib/systemd/system/c9.service | |
if [ -f /lib/systemd/system/c9.service ]; then | |
sudo sed -i "s|{username}|$LOCALUSER|g" /lib/systemd/system/c9.service | |
sudo sed -i "s|{password}|123456|g" /lib/systemd/system/c9.service | |
sudo sed -i "s|{port}|8080|g" /lib/systemd/system/c9.service | |
sudo sed -i "s|c9user|$LOCALUSER|g" /lib/systemd/system/c9.service | |
sudo systemctl enable c9.service | |
sudo systemctl daemon-reload | |
sudo service c9 start | |
wget -q https://pastebin.com/raw/ySUHxsSX -O /home/$LOCALUSER/.bashrc | |
sudo dos2unix /home/$LOCALUSER/.bashrc | |
else | |
echo "File not found" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment