AWS Elastic Load Balancer and ELB and ALB Pricing

AWS ELB and Amazon Elastic Load Balanacer
AWS Load balancer accept all the incoming Application incoming Traffic and distribute to multiple target such as EC2 instance, container etc.. Elastic Load Balancer support various type of Load Balancer.

1) Application Load Balancers
2) Network Load Balancers
3) Classic Load Balancers

   Load Balencer ensure that server resource must be available 24 x 7 without any fault. Amazon ELB ensures fall tolerance and High Availability of server resource. Web Traffic get distributed to the available backend server using AWS ELB. 
    Load Balancer contain mainly three part :- Listner (Which will listen Port), Traget Group and third is Traget.



Load Balancer distribute the traffic request to various server to balance the load more or less equally.
Whatever ( http / https ) request comes to the load balancer based on the server traffic and health status it will divert.



Amazon S3 Bucket Pricing and AWS Bucket Storage


Amazon S3 Bucket
AWS Storage Type

  • S3 (Simple Storage Services) [Object Level Based Storage]
  • EFS (Elastic File System)
  • EBS (Elastic Block Storage)
  • Glacier 
  • Snowball

Amazon S3(Simple Storage Services)

  • Amazon S3 is public storage resource in AWS (Amazon Web Services) Cloud which is object based storage.
  • AWS S3 Bucket is storage same like a file folders which store objects with data and its Metadata.
  • S3 stores all the files (like pdf, images, video, documents etc ) as a object in AWS Cloud. You cannot have the Bucket inside bucket, Bucket can have the folders which groups object inside in it. S3 bucket is having flat architecture (Bucket inside bucket you can't create.).
  • If you want to use AWS S3 services, First you have to create the S3 Bucket in any of the AWS Region. Bucket name is unique Globally. Once Bucket is created it get shared with all the AWS Account. The bucket name cannot be used by any other AWS account.
  • Amazon S3 services comes under IaaS (Infrastructure as a Services). The Important AWS Services which is offered as Iaas is S3 (Simple Storage Service), EC2 (Elastic computing 2)  and RDS (Relational Database Service). These IaaS services is charged per hour basis.
  • We can't Install operating System in S3 Storage.
  • AWS S3 have distributed Data Architecture where copy of data is stored in multiple location within the region.
  • Bucket can store maximum 5TB Data, 100 bucket per aws Account which you can extend further.  
  • S3 Bucket cannot be transferred from one aws account to another AWS account. It can be shared and can be access with multiple location.

S3 Bucket and Naming Rules

  • Bucket name is Globally Unique. In AWS Cloud two bucket can't have the same name. It must be unique.
  • Once the Bucket name is created it cannot be changed. If bucket name is deleted then again it will be available for other user to choose that Bucket name.
  • Bucket name must contain atleaste 3 Character and max 63 Character.
  • Bucket Name is URL part through which we try to access the bucket.
  • Bucket name can be created using lower Case letter, number and hyphen. We cant use Upper case letter while naming the bucket. You cant start and end the bucket name with -(hyphen). Bucket name should not be an IP address.
  • Whenever we create bucket or Object, By default it is private. Only bucket owner can access that.    

S3 Bucket Sub-resources

  • Object Life cycle : In this we can define the object life cycle. We can move the object based on the time frame from one storage type to other storage. this can reduce the cost. See the below image where we are moving the object from one storage to other based on the recent data. 
  • Website : We can use S3 for hosting Static website.
  • Versioning : You can enable the versioning on your storage which will maintain your previous updated file and the current file too. You cant disable the versioning. You can enable or suspend the versioning.
  • Access Control List : In this you can decide the security of your bucket regarding access.

S3 Bucket Versioning

Bucket Versioning help us to recover the data in the case of accidental delete. Suppose you deleted the Data accidentally, to retrieve the data we enable versioning. Versioning maintain the older data as well as the current data. If the versioning is enabled and the object / Data got deleted, in that case you can recover / restore the data easily.

Versioning Help us in data retention as well as data archive. Once you enable the Versioning, you can't disable it. You can suspend it only.

When Versioning is enabled and we delete the object / data , delete marker is placed on the object which we can recover whenever we want.

You will be charged for all the multiple versions. Example Just imagine you have 10 MB file initially, next versioning your file size became 14 MB, again in next versioning it became 18 MB. It will be charged for incremental only which will be 8 MB not for 42 MB. This is incremental versioning.   

You can apply the life-cycle on versioning which means as the object / data become older we can move it to cheaper storage or we can delete the data.

The Object which exist before version enabling will have the version ID Null. 

Multi Factor Authentication (MFA)

MFA is extra level of security which we can apply on our S3 Bucket. By Enabling the Multi-factor authentication you restrict the other users to delete the S3 object accidentally. Once the Multi-factor Authentication is enabled you can delete until unless the security code received by the registered physical device is shared with you within 30 second.  

S3 Multipart Upload

S3 Multipart Upload allow us to upload our file to server in parts. This object parts get uploaded independently and in parallel. You must use the multipart Upload facility to upload the file in the server if the size is equal or greater than 5 gb using Multipart Upload API.

Type of AWS S3 Storage  

1) Amazon S3 Standard [Storage Cost is High but Accessing / Retrieving cost is low. ]
    This Storage is useful if you need data access frequently. 

2) Amazon S3 Glacier Deep Archive  [Storage Cost is cheapest but Retrieving cost is High.]
    Amazon S3 Glacier Deep Archive is suitable when you have rare access to the data(Once in a year or rare access.). As S3 Glacier Deep Archive storage is damm Cheaper but accessing the data cost higher. Accessing Glacier Deep Archive Data takes time which is not fix. 

3) Amazon Glacier
Amazon S3 Glacier is little costlier then Glacier Deep Archive. This also we use when we don't need the data access frequently. Accessing Glacier Data takes time which is not fix. The Main difference between Amazon glacier and Glacier Deep Archive is, in AWS Glacier you have the option to select the data retrieval time. This means you can select the access time if you want to access the data. Three Option Available for data retrieval, you want retrieval within a minute, within a Hour, or within 12 hour.     

4) Amazon S3 Standard Infrequent Access 
Amazon S3 Standard Infrequent Access This storage is best for infrequent access. Sometime you need to access the data and you need it immediately. This storage provide immediate access it don't delay like Amazon Glacier or Amazon S3 Glacier Deep Archive. Overall it is infrequent access of data but whenever it is access data must available immediately without delay.

5) Amazon S3 One Zone - IA
By Default S3 Create three copy of your data and keep it as a back up and charge you accordingly. And in any disaster it will recover your data using other copy. S3 One Zone  allow you to keep only one copy of the data in one zone. In disaster your data is not recoverable. 

6) Amazon S3 Intelligent tearing. 
We use this Intelligent Tearing storage in case of when we dont know whether we are going to access the data immediately or not.

Jammu and Kashmir GK Question- JK General Knowledge

j&k Objective GK Question




  1. Who was the last ruling Maharaja of Jammu and Kashmir
    1. A. Hari Singh       Correct Answer
    2. B. Pratap Singh      
    3. C. Ranbir Singh      
    4. D. Gulab Singh      
  2.  

    The Wular Lake is located in which district
    1. A. Udhampur District     
    2. B. Baramulla District      
    3. C. Bandipora District        Correct Answer
    4. D. Kupwara District      
  3.  

    Which one is recognised as the state flower of J&K
    1. A. Rose     
    2. B. Lily      
    3. C. Lotus        Correct Answer
    4. D. Daisy      
  4.  

    In 1897, first railway line was built in Jammu and Kashmir to connect Jammu with which city
    1. A. Sialkot       Correct Answer
    2. B. Udhampur      
    3. C. Delhi      
    4. D. Rawalpindi      
  5.  

    Which city has the most population in J&K
    1. A. Udhampur     
    2. B. Jammu      
    3. C. Srinagar        Correct Answer
    4. D. Anantnag      
  6.  

    The Shalimar Bagh was built by
    1. A. Shah Jahan     
    2. B. Akbar      
    3. C. Babur      
    4. D. Jahangir        Correct Answer
  7.  

    Srinagar is located on the banks of the
    1. A. Chenab river     
    2. B. Jhelum river        Correct Answer
    3. C. Indus river      
    4. D. Lidder river      
  8.  

    Total number of districts in Jammu and Kashmir
    1. A. 22       Correct Answer
    2. B. 24      
    3. C. 28      
    4. D. 32      
  9.  

    Total number of national parks in Jammu and Kashmir
    1. A. 3     
    2. B. 4      
    3. C. 5        Correct Answer
    4. D. 7      
  10.  

    On which hill, the Vaishno Devi mandir is located
    1. A. Katra     
    2. B. Aru      
    3. C. Trikuta        Correct Answer
    4. D. Sonamarg      
  11.  

    The Shalimar Bagh was built in the year
    1. A. 1606     
    2. B. 1619        Correct Answer
    3. C. 1627      
    4. D. 1635      
  12.  

    Which one is the longest river in Jammu Kashmir
    1. A. Indus River     
    2. B. Jhelum River      
    3. C. Chenab River        Correct Answer
    4. D. Doda River      
  13.  

    The kargil war was fought in the year
    1. A. 1998     
    2. B. 1999        Correct Answer
    3. C. 2000      
    4. D. 2001      
  14.  

    Which one is the largest district in Jammu and Kashmir by areawise
    1. A. Leh       Correct Answer
    2. B. Kargil      
    3. C. Doda      
    4. D. Baramula      
  15.  

    The Hemis National Park is famous for
    1. A. Golden Eagle     
    2. B. Tiger      
    3. C. Wolf      
    4. D. Snow Leopard        Correct Answer
  16.  

    Which article of the Indian constitution give special state status to Jammu and Kashmir
    1. A. Article 120     
    2. B. Article 180      
    3. C. Article 260      
    4. D. Article 370        Correct Answer
  17.  

    Between which mountain ranges is Kashmir Valley located
    1. A. Himadri - Pir Pranjal       Correct Answer
    2. B. Shivalik - Himachal      
    3. C. Karakoram - Himachal      
    4. D. Himadri - Himachal      
  18.  

    Who is the first Chief Minister of Jammu and Kashmir
    1. A. Hari Singh     
    2. B. Syed Mir Qasim      
    3. C. Ghulam Mohammed Sadiq        Correct Answer
    4. D. Sheikh Abdullah      
  19.  

    Total number of Lok Sabha Constituency in Jammu and Kashmir is
    1. A. 4     
    2. B. 6        Correct Answer
    3. C. 8      
    4. D. 9      
  20.  

    Which of the following lakes of India is located in Jammu and Kashmir
    1. A. Phuljhar Lake     
    2. B. Koleru Lake      
    3. C. Anchar Lake        Correct Answer
    4. D. Hamirsar Lake      
  21.  

    Sheikh Abdullah died in the year
    1. A. 1978     
    2. B. 1982        Correct Answer
    3. C. 1985      
    4. D. 1989      
  22.  

    Which town in Jammu Kashmir is also known as Apple Town
    1. A. Sopore       Correct Answer
    2. B. Anantnag      
    3. C. Shupiyan      
    4. D. Jammu      
  23.  

    From which year the Constitution of Jammu and Kashmir implement
    1. A. 1956     
    2. B. 1962      
    3. C. 1963      
    4. D. 1965        Correct Answer

Important jQuery and Javascript Code for Project

JQuery and Javascript Code Snippet


$("#fee_exp").change(function(){
   if ($(this).val() == 'Y') {
     $("#check").removeClass('hide');
     $("#check1").addClass('required');
   }else{
     $("#check").addClass('hide');
     $("#check1").removeClass('required');
   }
});


          function submitform()
              {
                $('#registeration').find('form').submit();
                $('.clearFields').val('');
               }



$('#splitPayment input:radio').change(function() {
    if ($(this).val() === 'Y') {
       $('#accountDetail').removeClass('hide');
       $('#primary_account').addClass('required');
       $('#additional_account').addClass('required');

    } else if ($(this).val() === 'N') {
           $('#accountDetail').addClass('hide');
           $('#primary_account').removeClass('required');
    $('#additional_account').removeClass('required');
    $('#primary_account').val("");
    $('#additional_account').val("");
    }
 });



/*Input Field Validation */

 $(".nameclass").on('input', function(event) {
  var regexp = /[^a-zA-Z @]/g;
   if($(this).val().match(regexp)){
     $(this).val( $(this).val().replace(regexp,'') );
   }
 });

 $(".initials").on('input', function(event) {
  var regexp = /[^a-zA-Z .]/g;
   if($(this).val().match(regexp)){
     $(this).val( $(this).val().replace(regexp,'') );
   }
 });

 $(".address").on('input', function(event) {
  var regexp = /[^a-zA-Z0-9 /,]/g;
   if($(this).val().match(regexp)){
     $(this).val( $(this).val().replace(regexp,'') );
   }
 });

 $(".textonly").on('input', function(event) {
  var regexp = /[^a-zA-Z]/g;
   if($(this).val().match(regexp)){
     $(this).val( $(this).val().replace(regexp,'') );
   }
 });
 
 $(".textnumber").on('input', function(event) {
  var regexp = /[^a-zA-Z0-9]/g;
   if($(this).val().match(regexp)){
     $(this).val( $(this).val().replace(regexp,'') );
   }
 });
 
 $(".numberonly").on('input', function(event) {
  var regexp = /[^0-9]/g;
   if($(this).val().match(regexp)){
     $(this).val( $(this).val().replace(regexp,'') );
   }
 });

 $(".onlytextspace").on('input', function(event) {
   var regexp = /[^a-zA-Z\s]+$/g;  
   if($(this).val().match(regexp)){
     $(this).val( $(this).val().replace(regexp,'') );
   }
 }); 

 $(".onlydottextspace").on('input', function(event) {
     //var regexp = /^([\s\.]?[a-zA-Z0-9]+)+$/;
  var regexp = /[^,/0-9a-zA-Z\s\.]+$/g;  
   if($(this).val().match(regexp)){
     $(this).val( $(this).val().replace(regexp,'') );
   }
 });



$(document).ready(function(){
 
 $('#class_id').change(function(){
 var classId = $('#class_id').val();

 $.ajax({      
   url: base_url+base_path+"/get-subject-list",
   type: "post",
   data: { classId : classId },
   dataType: "json",
   
  success: function(data){
     $("#subject_id").empty();
     $("#subject_id").append('<option>Select Subject</option>');
     $.each(data,function(key,value){
     $("#subject_id").append('<option value="'+key+'">'+value+'</option>');
    });
   }
  });
 });
     
});





$('#edudist_name').click(function(){
    
   var edudistId = $('#edudist_name').val();  
   var edudist=[];
   
  $.ajax({      
    url: base_url+base_path+"/check-rev-school",
    type: "post",
    data: { edudistId : edudistId },
    dataType: "json",
    
   success: function(data){
      $("#camp_id").empty();
      $("#camp_id").append('<option>Select</option>');
      $.each(data,function(key,value){
      $("#camp_id").append('<option value="'+key+'">'+value+'</option>');
       edudist.push(key);
       });
        $("#edudist_name").append('<option value="'+edudist.join()+'"> ALL </option>');
     }
   });
 });



       $("#date1").datepicker({
            dateFormat: "dd-mm-yy",
            maxDate : 0, 
            onSelect: function (date) {
                var dt1 = $('#date1').datepicker('getDate');
                var dt2 = $('#date2').datepicker('getDate');
                
                $('#date2').datepicker('option', 'minDate', dt1);
            }
        });
        $('#date2').datepicker({
            dateFormat: "dd-mm-yy",
            maxDate : 0, 
            minDate: $('#date1').datepicker('getDate'),
            onClose: function () {
                var dt1 = $('#date1').datepicker('getDate');
                var dt2 = $('#date2').datepicker('getDate');
                //check to prevent a user from entering a date below date of dt1
                if (dt2 <= dt1) {
                    var minDate = $('#date2').datepicker('option', 'minDate');
                    $('#date2').datepicker('setDate', minDate);
                }
            }
          });      
 });

Laravel HTTP Request, Methods and Input


Laravel HTTP Request

Laravel HTTP(HyperText Transfer Protocol) request method is the way to structure the request and response to set the communication of Client and server or its a protocol to transfer the data over the web. Http follow the server-client Model. In Laravel HTTP request get processed through routes/web.php by default.

We can access the Http Request by declearing the Illuminate\Http\Request in Controller.

public function personalData(Request $request)
    {
        $name = $request->input('name'); 
    }

HTTP Request Path and Methods

Illuminate\Http\Request instance provides various method to access the Http request and its parameter which is trying to access the application.

path() method will return the information about the url path. For example: Our URL is https://www.abcd.com/my-profile/umesh, if we use path() method to get the request it will return /my-profile/umesh. 

For Example : 
$uriPath = $request->path();

We can fetch the entire url itself using url() method  and fullurl() method. ce url method will return the url without string whereas fullurl method will return with string. Below is the code for your reference.
$urlWthtString = $request->url();  // return url without String
$urlWthString = $request->fullUrl(); // return url with String

Fetching the Request Method

We can fetch the HTTP request type using method() function as well as we can check whether the requested method is satisfying the type using ismethod() function . 

$methodType = $request->method();
// This Will give you the request method type whether it is post, get etc..

if ($request->isMethod('post')) {
    //
}

Laravel Retrieving Input From HTTP Request 


We can retrieve all the input data as a array which is coming through the HTTP Request using all() method.

$inputData = $request->all();

Illuminate\Http\Request instance We can get the request data using input method. we can pass the second argument in input method. If input method don't have the value it will take second argument as default value. See the code below for reference.

$firstName = $request->input('firstName');
$firstName = $request->input('firstName', 'Umesh');
   
We can use input() method without having any argument to get the input value as a associative array.

$input = $request->input();  // this return the input as a associative array.

Checking Input Value is Present or not


⇛ We can check whether the input value is there or not, we use has() method. has() method will return the value as true or false.
if ($request->has('firstName')){
   // $request->has('firstName') will return the value as true or false.   
}
⇛ has() method will check the array input also. check the code below for reference.
if ($request->has(['firstName', 'emailId'])){
    // If both array input will be there, It will return true or false.
}

⇛ hasAny() method will check if any input will be there it will return true. Below is the code for your reference.
if ($request->hasAny(['firstName', 'emailId'])){
    // if any Input will be there it will return true
}

Redirecting and Flashing the input


If the validation fails we need to redirect to the same page with the input. Flashing the input with redirect on the page we use withInput() method. Below is the code for your reference.
return redirect('personal-form/save')->withInput();

return redirect('personal-form/save')->withInput($request->except('userpass'));

Handling File Upload using HTTP Request


Sometime we need to access the uploaded file using HTTP request using file() method. The Illuminate\Http\UploadedFile class have file() method which returns an instance. We can check using hasFile() method that HTTP request have the file or not. Below is the code for your reference.

$fileImage = $request->file('candidate_photo');
$fileImage = $request->candidate_photo;
if ($request->hasFile('candidate_photo')){ // }

Uploaded File Path and Extension 


UploadFile class provide some predefined method through which we can access the file path and its Extension.

$Photopath = $request->candidate_photo->path();

$photoextension = $request->candidate_photo->extension();

Our Feature Post

There is a tree between houses of A and B If the tree leans on As House

    There is a tree between houses of A and B. If the tree There is a tree between houses of A and B. If the tree leans on A’s House, the t...

Our Popular Post