-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
useful_commands.txt
41 lines (33 loc) · 1.11 KB
/
useful_commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
pushd exercises/unnamed
#Renames
for i in *.png; do new=`echo $i | sed -e 's/FFFFFF/white/' -e 's/009CA8/turquoise/' -e 's/BBBBBB/dark/' | sed -e 's/.*_\([0-9]*\)_/\1-/'`; mv $i $new; done
#Derefernce ids
while IFS='' read -r line || [[ -n "$line" ]]; do
first=`echo $line | cut -f1 -d' '`
second=`echo $line | cut -f9 -d'/'`
if [ -e "$first-white.png" ]
then mv -n "$first-white.png" "../$second-white.png"
fi
if [ -e "$first-turquoise.png" ]
then mv -n "$first-turquoise.png" "../$second-turquoise.png"
fi
if [ -e "$first-dark.png" ]
then mv -n "$first-dark.png" "../$second-dark.png"
fi
done < "../../icon_mappings.txt"
# find non square ones
#for i in *.png; do identify $i; done | grep -v 150x150 | less
for img in `for i in *.png; do identify $i; done | grep -v 150x150 | cut -f1 -d' '`
do convert \
$img \
-thumbnail '150x150>' \
-background transparent \
-gravity center \
-extent 150x150 \
-compose Copy_Opacity \
resized.png
mv resized.png $img
done
aws s3 sync --profile exercism --acl public-read exercises s3://exercism-static/exercises
#--------
gi