Iulian

Ce este Docker?

Docker este un set de produse platforma ca serviciu care utilizeaza virtualizarea la nivel de sistem de operare pentru a livra software in pachete numite containere. Serviciul are atat niveluri gratuite, cat și niveluri premium. Docker CE, Docker EE. Software-ul care gazduieste containerele se numeste Docker Engine.

Docker engine este folosit pentru a realiza imaginile docker dar si containerele.

Docker poate fi folosit pe distributii Linux, MacOS dar si pe Windows.

Docker Hub – Pe acest site sunt publicate cele mai populare imagini docker.

Docker composer – acest tool este folosit pentru a defini aplicatii care folosesc multiple containere Docker.

Poti folosi Docker aproape oriunde, in Cloud, pe instante fizice dar si pe masini virtuale ( VDS, VPS ).

Script bash generator de parola

#!/bin/bash
# Generate password that has guaranteed 1 lowecase, 1 uppercase, 1 special character, minimum 13 characters

function generatePass {
choose() { echo ${1:RANDOM%${#1}:1} $RANDOM; }
{
    choose '[email protected]#$&'
    choose '0123456789'
    choose 'abcdefghijklmnopqrstuvwxyz'
    choose 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    for i in $( seq 1 $(( 8 + RANDOM % 8 )) )
    do
        choose '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    done

} | sort -R | awk '{printf "%s",$1}'
echo ""
}

generatePass

Script bash user input

#!/bin/bash
#Require user input (select 1 or 2 on keyboard)

echo "Continue ?"
select yn in "Yes" "No"; do
    case $yn in
        Yes )

echo "The script has continued"
echo "some command 1"
echo "some command 2"
break;;

        No ) exit;;
    esac
done

Script bash pentru monitorizare spatiu pe disk ( hdd )

#!/bin/bash
ROOT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
DATADISK=$(df /var/www | grep / | awk '{ print $5}' | sed 's/%//g')
THRESHOLD=85

#Monitor root partition
if [ "$ROOT" -gt "$THRESHOLD" ] ; then
    mail -E -s 'Disk Space Alert' [email protected] << EOF
Your root partition remaining free space is critically low. Used: $ROOT%
EOF
fi

#Monitor mounted disk
if [ "$DATADISK" -gt "$THRESHOLD" ] ; then
    mail -E -s 'Disk Space Alert' [email protected] << EOF
Your datadisk partition remaining free space is critically low. Used: $DATADISK%
EOF
fi