Skip to content

Commit

Permalink
many fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsiryk committed Apr 13, 2017
1 parent afd1494 commit cce9aa2
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 5 deletions.
10 changes: 10 additions & 0 deletions Docker/docker_compose.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ Bash completion (https://docs.docker.com/compose/completion/)::
--rmi all # + del all service images



::

version: '2.1'
services:
nginx1:
env_file: .env



Example nginx ``docker-compose.yml``::

version: '2'
Expand Down
11 changes: 11 additions & 0 deletions bash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ BASH
====


Boolean in BASH::

VAR=true

if [ "$VAR" = true ] ; then
echo 'true'
fi


Check if a variable is set::

if [ -z ${var+x} ]; then
Expand All @@ -11,6 +20,8 @@ Check if a variable is set::
echo "var is set to '$var'"
fi

# this will return true if a variable is unset or set to the empty string ("")
if [ -z "$VAR" ];



Expand Down
11 changes: 9 additions & 2 deletions git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ https://git-scm.com/book/ru/v2
add <name>



Change url::

git remote set-url origin git@bitbucket.org:johnsmith/test.git


::

git remote add origin https://github.com/johnsmith/test.git
Expand All @@ -33,8 +39,9 @@ https://git-scm.com/book/ru/v2
-d hotfix # delete unused branch
-D testing # delete unused branch also if not merged

git checkout testing # switching to branch testing (HEAD transfer to branch testing)
-b iss53 # create and switching branch
git checkout testing # switching to branch testing (HEAD transfer to branch testing)
-b iss53 # create and switching branch
git checkout path/to/file # switching file version from server

git merge hotfix # merge current branch with hotfix

Expand Down
9 changes: 6 additions & 3 deletions nginx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ NGINX config
::

server {
...
client_max_body_size 32m; // размер загружаемого файла клиентом на сервер
...
# size of upload files
client_max_body_size 32m;

# 301 redirect
return 301 https://example.com$request_uri;
return 301 https://$host$request_uri;
}


Expand Down
21 changes: 21 additions & 0 deletions scripts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
==============
Useful scripts
==============

Low disk space alert
--------------------

::

#!/bin/bash
CURRENT=$(df /data | grep / | awk '{ print $5}' | sed 's/%//g')
THRESHOLD=90

echo "$CURRENT"

if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
echo "Low Disk Space Alert: ${CURRENT}% used"
mail -s 'Disk Space Alert' admin@gmail.com << EOF
Backup server remaining free space is critically low. Used: $CURRENT%
EOF
fi
7 changes: 7 additions & 0 deletions sendmail.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
========
Sendmail
========

Send mail from console::

(echo "Subject:Hi"; echo "Body contents";) | sendmail -v -F "test" my@mail

0 comments on commit cce9aa2

Please sign in to comment.