Skip to content

Instantly share code, notes, and snippets.

@ScottHelme
Created October 2, 2016 14:04
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 ScottHelme/3abaca82e0d50c6e7f55a0a4b3b2c63d to your computer and use it in GitHub Desktop.
Save ScottHelme/3abaca82e0d50c6e7f55a0a4b3b2c63d to your computer and use it in GitHub Desktop.
Compress all blog assets with Brotli.
#!/bin/bash
for x in `find /var/www/ghost/content/themes/futura/assets/js/ -type f -iname '*.js'`
do
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br
sudo chown scott:ghost ${x}.br
sudo chmod 664 ${x}.br
done
for x in `find /var/www/ghost/content/themes/futura/assets/css/ -type f -iname '*.css'`
do
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br
sudo chown scott:ghost ${x}.br
sudo chmod 664 ${x}.br
done
for x in `find /var/www/ghost/content/themes/futura/assets/images/ -type f -iname '*.png'`
do
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br
sudo chown scott:ghost ${x}.br
sudo chmod 664 ${x}.br
done
for x in `find /var/www/ghost/content/themes/futura/assets/images/ -type f -iname '*.jpg'`
do
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br
sudo chown scott:ghost ${x}.br
sudo chmod 664 ${x}.br
done
for x in `find /var/www/ghost/content/images/ -type f -iname '*.jpg'`
do
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br
sudo chown scott:ghost ${x}.br
sudo chmod 664 ${x}.br
done
for x in `find /var/www/ghost/content/images/ -type f -iname '*.png'`
do
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br
sudo chown scott:ghost ${x}.br
sudo chmod 664 ${x}.br
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment