Posts

Showing posts from October, 2019

Compress MP4 files

How to compress the MP4 files. find . -type f -name "*.MP4" -exec bash -c 'FILE="$1"; ffmpeg -i "${FILE}" -s 1280x720 -acodec copy -y "${FILE%.mp4}.shrink.mp4";' _ '{}' \;

Varnish Exemple for CACHE and Optimisation

Varnish Optimisation cache # # This is an example VCL file for Varnish. # # It does not do anything by default, delegating control to the # builtin VCL. The builtin VCL is called when there is no explicit # return statement. # # See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/ # and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples. # Marker to tell the VCL compiler that this VCL has been adapted to the # new 4.0 format. vcl 4.0; # Default backend definition. Set this to point to your content server. backend default { .host = "127.0.0.1"; .port = "8080"; } sub vcl_recv { # Happens before we check if we have this in cache already. # # Typically you clean up the request here, removing cookies you don't need, # rewriting the request, etc. # Happens before we check if we have this in cache already. # # Typically you clean up the request here, removing cookies you ...

Linux Compress PDF batch

#### gs gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf $INPUTFILE ### pdf2ps && ps2pdf pdf2ps input.pdf output.ps && ps2pdf output.ps output.pdf ### Webservice http://compress.smallpdf.com/de For linux #!/bin/sh gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile="compress_$@" "$@" ./compresspdf.sh file.pdf find -type f -name "*.pdf" -exec ./compresspdf.sh {} \; #!/bin/sh INPUT = $1 ; shift OUTPUT = $1 ; shift GS_BIN =/ usr / bin / gs QFACTOR = "0.40" # Image Compression Quality # # Quality HSamples VSamples QFactor # Minimum [2 1 1 2] [2 1 1 2] 2.40 # Low [2 1 1 2] [2 1 1 2] 1.30 # Medium [2 1 1 2] [2 1 1 2] 0.76 # High [1 1 1 1] [1 1 1 1] 0.40 # Maximum [1 1 1 1] [1 1 1 1] 0.15 $ { GS_BIN } - dBATCH - dSAFER - DNOPAUSE -...

resize images in Linux

Reduce images files png or jpg jpeg in subdirectories find -type f -name "*.jpeg" -exec jpegoptim --strip-all {} \; optipng *.png find -type f -name "*.png" -exec optipng {} \;