Skip to content

Instantly share code, notes, and snippets.

@crappyrules
Last active February 20, 2020 19:06
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 crappyrules/4d13176d6f2e395614332745e1fd5e3b to your computer and use it in GitHub Desktop.
Save crappyrules/4d13176d6f2e395614332745e1fd5e3b to your computer and use it in GitHub Desktop.
initial server loading
#!/bin/bash
# This script will install all needed dependencies.
# Set repositories and update apt
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable
apt update
apt install -y linux-headers-4.19.0-6-amd64
# Now we set up 2gb of swap space to ensure we do not run out of memory while compiling or running the daemon under normal load.
apt install -y dphys-swapfile
# Set size of swap file and setup swapfile
su -c 'echo "CONF_SWAPSIZE=2048" > /etc/dphys-swapfile'
dphys-swapfile setup
# Then we enable the new swapfile
dphys-swapfile swapon
# These are the dependencies to run the daemon, wallets and a few other necesseties thrown in for good measure
echo "YOU SUCK AND WE HATE YOU"
apt update
apt install -y build-essential python-dev cron gcc g++ git cmake libboost-all-dev curl nano nginx unzip screen wireguard magic-wormhole autoconf libc-dev pkg-config
# Installation of Nodejs and NPM
curl -sL https://deb.nodesource.com/setup_10.x | -E bash -
apt-get install -y nodejs
curl -L https://npmjs.org/install.sh | sh
#install php for the lulz
apt -y install lsb-release apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
echo "YOU SUCK AND WE HATE YOU"
apt update
apt-get install -y composer php7.2 php7.2-fpm php7.2-cli php7.2-common php7.2-gd php-imagick php-pear php-tidy php-xmlrpc php7.2-curl php7.2-mbstring php7.2-xml
#setup nginx for usage with php
rm -rf /etc/nginx/sites-available/default
wget https://gist.githubusercontent.com/crappyrules/36577f0d21e4963f25366895043695f5/raw/d2a5fde03bdfb2d910b1be5c244495a4bcf10f49/default -O /etc/nginx/sites-available/default
service nginx restart
wg genkey | tee wg-private.key | wg pubkey > wg-public.key
mv wg-private.key wg-public.key /etc/wireguard
rm /etc/motd
wget https://gist.githubusercontent.com/crappyrules/dd8152f43ec920d3feebba1454879043/raw/becdad55e57c22de1aa94d873f200bee77b9b5ca/motd -O /etc/motd
echo "STATION"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment