-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b44f0b3
commit bbfb0d5
Showing
9 changed files
with
199 additions
and
27 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
======================================== | ||
Gedit and xed docker syntax highlighting | ||
======================================== | ||
|
||
|
||
https://github.com/mrorgues/gedit-xed-docker-syntax-highlighting | ||
|
||
|
||
:: | ||
|
||
wget -q https://raw.githubusercontent.com/mrorgues/gedit-xed-docker-syntax-highlighting/master/docker.lang | ||
sudo mv -i docker.lang /usr/share/gtksourceview-3.0/language-specs/docker.lang | ||
sudo chmod 644 /usr/share/gtksourceview-3.0/language-specs/docker.lang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
============= | ||
Clonning disk | ||
============= | ||
|
||
This instructions about how you can clone full your physical disk to another physical disk. | ||
|
||
**https://wiki.archlinux.org/index.php/disk_cloning** | ||
|
||
|
||
dd (clonning) | ||
------------- | ||
|
||
This will clone the entire drive, including the MBR (and therefore bootloader), all partitions, UUIDs, and data:: | ||
|
||
dd if=/dev/sdX of=/dev/sdX bs=32M conv=sync,noerror | ||
|
||
|
||
- ``noerror`` instructs dd to continue operation, ignoring all read errors. Default behavior for dd is to halt at any error. | ||
- ``sync`` fills input blocks with zeroes if there were any read errors, so data offsets stay in sync. | ||
- ``bs=`` sets the block size. Defaults to ``512 bytes``, which is the "classic" block size for hard drives since the early 1980s, but is not the most convenient. Use a bigger value, 64K or 128K. | ||
|
||
.. note:: | ||
|
||
If you are positive that your disk does not contain any errors, you could proceed using a larger block size, which will increase the speed of your copying several fold. For example, changing bs from 512 to 64K changed copying speed from 35 MB/s to 120 MB/s on a simple Celeron 2.7 GHz system. But keep in mind that read errors on the source disk will end up as block errors on the destination disk, i.e. a single 512-byte read error will mess up the whole 64 KiB output block. | ||
|
||
|
||
.. note:: | ||
|
||
If you would like to view dd progressing, use the ``status=progress`` option. | ||
|
||
|
||
|
||
Maybe faster (not testing):: | ||
|
||
dd if=/dev/sda | dd of=/dev/sdb | ||
|
||
|
||
cat (clonning) | ||
-------------- | ||
|
||
Clonning with **cat**:: | ||
|
||
cat /dev/sda > /dev/sdb | ||
|
||
|
||
If you want to run this command in sudo, you need to make the redirection happen as root:: | ||
|
||
sudo sh -c 'cat /dev/sdb >/dev/sdc' | ||
|
||
|
||
pv (clonning) | ||
-------------- | ||
|
||
If you want a progress report and your unix variant doesn't provide an easy way to get at a file descriptor positions, you can install and use pv instead of cat:: | ||
|
||
pv /dev/sda > /dev/sdb | ||
|
||
|
||
Backuping in file | ||
----------------- | ||
|
||
To save space, you can compress data produced by dd with gzip, e.g.:: | ||
|
||
dd if=/dev/hdb | gzip -c > /image.img | ||
|
||
|
||
You can restore your disk with:: | ||
|
||
gunzip -c /image.img.gz | dd of=/dev/hdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
======= | ||
HAProxy | ||
======= | ||
|
||
- Check repository for your OS: https://haproxy.debian.net/ | ||
- Documentation: http://www.haproxy.org/download/1.7/doc/configuration.txt | ||
|
||
|
||
Add header if ssl:: | ||
|
||
http-request add-header X-Forwarded-Proto https if { ssl_fc } | ||
|
||
|
||
Check config:: | ||
|
||
haproxy -c -f /etc/haproxy/haproxy.cfg | ||
|
||
|
||
|
||
haproxy.cfg:: | ||
|
||
frontend fe | ||
|
||
# HTTP log format format, which is the most advanced for HTTP proxying. | ||
# It provides the same information as the TCP format with some HTTP-specific fields such as the request, the status code, and captures of headers and cookies. | ||
# This format is recommended for HTTP proxies. | ||
option httplog | ||
|
||
backend be | ||
|
||
stick-table type string len 32 size 1M peers haproxy-peers | ||
# type string len 32 - String 32 characters | ||
# size 1M - maximum number of entries that can fit in the table. Count approximately 50 bytes per entry, plus the size of a string if any. | ||
# The size supports suffixes "k", "m", "g" for 2^10, 2^20 and 2^30 factors. | ||
|
||
# Define a request pattern to associate a user to a server | ||
stick on req.cook(SERVERID) | ||
|
||
# Define a request pattern matching condition to stick a user to a server | ||
stick match <pattern> [table <table>] [{if | unless} <cond>] | ||
|
||
|
||
|
||
Geolocation | ||
----------- | ||
|
||
- http://agiletesting.blogspot.com/2014/01/geolocation-detection-with-haproxy.html | ||
- http://blog.haproxy.com/2012/07/02/use-geoip-database-within-haproxy/ | ||
|
||
|
||
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 | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
======================= | ||
Python SimpleHTTPServer | ||
======================= | ||
|
||
:: | ||
|
||
sudo python -m SimpleHTTPServer 80 | ||
|
||
|
||
for python 3.x version, you may need :: | ||
|
||
sudo python -m http.server 80 | ||
|
||
|
||
Ports below 1024 require root privileges. | ||
|
||
As George added in a comment, running this command as root is not a good idea - it opens up all kinds of security vulnerabilities. | ||
|
||
However, it answers the question. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters