Skip to content

Instantly share code, notes, and snippets.

@Endermanbugzjfc
Last active February 23, 2023 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Endermanbugzjfc/0357f40f84da61b398b1c9823992acca to your computer and use it in GitHub Desktop.
Save Endermanbugzjfc/0357f40f84da61b398b1c9823992acca to your computer and use it in GitHub Desktop.
Ubuntu Essentials (Personal Installation Script). Migrated from https://pastebin.com/fAq9TLCD
if [ -z "${GOBIN}" ]
then
echo GOBIN not set!
exit 1
fi
if [ ! -d "${GOBIN}" ]
then
echo "GOBIN's directory does not exists!"
exit 1
fi
# https://askubuntu.com/questions/87061/can-i-make-tab-auto-completion-case-insensitive-in-bash
# If ~/.inputrc doesn't exist yet: First include the original /etc/inputrc
# so it won't get overriden
if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi
# Add shell-option to ~/.inputrc to enable case-insensitive tab completion
echo 'set completion-ignore-case On' >> ~/.inputrc
sudo ln -s /media/$(whoami)/U ~/U
sudo ln -s ~/U/dev ~/dev
sudo add-apt-repository -y ppa:longsleep/golang-backports
sudo apt-get -y update
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo apt-get -y install python3-pip
# sudo ln -s /usr/bin/pip3 /usr/bin/pip
sudo apt-get install -y libpython-all-dev
sudo apt-get install -y libgtk-3-dev # Required to compile Amulet.
python -m pip install amulet-map-editor==0.9.6 --upgrade
sudo apt-get -y install gh
sudo apt-get -y install ruby-rubygems
sudo apt-get -y install net-tools
sudo apt-get -y install git
sudo apt-get -y install gnome-tweaks
sudo apt-get -y install xclip
sudo apt-get -y install gdebi-core # Required to install Discord and Chrome.
sudo apt-get -y install curl # Required to install Go and Docker.
# Required to install Docker:
sudo apt-get -y install ca-certificates
sudo apt-get -y install gnupg
sudo apt-get -y install lsb-release
sudo apt-get -y install gcc
# Required to build Fyne apps.
sudo apt-get -y install libgl1-mesa-dev
sudo apt-get -y install xorg-dev
sudo apt-get -y install xdotool
# Swift:
# https://gist.github.com/Jswizzy/408af5829970f9eb18f9b45f891910bb
sudo apt-get -y install clang
sudo apt-get -y install libpython2.7
sudo apt-get -y install libpython2.7-dev
which swift # Sublime Text.
if [[ $? -ne 0 ]]
wget https://swift.org/builds/swift-5.6.2-release/ubuntu2004/swift-5.6.2-RELEASE/swift-5.6.2-RELEASE-ubuntu20.04.tar.gz
tar xzf swift-5.6.2-RELEASE-ubuntu20.04.tar.gz
sudo mv swift-5.6.2-RELEASE-ubuntu20.04 /usr/share/swift
rm swift-5.6.2-RELEASE-ubuntu20.04.tar.gz
echo "Please export /usr/share/swift/usr/bin"
then
yes | pip install xcrun # TODO: broken pipe.
sudo apt-get -y install neovim
sudo mv /usr/bin/vi /usr/bin/lvi
sudo ln -s /usr/bin/nvim /usr/bin/vi
sudo ln -s /usr/bin/vi /usr/bin/vim
sudo ln -s /usr/bin/vim /usr/bin/v
which "google-chrome"
if [[ $? -ne 0 ]]
then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo gdebi -n ~/google-chrome-stable_current_amd64.deb
rm ./google-chrome-stable_current_amd64.deb
fi
which s # Sublime Text.
if [[ $? -ne 0 ]]
then
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get -y update
sudo apt-get -y install sublime-text
sudo ln -s $(which subl) s
sudo apt-get -y install sublime-merge
git clone https://github.com/Endermanbugzjfc/DotConfig.git
sudo rsync -a DotConfig ~/.config
rm -r DotConfig
fi
which discord
if [[ $? -ne 0 ]]
then
wget -O ~/discord.deb "https://discordapp.com/api/download?platform=linux&format=deb"
sudo gdebi -n ~/discord.deb
rm ./discord.deb
fi
sudo apt-get -y install "golang-go"
which golangci-lint
if [[ $? -ne 0 ]]
then
curl -sSfL "https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh" | sh -s -- -b $(go env GOBIN) latest
go install golang.org/x/tools/cmd/goimports@latest
fi
php -r "exit (in_array('chunkutils2', get_loaded_extensions(), true) ? 0 : 1);"
if [[ $? -ne 0 ]]
then
if [ wget "https://jenkins.pmmp.io/job/PHP-8.0-Aggregate/lastSuccessfulBuild/artifact/PHP-8.0-Linux-x86_64.tar.gz -O php.tar.gz" ]
then
sudo rm -rf ~/php
mkdir ~/php
tar -C ~/php -xzf php.tar.gz
sudo ln -s ~/php/bin/php7/bin/php /usr/bin/php
rm php.tar.gz
# Get rid of OPcache and allow to modify PHARs:
php -r " \$p = PHP_BINARY . '.ini'; file_put_contents(\$p, str_replace('zend_extension=opcache.so', ';zend_extension=opcache.so
dphar.readonly=0', file_get_contents(\$p)));"
php -v
else
echo "PM-PHP installation failed"
fi
fi
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl -sS "https://starship.rs/install.sh" | sh
which docker
if [[ $? -ne 0 ]]
then
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get -y update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment