This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
touch optipng.log | |
touch jpegoptim.log | |
echo `date` >> optipng.log | |
find . -iname '*.png' -print0 | xargs -0 optipng -o7 -log optipng.log -preserve | |
echo `date` >> jpegoptim.log | |
find . -iname '*.jpg' -print0 | xargs -0 jpegoptim --max=90 --preserve --totals >> jpegoptim.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## This script simply gets a line (with url) from | |
## the file setted as parameter and checks its url | |
## response code | |
## | |
## example: ./script.sh urls.txt | |
## | |
## https://github.com/aozimkov | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for FILE in $(ls *.jpg) | |
do | |
W=`identify -verbose "$FILE" | grep -oe "Geometry:.*" | sed -e 's/.*: //' | sed -e 's/x.*//'` | |
H=`identify -verbose "$FILE" | grep -oe "Geometry:.*" | sed -e 's/.*x//' | sed -e 's/+.*//'` | |
if [ "$W" -gt "$H" ] | |
then | |
mogrify "$FILE" -extent "$W"x"$W" -gravity center -quality 100 jpeg:"$FILE" | |
fi | |
if [ "$H" -gt "$W" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir img-with-watermark | |
WATERMARK='Some text here' | |
for FILE in *.jpg; do | |
W=`identify -verbose "$FILE" | grep -oe "Geometry:.*" | sed -e 's/.*: //' | sed -e 's/x.*//'` | |
H=`identify -verbose "$FILE" | grep -oe "Geometry:.*" | sed -e 's/.*x//' | sed -e 's/+.*//'` | |
convert -background '#0000' -fill '#0004' -gravity center -size "$W"x"$(($H / 6))" caption:"$WATERMARK" ./"$FILE" +swap -gravity center -composite ./img-with-watermark/"$FILE" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
checker(){ | |
URL=$1 | |
STATUS=`curl -s -o /dev/null -w "%{http_code}" $URL` | |
if [ $STATUS -eq 200 ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SITEMAP=$1 | |
if [ "$SITEMAP" = "" ]; then | |
echo "Usage: $0 http://domain.com/sitemap.xml" | |
exit 1 | |
fi | |
XML=`wget -O - --quiet $SITEMAP` |