Skip to content

Commit

Permalink
many changes
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsiryk committed Feb 28, 2017
1 parent ffcb23e commit adbdef6
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 75 deletions.
2 changes: 1 addition & 1 deletion Elastic/elk_stack_ubuntu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Add CRON tasks to renew automatically Letsencrypt certs::
sudo crontab -e

# Check or renew certs twice per day
0 12,18 * * * root letsencrypt renew
0 12,18 * * * letsencrypt renew



Expand Down
17 changes: 15 additions & 2 deletions MacOS/mac_os.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Mac OS
======

Remote connect::

https://support.apple.com/en-us/HT201710


Create bootable flash
---------------------
Expand All @@ -10,8 +14,17 @@ Mac OS Sierra - http://www.macworld.com/article/3092900/macs/how-to-create-a-boo





Brew
----

Installation::

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


Install some app::

brew install <app>



Expand Down
5 changes: 5 additions & 0 deletions curl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ curl
Hide output::

curl -s 'http://example.com' > /dev/null


Basic auth::

curl -u user:password https://example.com
29 changes: 28 additions & 1 deletion haproxy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@ haproxy.cfg::
stick match <pattern> [table <table>] [{if | unless} <cond>]



Proxy to backend depending on hostname. Only https. If hostname rule is not exist - proxy to default backend::

frontend https-front-session
bind *:443 ssl crt /etc/ssl/key.pem
bind *:80
redirect scheme https if !{ ssl_fc }

default_backend back-session

acl is_old hdr_end(host) -i old.example.com
use_backend old_example if is_old

acl is_new hdr_end(host) -i new.example.com
use_backend new_example if is_new


SSL backend::

backend be
Expand Down Expand Up @@ -69,6 +86,15 @@ That's all you need to use HATop::
sudo hatop -s /run/haproxy/admin.sock


HAProxy + LetsEncrypt
---------------------

::

sudo apt install letsencrypt





Geolocation
Expand All @@ -83,4 +109,5 @@ Sticky session

- http://blog.haproxy.com/2012/03/29/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/
- https://docs.oracle.com/cd/E37670_01/E41138/html/section_jyh_zhz_4r.html
-


36 changes: 0 additions & 36 deletions letsencrypt.txt

This file was deleted.

15 changes: 15 additions & 0 deletions linux_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ adduser <name> // создать нового пользователя
-r # create system user
-g # group


Add existing user to existing group::

sudo usermod -a -G groupName userName


useradd
-u # UID
-r # create system user
Expand Down Expand Up @@ -104,6 +110,15 @@ lsblk // вывести инфу о дисках
sudo dmidecode -t system // информация об аппаратной составляющей компьютера (можно узнать какая машина - виртуальная или физическая)


CPU benchmark::

apt install sysbench
sysbench --test=cpu --cpu-max-prime=20000 run





################## уменьшаем размер *.vdi ######################
sudo dd if=/dev/zero of=zero bs=512k // на гостевой машине - заполнить нулями пустое место (после чего этот файл надо удалить)
bs= // размер сектора
Expand Down
23 changes: 23 additions & 0 deletions nginx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,27 @@ Change the Nginx default server block ``/etc/nginx/sites-available/default``::
}


NGINX log off
-------------

Off images access loging in access_log::

location ~* \.(gif|jpg|png) {
access_log off;
}


Change images access logimg location::

location ~* \.(gif|jpg|png)$ {
access_log /path/to/access.log;
}


Off access loging to dir and subdir::

location ^~ /images/ {
access_log off;
}


9 changes: 0 additions & 9 deletions nginx_config.txt

This file was deleted.

24 changes: 0 additions & 24 deletions nginx_log_off.txt

This file was deleted.

7 changes: 7 additions & 0 deletions qemu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ qemu-system-x86_64
===================


Show supported machines types::

qemu-system-x86_64 -machine help


Create image::

qemu-img create -f qcow2 /path/to/image.qcow2 15g
4 changes: 2 additions & 2 deletions ssl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ Add CRON tasks (auto renew)::
sudo crontab -e

# Check or renew certs twice per day
30 12 * * * root letsencrypt renew
0 18 * * * root letsencrypt renew
30 12 * * * letsencrypt renew
0 18 * * * letsencrypt renew
10 changes: 10 additions & 0 deletions vnc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
===
VNC
===

xtightvncviewer
---------------

::

xtightvncviewer IP -quality 0

0 comments on commit adbdef6

Please sign in to comment.