This file contains hidden or 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
| version: "3.1" | |
| services: | |
| wordpress: | |
| image: wordpress | |
| ports: | |
| - 8080:80 | |
| environment: | |
| WORDPRESS_DB_PASSWORD: password |
This file contains hidden or 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
| pngquant --ext .png --force *.png |
This file contains hidden or 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
| pngquant --quality=70-99 input.png -o output.png |
This file contains hidden or 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
| current_line=$(awk "NR==$current_row" "$FILE") |
This file contains hidden or 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
| ## wait for input | |
| read -n 1 -s INPUT | |
| # Valid input: | |
| # | |
| # m: next line / slide | |
| # n: previous slide | |
| # q: quit presenter | |
| while [ "$INPUT" != "q" ]; do |
This file contains hidden or 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
| # check if param 1 is not empty and if the file exists | |
| if [ -z $1 ] ; then | |
| echo "Param 1 missing. Must have a file to present." | |
| exit | |
| else | |
| FILE="$1" | |
| fi | |
| if [ ! -f $FILE ] ; then | |
| echo "File not found." |
This file contains hidden or 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
| # declare a subrutine | |
| kewl(){ | |
| echo "kewl!"; | |
| #access arguments in $1, $2 ... etc | |
| echo "$1" | |
| # declare a local variable | |
| local LOCAL_IN = 1 | |
| } |
This file contains hidden or 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
| case $VAL in | |
| ( 1 ) echo "The val is 1" ; echo "Echoing out some more text" ;; | |
| ( 2 ) echo "The val is 2" ;; | |
| ( * ) echo "The value is not 1 or 2" ;; | |
| esac | |
| # There is a shorter version to case aswell | |
| case $OS in | |
| ubuntu ) echo "Running ubuntu" ;; | |
| centos ) echo "Running centos" ;; |
This file contains hidden or 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
| # for-each | |
| MY_ARRAY=("one", "two", "three") | |
| for i in MY_ARRAY ; do | |
| echo $i | |
| done | |
| # extended for-loop | |
| for (( i=0; i "-lt" 3; i++ )) ; do | |
| echo $i |
This file contains hidden or 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
| while command ; do | |
| something | |
| done |
NewerOlder