Posts

Showing posts from February, 2023

MySQL Advanced Topics | Part 1

Image
MySQL Advanced Topics | Part 1 MySQL Example with Explanation: CREATE TABLE "customer_data" ( "customer_id" INT(10) NOT NULL AUTO_INCREMENT, "customer_code" VARCHAR(10) NULL DEFAULT NULL , "customer_name" VARCHAR(50) NULL DEFAULT NULL , "introducer_id" INT(10) NULL DEFAULT NULL, "customer_duration" INT(10) NULL DEFAULT NULL, "created_date" DATE NULL DEFAULT NULL, "updated_date" DATETIME NULL DEFAULT NULL, PRIMARY KEY ("customer_id") USING BTREE, INDEX "Index 2" ("customer_id", "customer_code") USING BTREE, INDEX "FK_customer_data_user_info" ("customer_code") USING BTREE, CONSTRAINT "FK_customer_data_user_info" FOREIGN KEY ("customer_code") REFERENCES "user_info" ("user_source") ON UPDATE CASCADE ON DELETE CASCADE )ENGINE=InnoDB,AUTO_INCR...

Routing, Telnet, RLogin and Secure Shell(SSH)

Routing, Telnet, RLogin and Secure Shell(SSH) Router In packet-switched networks such as the internet router in a device that determines the next network point to which a packet should be forwarded towards its destination. A router may create or maintain a table of the available route and their conditions and use this information along with distance and cost algorithms to determine the base route for a given packet. Typically, a packet may travel through a anumber of network points with routers before arriving at its destination. Routing is a function associated with the Network Layer(Layer 3) in the standard model of netqwork programming, the Open Systems Interconnection (OSI) model. A layer-3 switch is a switch that can perform routing dunction An edge router is a router that interfaces with an asynchronous transfer mode(ATM) network. Every router maintains a routing table in its software to quickly determine the next...

Firewalls

Image
Firewalls A computer firewall protects networked computers from intentional hostile intrusion that could compromise confidentiality. An Internet firewall examines all traffic route dbetween your network and the Internet to see if it meets a certain criteria. If it does, it is routed between the networks, otherwise it is stopped. Firewalls can filter packets based on their source, destination addresses and port numbers. This is known as address filtering. Firewalls can alsofilter specific types of network traffic.This is also known as protocol filtering because the decision to forward or reject traffic is dependant upon the protocol used.e.g.,HTTP,Telnet or FTP. Firewalls can also filter traffic by packet attribute or state. Different types of firewall Firewalls fall into four broad categories: Packet filters Circuit-level gateways Application-level gateways Stateful multi-layer inspection firewalls Packet filtering firewalls...

MIME (Multipurpose Internet Mail Extensions)

Multipurpose Internet Mail Extensions (MIME) MIME stands for "Multipurpose Internet Mail Extensions" and allows messages that are not formatted in ASCII to be transferred over the Internet MIME provides extensions, allowing some new uses electronic mail, messages now may have: Multiple objects within a single message Text with unlimited length or overall length Character sets other than 7 -bit ASCII Multi-font messages Binary or application-specific files Images,audio,video and multi-media messages Common MIME Types: text/plain text/html image/jpeg image/gif application/octet-stream audio/midi audio/x-midi application/ps MIME defines the following new header fields: MIME-Version , which uses a version number to declare that a message conforms to the MIME standard Content-Type , which can be used to specify the type and subtype of data in the body of a message and to fully spe...

em and rem

"em" and "rem" units em and rem are units of measurement which take their measurements based on or relative to its immediate parent element For example, if the "<div>" tag has a font-size attribute in CSS as 12px. and if it contains as an element whose font-size is 1.2em it means that the font-size of the element is 1.2 times the font-size of its parent. Thus, the font-size of the child html element will be 1.2*12 = 14.4px rem is relative to the root element size i.e. html tag size suppose the default size of the html page elements which are not styled by CSS is 14 px then if we specify that the font-sizee be 1.2rem it means the font size will be 14*1.2 =16.8px They are mainly used for creating thumbnails or different sizes of the same image For example, Consider the following piece of code: img:hover {width: 2em;} will scale the image horizontally to double its width when you hover over i...

Bootstrap Classes | Basics

Bootstrap Classes The following table shows all the Bootstrap classes and their uses Class Name Definition form-control Adds styling to a form element such as text field, checkbox, etc. form-group Adds styling to a small subset of form element(s) and their respective labels row Adds styilng so that the column based elents can fit inside the whole width spanned by the row col-xs-* Allocxates * fraction of the total screen width. xs stands for extra small screen size devices like smartphones col-sm-* Allocxates * fraction of the total screen width. sm stands for small screen size devices like large smartphones or mini-tablets col-md-* Allocxates * fraction of the total screen width. md stands for medium screen size devices like tablets, Kindle, etc. col-lg-* Allocxat...

AWS Cloud Computing in-depth

AWS Cloud Computing in-depth Capacity planning is an iterative provcess with the follpwing steps: Determine the charcateristics of the prerseent system Measure of teh workload for the dofferent resources in the system (CPU,RAM,Disk,network,) and so forth Load the system until it is overloaded, determine when it breqaks , and specify what is required tomaintain acceptable performance Knowing when system's fail under load and what factor(s) is responsible for the failure if the critical step in capacity plamniing Predict the future based on historical trends and other factors Deploy or tear down resoureces to meet your predictions IterTate steps 1 5to 5 repeadtedly Amazon Virtual Private Cloud It provides a bridge between a company's existing network and the AWS cloud. VPC connects your network resources to a set of AWS systems over a Virtual Private Network (VPN) ...

Introduction to Amazon Web Services (AWS)

Image
Introduction to Amazon Web Services (AWS) Amazon Web Service Components Here, we will see what all features and services provided by AWS (Amazon Web Services). Elastic Compute Cloud(EC2): A Amazon server has some properties: The AWS key which is known only to the Amazon database and your server which is hosted on Amazon cloud. The AWS secret is also known to the Amazon database and your server which is hosted on Amazon cloud. A user can upload a file, download a file or delete a vfile on an AWS EC2 instance. The AWS key is a 20 character string having uppercase letters and digits. The AWS secret is a 40 character string having uppercase letters and digits The AWS key and secret are used for checking the identity and authenticating the client. They are generally stored in the config folder or bootstrap folder or .env file as it will be authenticated when the IoC...

Cloud Computing in detail

Cloud Computing in detail Most large Infrastructure as a Service (IaaS) providers rely on virtual machine technology to deliver servers that can run applications. Virtual servers described in terms of a machine image or instances have charcateristics that often can be described in terms of real servers delivering a certain number of mivcroprocessor (CPU) cycles, memory access, and network bandwidth to customer.Virtual machines are containers that are assigned specific resources. The software that runs in the virtual machines is what defines the utility of the cloud coomputing system. Platforms: A platform in the cloud is a software layer that is used to craete higher levels of service. Many different Platform as a Service (PaaS) providers offer services to provide developers with different capabilities. These services offer all the hosted hardware and software needed to build and deploy web applications or services tha...

CSS Hands-on | Part 2

CSS Hands-on | Part 2 Animations @keyframes rule defones an animation for an HTML elemnt For example: @keyframes animation_rule_name_1 { div.gaurav { from : { background-color: red; } to : { background-color: green; } } } @keyframes animation_rule_name_2 { span.gaurav { 0% : { border-width : 5px; } 10% : { border-width: 10px; } 40% : { border-width: 15px; } 80% : { border-width : 20px; } 100% : { border-width : 25px; } } } Usage: Consider the first example. It will change the background-color from red to green in a linear fashion. Consider the second example. The border width of an element will slowly change from 5px to 25px in a speed variable defined by the percentage div.gaurav { animation-mame: animation_rule_name_1; animation-duration: 10s; animation-iteration-count: 4; animation-delay: 2s; animation-timing-functi...

What is Cloud Computing?

Cloud Computing A deployment model defines the purpose of the cloud, and the nature of how the cloud is located. The NIST(The U.S. National Institute of Standards and Technology) definition for the four deployment models is as follows: Public Cloud Private Cloud Hybrid Cloud Community Cloud Public Cloud The publkic cloud infrastructure is available for public use alternatively for a large industry group and ids owned by an organization selling cloud services. Private Cloud The private cloud mechanism is operated for the exclusive use of an organization. The cloud maay be managedby that organiation or a third party. Hybrid Cloud A Hybrid cloud combines multiple clouds(private, community or public) where those clouds retain their unique identities, but are bound together as a unit. Community cloud A Community cloud is one where the cloud has been organi...

CSS Hands-on | Part 1

CSS Hands-on Let use see how to insert a content after every paragraph. Just sepcify like p::after { content : "..." } Similarly,to insert a text before the start of every paragraph, use p::before { content : "Hi" } Positions in CSS are different ways to display an element at specific areas in a web page. There are three possible positioning techniques like: position : absolute; position : relative; position : fixed; Let us understand these one by one: The position : absolute value specifies that the top - left coordinate will be referenced from the window's top left corner For example if we specify left : 30px for position : absolute , the element will be positioned 30px to the left of the screen But in position: relative if we specify the same left:30px , it means that the element will be positoned 30px left of its enclosing parent element in the DOM tree ...

Bullets and Numbering

Bullets and Numberings Different types of bullets and numbering are used in HTML5: Unordered List of items Apples Bananas Lemons Oranges Apples Bananas Lemons Oranges Apples Bananas Lemons Oranges Ordered List of items Apples BAnanas Apples BAnanas Apples BAnanas Apples BAnanas

jQuery API - Part 1

jQuery API - Part 1 jQuery has many functions, both synchronous and asynchronous which reduce the task of the programmer and are Efficient Reliable Fast Scalable For getting the immediate ancestor of an element use $("#element_id").parent(); jQuery implements method chaining which means that all jQuery functions that work on a selector process the element and returns the new jQuery variable i.e., $("#element_id") The benefit of jQuery JavaScript library having method chaining is that if you want to perform 10 functions on a single element, it becomes tedious to create 10 new variables assign value to each of them and storing the results in a different variable. So, to get the grandfather of an element, use $("#element_id").parent().parent(); To get / set attributes of an HTML element, use attr() method. Example: If you want the value of the co...

CSS Advanced topics

CSS Advanced Topics Transforms Suppose, we have to display an element in a differently rather than normal visibility. To accomplish this, CSS3 has introduced something called as "CSS Transforms". The "Transforms" word comes from changing the size, shape and orientation of an HTML element There are many types of transforms, we will see some of them and their examples and use in the following paragraph. ROTATE SCALE SKEW Let us now go in-depth about each of them: rotate(30deg) transform the angular orientation of thr elent to a different which is given as parameter to the function scaleX(3.5) will make the element double or as many times you want along the X-axis using the vaue you give to the function scaleY(2) will make the element double or as many times you want along the Y-axis usin...

Linux Concepts for Beginners

Linux Concepts for Beginners The linux kernel is the heart of the operating system. It controls excess to the computer and its files, allocates resources amongst the various activities taking place within the computer, maintains the file system and manages the computer memory. A system administrator can adjust the system's operating characteristics by configuring the kernel. Configuring the kernel chiefly involes specifying whether certain features of the system could be included. To view all the programs that are currently running (i.e., executing) on your linux machine, use the command ps -ef "ps" stands for process and it is name of the command. It supports 2 options: e and f e => Produce information about every process ( including those working in the backgrounds like daemons) f => Produce a full listing of information as follows: UID => The us...

Query Parameters

Query Parameters Query paramaeters are data sent from the client to the server. They area a list of "name" : "value" pairs. They are only relevant in a GET HTTP request. The "name"="value" pair is appended to the ? which is written after the URL. You can incude multiple pairs of name and value separated by a delimiter "&" For example if in a form whose method is GET, if the form is submitted, the URL will look like this: https://www.thwebdesk.blogspot.com/?name1=value1&name2=value2&name3=value3 If the value contains special charcaters that have a certain meaning in a context and encoded to %(2 digit hexadecimal number) For example: If the name = "Gaurav" and value = "S'hirodkar" The HTTP request URL will be https://www.thewebdesk.blogspot.com?name=Gaurav&value=S%3Ehirodkar meaning that the sppecial character apostrophe h...

FTP, cURL and Linux Intro

FTP, cURL and Linux Intro FTP(FIle Transfer Protocol) The FTP protocol consists of two connections Control connection Data Connection The control connection is run on port 23 and it authorizers and authenticates the client and the server after both the client and server are authenticated, The data ia sent over port 21 on the data connection After the file is uploaded or any other file operation is performed the data connection is closed After the data connection is closed, the control connection is closecd CURL CURL stands for Connect URL (Uniform Resource Locator).It is used my most Operations now-a-dayssince it s simplicity, reliabily and multitasking. The few operating systems which have support of installing CURL are Windows 10, Windows11 ,Linux,etc. Let us take an example to see how CURL works Steps: ...

OAuth Protocol

Image
OAuth Protocol OAuth stands for Open Authentication . It lets an HTTP client and a HTTP server to prove their identity to one another. There are 7 steps in this protocol(set of rules) as follows:- OAuth: The client makes a request and appends a request_token variable to the HTTP request The server takes the request_token and sends it to the client in then HTTP response The client takes the request_token receive fron the server and matches it with its own request_token and if both match the client knows that the server is the one who claims it to be The client makes another HTTP request with the same request_token The server receives the request_token and matches it with the previous request of request_token and if it matches, the server sends another variable caled the access_token to the client. The client in the next HTTP request sends this access_token In this last ste...

Website Hacking Techniques and their workarounds

Image
Website Hacking Techniques and their workarounds Cross-site Request Forgery: Sometimes, hackers make an API call to another website. It is called fake identity or false authorization To prevent CSRF, we add an input element with type "hidden" and a _token to the value of a 32 character token that is sent by the server to the client in the first response. After this, the client will send this token in the hidden field every time the client makes HTTP requests to the server Hence, the server matches the token sent by the client to the token stored by the server at every clientHTTP request, and if it matches, it means , that the cliengt is a genuine client. For some pages in a website, We don't want this authorization to take place, hence we disable the token field in the HTTP request for that web page. SQL Injection:- Sometimes, in a form, which has input fields, the user e...

POSTMAN Client

Image
POSTMAN Client Using Postman: Postman is a software for testing API(REST) It supports the following: GET POST PUT DELETE OPTIONS It requires three parameters, method_type destination_url ( the url which includes the server name) port no return type The return type is either XML or JSON or text

JavaScript Events

Image
JavaScript Events jQuery plugins are Javascriot file swhich perform specific functions. For example, If we import a datepicker jQuery plugin, We must write $("#date_picker").datepicker({ format:"mm/dd/YYYY") }); Events: There are several events that can happen while browsing a web page. For e.g., User can press a key a user can double click in an element a user enters an section of a web page a user drags an element a user drops an element a user scrolls down or up The syntax for event handlers is as follows: onkeypress onkeydown onkeyup onmouserover onmouseenter onmouseleave ondragover ondrop onscroll onload onbeforeload onunload onbeforeunload ondblclick onsubmit onclick Sometimes, we want to add some...

HTML5 Colors

HTML5 Colors A color in HTML is written #(<red_component>,<green_componbent>,<blue_component>) eg, #220022 red component of the color is 22 hexadecimal number green component is a 0 hexadecimal number blue component is 22 hexadecimal number Shortcut for defining color codes: If the color code is - #ffffff will be compressed to #fff Explanation If all the components of primary colors(either red,green or blue) are same you should write it once. HTML supports 240 color names. eg, red,lightblue,black,yellow,etc. Gradients represent a transitoion of a color from one shade to another across an HTML element. Suppose wwe want to define a shade of orange to yellow for a div element of size 40px * 80px, we will write: background-image: -webkit-gradient(orange,yellow); background-image:-webkit-radial-gradient(circle,white,black); ...