Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsiryk committed Jul 25, 2017
1 parent 63d8cf6 commit d1883f4
Show file tree
Hide file tree
Showing 13 changed files with 309 additions and 120 deletions.
Binary file added Git-branching-model.pdf
Binary file not shown.
10 changes: 10 additions & 0 deletions MacOS/mac_os.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
Mac OS instructions
===================

Get System Info on Mac OS::

hostinfo


Get screencapture via terminal::

screencapture -xr -t gif capture.gif


Turn on performance mode for macOS Server (OS X El Capitan 10.11 and later). Provides extended system limits (maxproc, etc.)::

# check
Expand Down
8 changes: 8 additions & 0 deletions bash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ BASH

http://talk.jpnc.info/bash_lfnw_2017.pdf


Add zeros before number::

VAR=15
echo "$(seq -f %03g $VAR $VAR)"
# 015


BASH if grep ixists statement::

if grep --quiet 'text' /path/to/file; then
Expand Down
28 changes: 28 additions & 0 deletions dash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
====
DASH
====

Installation
------------

``dash-install.sh``::

DASH_VERSION="dash-0.5.9.1"
DASH_ARCHIVE="$DASH_VERSION.tar.gz"

curl -O http://gondor.apana.org.au/~herbert/dash/files/$DASH_ARCHIVE
tar -xf $DASH_ARCHIVE
rm $DASH_ARCHIVE
cd $DASH_VERSION/
./configure
make
make install
echo "$(which dash)" >> /etc/shells
cd ..
rm -R $DASH_VERSION


::

chmod +x dash-install.sh
./dash-install.sh
74 changes: 74 additions & 0 deletions git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,80 @@ Git

https://git-scm.com/book/ru/v2

Development scheme
------------------

https://habrahabr.ru/post/106912/

Branches:

``master`` - permanent, stable. With tag
``develop`` - permanent
``feature`` - temporary
``release`` - temporary
``hotfix`` - temporary


**Feature branches**. Can start from ``develop``. Must pull to develop.::

# Start new feature
git checkout -b myfeature develop

# End new feature
git checkout develop # change branch
git merge --no-ff myfeature # merge branches
git branch -d myfeature # delete feature branch
git push origin develop # push changes to develop


**Release branches**. Can start from ``develop``. Must pull to develop and master. Can be named alike ``release-*``.::

# Start release
git checkout -b release-1.2 develop
./bump-version.sh 1.2 # some changes in project
git commit -a -m "Bumped version number to 1.2"

# End release
git checkout master # change branch
git merge --no-ff release-1.2 # merge branches
git tag -a 1.2 # set tag

# Keep actual develop branch
git checkout develop
git merge --no-ff release-1.2

# Delete release branch
git branch -d release-1.2


**Hotfix branches**. Can start from ``master``. Must pull to develop and master. Can be named alike ``hotfix-*``.::

# Start hotfix
git checkout -b hotfix-1.2.1 master
./bump-version.sh 1.2.1 # some fixes in project
git commit -a -m "Bumped version number to 1.2.1"

git commit -m "Fixed severe production problem"

# End hotfix
git checkout master
git merge --no-ff hotfix-1.2.1
git tag -a 1.2.1

# Keep actual develop branch
git checkout develop
git merge --no-ff hotfix-1.2.1

# Delete hotfix branch
git branch -d hotfix-1.2.1





Git tips and tricks
-------------------

Avoid **Are you sure you want to continue connecting (yes/no)** on connect via ssh keys::

# bitbucket
Expand Down
80 changes: 0 additions & 80 deletions libvirt.txt

This file was deleted.

125 changes: 125 additions & 0 deletions libvirt_qemu_kvm_debian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,49 @@ Check Debian source list ``sources.list``::



qemu-system-x86_64
------------------

Show supported machines types::

qemu-system-x86_64 -machine help


Networking - http://wiki.qemu.org/Documentation/Networking


qemu-img
--------

Images and snapshots - http://azertech.net/content/kvm-qemu-qcow2-qemu-img-and-snapshots

``qemu-img`` tool::

# Show information (size, backing files, snapshots)
qemu-img info <image.qcow2>

# Create a simple QCOW2 image file
qemu-img create -f qcow2 <image.qcow2> <max_capacity_in_gigabytes>g

# Create a QCOW2 image linked with base image
qemu-img create -b <base_image> -f qcow2 -l <new_image>

# List snapshots
qemu-img snapshot -l <imagename>

# Create snapshot
qemu-img snapshot -c <snapshot-name> <imagename>

# Apply snapshot
qemu-img snapshot -a <snapshot-name> <imagename>

# Delete snapshot
qemu-img snapshot -d <snapshot-name> <imagename>

# Clone image
qemu-img convert -p -f qcow2 <source_image> -O qcow2 <dest_image>



Nested virtualization
---------------------
Expand Down Expand Up @@ -67,6 +110,88 @@ Install KVM, libvirt
/var/lib/libvirt/ # images, snapshots, etc.


Libvirt
-------

``Domain.xml``::

# Port forwarding to machine::

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
<interface type='network'> -> <interface type='user'>
...
<qemu:commandline>
<qemu:arg value='-redir'/>
<qemu:arg value='tcp:2222::22'/>
</qemu:commandline>

# Custom loader::

<os>
<loader readonly='yes' type='pflash'>/path_to/OVMF_CODE-pure-efi.fd</loader>
<nvram>/path_to/fedora22_VARS.fd</nvram>
</os>



Virsh CMD
---------

::

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

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 # стартуем пул


# define domain from XML (without run)
virsh define <file.xml>

# undefine domain from XML
virsh undefine <domain>
virsh undefine --nvram <domain> # remove nvram

# show domains list
virsh list # run domains
virsh list --all # all domains

# generate xml from domain
virsh dumpxml <domain> > <domain>.xml

# create domain and start VM
virsh create <config.xml>

# remove domain and stop VM
virsh destroy alice

# shutdown VM
virsh shutdown <domain>

# suspend/resume VM
virsh suspend alice
virsh resume alice

# add domain to autostart on host run
virsh autostart <domain>

# get domain info
virsh dominfo <domain>

# Edit domain xml
virsh edit DOMAIN





Bridge configuration
--------------------

Expand Down
6 changes: 6 additions & 0 deletions linux_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Linux commands
==============


Get first line::

head -n 1


Sleep for 1 second between each xargs command::

ps aux | awk '{print $1}' | xargs -I % sh -c '{ echo %; sleep 1; }'
Expand Down
9 changes: 8 additions & 1 deletion ovh.com.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@
OVH.COM
=======

Kernel images by OVH **ftp://ftp.ovh.net/made-in-ovh/bzImage/**
Kernels
-------

Kernel images by OVH ``ftp://ftp.ovh.net/made-in-ovh/bzImage/``




0 comments on commit d1883f4

Please sign in to comment.