Skip to content

Commit

Permalink
many changes
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsiryk committed Feb 3, 2017
1 parent bbfb0d5 commit 824daa3
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 64 deletions.
Empty file removed Docker/docker_file_templates.txt
Empty file.
6 changes: 3 additions & 3 deletions cloning_disk.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=============
Clonning disk
=============
============
Cloning disk
============

This instructions about how you can clone full your physical disk to another physical disk.

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


Hide output::

curl -s 'http://example.com' > /dev/null
32 changes: 31 additions & 1 deletion haproxy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,38 @@ haproxy.cfg::

# Define a request pattern matching condition to stick a user to a server
stick match <pattern> [table <table>] [{if | unless} <cond>]


SSL backend::

backend be
balance roundrobin
server s1 example.com:443 check ssl verify none
# ssl verify none - without ssl verification




HATop
-----

HATop is an interactive ncurses client and real-time monitoring,
statistics displaying tool for the HAProxy TCP/HTTP load balancer.

http://feurix.org/projects/hatop/


First of all, make sure you have the stats socket enabled in the haproxy config::

global
stats socket /run/haproxy/admin.sock mode 0600 level admin


That's all you need to use HATop::

sudo hatop -s /run/haproxy/admin.sock




Geolocation
-----------
Expand Down
151 changes: 93 additions & 58 deletions libvirt_qemu_kvm_debian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,41 @@
libvirt + QEMU + KVM + Debian
=============================

egrep -c '(vmx|svm)' /proc/cpuinfo
sudo kvm-ok
Check cpu virtualization access::

sources.list
deb http://ftp.de.debian.org/debian jessie main non-free
deb-src http://ftp.de.debian.org/debian jessie main non-free
egrep -c '(vmx|svm)' /proc/cpuinfo
sudo kvm-ok

sudo apt-get update
sudo apt-get dist-upgrade

# install drivers
sudo apt-get install firmware-realtek firmware-linux
Check Debian source list ``sources.list``::

sudo apt-get install bridge-utils
deb http://ftp.de.debian.org/debian jessie main non-free
deb-src http://ftp.de.debian.org/debian jessie main non-free

nano /etc/sysctl.conf
net.ipv4.ip_forward=1

# create bridge
sudo brctl addbr br0
Bridge configuration
--------------------

::

sudo apt-get update
sudo apt-get dist-upgrade

# install drivers
sudo apt-get install firmware-realtek firmware-linux

sudo apt-get install bridge-utils

nano /etc/sysctl.conf
net.ipv4.ip_forward=1

Create bridge::

sudo brctl addbr br0


Network configuration ``/etc/network/interfaces``::

sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback

Expand All @@ -41,66 +54,88 @@ sudo nano /etc/network/interfaces
bridge_fd 0
bridge_maxwait 0

sudo /etc/init.d/networking restart
ifconfig

Restart and check network configuration::

sudo /etc/init.d/networking restart
ifconfig


Show bridges::

brctl show


Install KVM, libvirt
--------------------

::

apt-get install qemu-kvm libvirt-bin
adduser root libvirt
adduser lee libvirt

::

/etc/libvirt/ # configs
/etc/libvirt/storage/ # storage configs
/var/lib/libvirt/ # images, snapshots, etc.


Virt-manager
------------

apt-get install qemu-kvm libvirt-bin
adduser root libvirt
adduser lee libvirt
Install latest version::

# установка самой новой версии vit-manager'a
sudo wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
sudo sh -c 'echo "deb http://archive.getdeb.net/ubuntu wily-getdeb apps" >> /etc/apt/sources.list.d/getdeb.list'
sudo apt-get update && sudo apt-get dist-upgrade
apt-get install virt-manager
sudo wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
sudo sh -c 'echo "deb http://archive.getdeb.net/ubuntu wily-getdeb apps" >> /etc/apt/sources.list.d/getdeb.list'
sudo apt-get update && sudo apt-get dist-upgrade
apt-get install virt-manager

# конфиг virt-manager лежит тут ~/.gconf/apps/virt-manager/
# config file virt-manager
~/.gconf/apps/virt-manager/


/etc/libvirt/ хранятся конфигурационные файлы
/etc/libvirt/storage/ storage's конфиги
/var/lib/libvirt/ будут хранится образы жестких дисков, мгновенные снимки системы и многое другое.
Virsh
-----

####################
# посмотреть мосты
brctl show
::

virsh # попадаем в virsh
help # список всех команд
virsh # попадаем в virsh
help # список всех команд

pool-list --all # список хранилищ (storages)
pool-list # список активных хранилищ (storages)
pool-list --all # список хранилищ (storages)
pool-list # список активных хранилищ (storages)

pool-define-as name_of_storage dir --target /etc/libvirt/images/ # создаем хранилище
pool-autostart name_of_storage # делаем, чтобы пул запускадся автоматически
pool-start name_of_storage # стартуем пул
pool-define-as name_of_storage dir --target /etc/libvirt/images/ # создаем хранилище
pool-autostart name_of_storage # делаем, чтобы пул запускадся автоматически
pool-start name_of_storage # стартуем пул


# смотреть список машин
virsh --connect qemu:///system list
# смотреть список машин
virsh --connect qemu:///system list

# сгенерировать xml
virsh --connect qemu:///system dumpxml <domain> > <domain>.xml
# сгенерировать xml
virsh --connect qemu:///system dumpxml <domain> > <domain>.xml

# Создания нового гостевого домена и запуска виртуальной машины
virsh --connect qemu:///system create alice.xml
# Создания нового гостевого домена и запуска виртуальной машины
virsh --connect qemu:///system create alice.xml

# Остановка виртуальной машины и уничтожения гостевого домена
virsh --connect qemu:///system destroy alice
# Остановка виртуальной машины и уничтожения гостевого домена
virsh --connect qemu:///system destroy alice

# Выключения виртуальной машины (без уничтожения домена)
virsh --connect qemu:///system shutdown alice
# Выключения виртуальной машины (без уничтожения домена)
virsh --connect qemu:///system shutdown alice

# Приостановка/возобновление работы виртуальной машины
virsh --connect qemu:///system suspend alice
virsh --connect qemu:///system resume alice
# Приостановка/возобновление работы виртуальной машины
virsh --connect qemu:///system suspend alice
virsh --connect qemu:///system resume alice

# Для автозапуска виртуальной машины после загрузки хоста
virsh --connect qemu:///system autostart alice
# Для автозапуска виртуальной машины после загрузки хоста
virsh --connect qemu:///system autostart alice

# Получить информациюо домене виртуальной машины
virsh --connect qemu:///system dominfo alice
# Получить информациюо домене виртуальной машины
virsh --connect qemu:///system dominfo alice

# Управлять виртуальными машинами из сессии virsh. Для создания новой сессии virsh и входа в нее:
virsh --connect qemu:///system
# Управлять виртуальными машинами из сессии virsh. Для создания новой сессии virsh и входа в нее:
virsh --connect qemu:///system
2 changes: 1 addition & 1 deletion python_simple_http_server.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Python SimpleHTTPServer

for python 3.x version, you may need ::

sudo python -m http.server 80
sudo python3 -m http.server 80


Ports below 1024 require root privileges.
Expand Down
7 changes: 6 additions & 1 deletion ssh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ SSH
-f background run
-i <private_key> path to private key
-p <port>



::

ssh-add <path_to_private_key>


SSH tunneling
-------------
Expand Down
8 changes: 8 additions & 0 deletions tomcat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
======
Tomcat
======

Get static file from tomcat server
----------------------------------

Find ``webapps`` directory, usually it sutuated in ``/var/lib/tomcat7/webapps``. In this dir create some dir ``webapps/downloads`` and put there some files. Files will available at URL ``<hostname>/downloads/<filename>``.

0 comments on commit 824daa3

Please sign in to comment.