Monday, November 29, 2021

Open source options for Linux based VPN clients ( For Globalprotect VPN service )

Download location : https://github.com/yuezk/GlobalProtect-openconnect 

License : GNU General Public License v3.0


Bundled Features

VPN Client App                     - OpenConnect P2P VPN App

VPN Protocol / VPN Service - Global Protect ( Installed in your organization )

VPN Authentication                - SALM ( Web UI form to get user credentials )

UI interface                              - GNU QT

Below steps can be used to install the application from the source code.



Installation Steps

1. Clone the source code

          git clone https://github.com/yuezk/GlobalProtect-openconnect.git

          cd GlobalProtect-openconnect

2. Compile the source code and install ( Select the correct installation command for your Linux distro )

          ./scripts/install-ubuntu.sh

          ./scripts/install-opensuse.sh

          ./scripts/install-fedora.sh

          ./scripts/install.sh ( For other Linux distros )

3. Browse the Internet Applications in your Distro. You can find application called "GlobalProtect VPN" and open it.

4. Enter your VPN server hostname and click connect button




5. It will request your username and password for VPN login. This what we called SALM authentication  form.


6. If your organization requests 2-Factor-Authentication, proceed with that.

7. Once proceed with authentication, it will connect to your VPN service.







8. Icon will be appeared in the tray as well.




Thank you.

Saturday, November 13, 2021

Software Craftsmanship 1 - SOLID Design Principles - Focusing on JAVA

Rule No 1. Single Responsibility Principle 

A Java class should not be changed other than the main objective. 

Ex: Assume, AccountOperation.java is for credit , debit , balance check, transfers and payments related activities. Sending notifications, Validations, HTTPS authentication, formatting should not include in this class. They should be included in separate individual Java classes. 




Rule No 2 : Open Close Principle 

Always Ensure Rule No 1.

Open Principle

Software modules must be open for extension without breaking existing functionality. So this ensures existing implementations, system integrations as it is. Additional feature development need to be done by extending the base class. This feature can be achieved by implementing interfaces. Interface should be base lined / finalized with major functionalities. 


Close Principle 

Once implementation done, modules should be close for further changes. This ensures integrated systems will function as it is. This feature can be achieved by implementing interfaces as new method cannot be added to the interface without changing implemented classes.



Rule No 3.  Liskov Substitute Principle

Always Ensure Rule No 2.

Subclass objects should behave same as base class objects without breaking the application.

Rule No 4. Dependency Inversion Principle

Always Ensure Rule No 1.

Classes must depend on abstractions not implementations. Dependencies in classes must be based on interface level. So it will have no impact on logic changes in dependencies. 



 







Friday, November 5, 2021

Table Partitioning in Postgres DB

Partitioning can be done under different approaches like range partitioning, list partitioning, hash partitioning. 

Range Partitioning - ( Ex: Date ranges , Numeric ranges )

List Partitioning     - ( Ex: Transaction types )

Hash Partitioning   - ( Ex: Hash value based partitioning ) 


Create partitioned table with no primary key

Step 1: Create table

 CREATE TABLE Invoice (

    invoice_id   int,
    invoice_amount float,
    invoice_date date

) PARTITION BY RANGE(invoice_date);

Step 2 : Create the partition

CREATE TABLE Invoice_december_2021 PARTITION OF Invoice FOR VALUES FROM ('2021-12-01 00:00:00') TO ('2022-01-01 00:00:00');


Create partitioned table with primary key

Step 1: Create table

CREATE TABLE Patient (
    patient_id   int,
    patient_contact varchar(100),
    dob date,
    primary key (patient_id,dob)
)  PARTITION BY RANGE(dob);

Step 2 : Create the partition

CREATE TABLE Patient_december_2021 PARTITION OF Patient FOR VALUES FROM ('2021-12-01 00:00:00') TO ('2022-01-01 00:00:00');