Monday, October 14, 2019

CentOS 7 OpenVPN

yum install epel-release
yum install openvpn

In pfSense - download file from VPN > OPenVPN > Client > Inline > Most Clients (for example test.ovpn)

mv test.ovpn /etc/openvpn/test.conf

Add new user in pfSense "System Manager" and write down user and password

openvpn --config /etc/test.conf # enter you username and password when prompted

Monday, September 30, 2019

SAP 2

SAP HANA Sizing


SAP HANA Pre OS Installation Sizing:

Sizing for this categories is needed:
  1. memory for static data
  2. memory for objects created during runtime
  3. disk sizing
  4. CPU sizing

RAM
SDF (Source Data Footprint) is current Oracle DB size without indexes and blobs (for Oracle use dba_segments).
RAM size = SDF * 2 / 7 (i.e. RAM Size = 300 * 2 / 7 = 85GB but HANA minimum recomendation is 128GB of RAM)

Describing formula:
  1. Both static (in-memory store) and dynamic (executing queries and loading data) RAM data sizes are sized. "2"  comes from RAM dynamic = RAM static.
  2. "7" comes from average compression factor database table size : HANA memory = 7 : 1

HDD

Backup storage >= /hana/data + /hana/log
  • OS = 50GB 
  • /hana/data  = 1 * SDF (i.e. Disk data = 1 * 300 = 300GB)
  • /hana/shared min 1*RAM and up to 1TB = 85GB
  • /hana/log (1/2 * 85 = 42.5GB):
    • if RAM Size <= 512GB = 1/2 * RAM
    • if RAM Size > 512GB = 512GB
  • /usr/sap = 50gb
  • Total HDD = 50 + 300 + 85 + 42.5 + 50 = 527.5GB
CPU

Approximation:
0.0625 core/vCPU is needed per 1GB of RAM

core/vCPU =0.0625 * 128 = 8

Sizing summary
SDF = 300GB
RAM = 128GB
HDD = 527.5GB
core/vCPU = 8

SAP 1

What is SAP

SAP ERP (Enterprise Resource Planning) software is central application which covers Sales and Distribution (SAP SD), Production Planning (SAP PP), Financials (SAP FI), Human Capital Management (SAP HCM) and many more.
SAP ERP is a transactional system with data being written to its database frequently in a productive business environment.

Analytical operations are usually performed in SAP BW or HANA models.

SAP BW (Business Warehouse) - data warehouses (DW) are applications on a separate database that take data from source systems, then using ETL (Extraction, Transformation, Loading) process cleanse it, apply business logic and optimally store it within themselves for faster access from reports. ETL process is used to more quickly access KPIs (Key Performance Indicators - are being measured across time frames and used for measuring companies to make forecast and decisions) of the company.

Before SAP BW on HANA arrived, one of the biggest downfalls of SAP BW was that there were too many layers of redundant data from pre-cleansing, cleansing and multiple layers of transforming data. All this inherent latency (time taken for data to reach from source to reporting layer) made it a bulky truck which always got the job done but was never meant for a street race. Then came SAP HANA – SAP’s new revolutionary database and then the idea to take the BW application off the traditional databases and put it on top of HANA.

And now BW on HANA is BW4/HANA

SAP flow is as follows:
1) ERP
2) Cleansing and homogenization of data
3) BI
4) from BI to Business Strategy
5) ERP

Calculating ASA Throughput

  1. copy output of command below to the asaThroughput text file:
    1. show traffic | begin Aggregated Traffic on Physical Interface
  2. delete all traffic statistics for interfaces with "Internal" word
  3. Automatically count bytes in all interfaces statistics:
    1. bytes=$(grep -E "bytes$" asaThroughput  | \
    2. grep -v "0 packets.*0 bytes" | \
    3. awk '{s=s+$3} END {print s}')
  4. select the first appearance of the number of seconds of traffic statistics:
    1. seconds=$(grep -m 1 secs asaThroughput | \
    2. awk '{print $3}' | \
    3. cut -d\. -f 1)
  5. get final result (ASA throughput in Mbps):
    1. echo $((bytes/seconds*8/1024/1024))

Friday, September 27, 2019

DSL chip codes/abbreviations

ALCB Alcatel
ANDV Analog Devices
BDCM Broadcom
GSPN Globespan
IKNS Ikanos
IFTN Infineon
META Metanoia
STMI STMicroelectronics
TSTS Texas Instruments

Monday, August 19, 2019

Writing special symbols (Mathematics, Statistics) in HTML


x-bar = x̄ = x&#772; or x&#x0304; (hex)
x-hat = x̂ = x&#770; or x&#x0302; (hex)
x-arrow = x⃗ = x&#8407;
degree = ° = &#176;
left ceiling = ⌈ = &#8968;
right ceiling = ⌉ = &#8969;
left floor = ⌊ = &#8970;
right floor = ⌋ = &#8971;
real-numbers set = ℝ = &#8477;
greek uppercase a = A = &#913;
function = ƒ =&#402;
Sum = ∑ = &#8721;
Hadamard product = ⊙ = &#8857;
dot = ⋅ = &#8901;
not equal = ≠ = &#8800;

Linear Algebra 4. Matrix multiplication.

When you apply one LT and then the other LT (example: 90° clockwise rotation and then shear (shift) the overall effect is another LT which is composition of two LT. This LT will capture overall effect of applying 2 LTs into a single LT.
Applying several LT to one vector is like using several functions and using output of one function as input to the other:
ƒ(g(x)) where:

  1. g is the first LT with input "x"
  2. ƒ is the second LT with input from the previous LT
So the same as with functions - we apply LT from right to the left. 
The composition of two LTs is multiplication / product / dot product of two LT - product of two matrices:
C  = AB  where:

  1. A have the same number of columns as B has rows or mathematically
    1.  Al x m and Bm x n 
    2. easy way - to check dot product possibility
      1.  example: A2 x 3 and B3 x 4
      2. Write dimensions of matrices one after the other with "=" sign between them:
        1. 2 x 3 = 3 x 4  as you see 3 = 3, so we can dot-product these matrices
      3. example: A2 x 2 and B3 x 3
        1. 2 x 2  = 3 x 3 as you see 2 = 3 is not true, so we can't multiply that matrices
  2. Ci,j = m Ai,k Bk,j
    ∑
    k=1
    this means: starting with k=1 and till k=m multiply each Ai,k by Bk,j and also i = {1,2,...,l} and j={1,2,..,n}
For example if we have two matrices and want to find their dot-product:
⌈ 0 2 ⌉ ⌈ 1 -2 ⌉
⌊ 1 0 ⌋ ⌊ 1 0 ⌋
A2 x 2 and B2 x 2 find k:  2 x 2 = 2 x  2 , 2 = 2, k = 2, k shows how many times we sum product of factors A and B:

Change general formula for this particular case:
Ci,j = 2 Ai,k Bk,j
∑
k=1
Then:
C1,1 = 2 A1,k Bk,1 = A1,1 B1,1 + A1,2 B2,1 = 0*1 + 2*1 = 2
∑
k=1

C1,2 = A1,1 ⋅ B1,2 + A1,2 ⋅ B2,2= 0*(-2) + 2*0 = 0
C2,1 = A2,1 ⋅ B1,1 + A2,2 ⋅ B2,1= 1*1 + 0*1 = 1
C2,2 = A2,1 ⋅ B1,2 + A2,2 ⋅ B2,2= 1*(-2) + 0*0 = -2

The simplest way to calculate matrix dot product is to approach it as matrix vector product:
First we find î of the right matrix after applying left matrix (LT):
⌈ 0 2 ⌉ ⋅ ⌈ 1 ⌉
⌊ 1 0 ⌋ ⌊ 1 ⌋
Secondly we find ĵ hat of the right matrix after applying left matrix (LT):
⌈ 0 2 ⌉ ⋅ ⌈ -2 ⌉
⌊ 1 0 ⌋ ⌊ 1 ⌋
​
Matrix product properties:
A(B + C) = AB + AC distributive property
A(BC) = (AB)C associative property
But AB≠BA (because matrix is LT, and LT is like function, so apply right to left)

Also matrix element wise product (or Hadamard product) exists. It is supported only for matrices of the same shape:
C = A ⊙ B where Ci,j = Ai,j Bi,j

With 3-D Tensor basis are î , ĵ and k̂ and it's linear combination is:

v = î xî + yĵ + zk̂
ĵ =
k̂

These materials were used while preparing this blog-post:
  1. https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab
  2. https://www.deeplearningbook.org/
  3. NBGtLA by https://minireference.com/