Skip to content

Instantly share code, notes, and snippets.

@fridzema
Last active December 3, 2019 09:57
Show Gist options
  • Save fridzema/56d3b90f61be9565015b5203e8ed4199 to your computer and use it in GitHub Desktop.
Save fridzema/56d3b90f61be9565015b5203e8ed4199 to your computer and use it in GitHub Desktop.
Post provision
export DEBIAN_FRONTEND=noninteractive
REMOVABLE_DEPS=('beanstalkd' 'memcached')
IMAGEMAGICK_DEPS=('imagemagick' 'pkg-config' 'libmagickwand-dev')
MEDIALIBRARY_DEPS=('jpegoptim' 'optipng' 'pngquant' 'gifsicle')
WKHTMLTOX_DEPS=('libfontenc1' 'xfonts-75dpi' 'xfonts-base' 'xfonts-encodings' 'xfonts-utils')
echo "\e[32mSetting system timezone"
sudo timedatectl set-timezone Europe/Amsterdam
############################
echo "Install all deps"
sudo apt-get install libmagickwand-dev libmagickcore-dev
apt-get install -q -y pkg-config
apt-get install -q -y \
-o Dpkg::Options::="--force-confold" \
$IMAGEMAGICK_DEPS $MEDIALIBRARY_DEPS $WKHTMLTOX_DEPS
#########################
echo "Remove unused services:"
sudo systemctl stop $REMOVABLE_DEPS
sudo systemctl disable $REMOVABLE_DEPS
sudo apt-get remove -y $REMOVABLE_DEPS
#########################
echo "Install WKHTMLTO.x:"
sudo wget -q https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo ln -sf /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -sf /usr/local/bin/wkhtmltoimage /usr/bin
rm -rf wkhtmltox_0.12.5-1.bionic_amd64.deb
##############################
echo "Install php-imagemagick"
sudo pecl install imagick
#############################
echo 'Add extensions to php.ini'
php -d extension='redis.so'
php -d extension='imagick.so'
#########################
echo "Composer global hirak/prestissimo:"
composer global require hirak/prestissimo
#########################
echo "Cleanup:"
sudo apt-get autoremove -y
sudo apt-get autoclean -y
sudo apt-get purge -y
########################
echo 'Install scripts:'
wget -N https://gist.githubusercontent.com/fridzema/dcd1baf3146ed68c6e9dac3148085941/raw/update-all-oneline-unix-ubuntu-bash.sh
chmod +x update-all-oneline-unix-ubuntu-bash.sh
wget -N https://gist.githubusercontent.com/fridzema/6b80266a9993f907aed58f18fc658c64/raw/ubuntu-maintenance.sh
chmod +x ubuntu-maintenance.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment