Author: aks0911

  • JavaScript

    Java script is used to change HTML. It can change HTML attribute’s value and HTML style (CSS).

    It was invented by Brendan Eich in 1995, later Javascript became ECMA standard in the year 1997.

    Introduction

    Javascript is an essential component of web development. In HTML JavaScript code is inserted between <script> tags.

    Scripts can also be stored in separate external files ending with .js extension. External Javascript files are useful in places where same js code is to be used on different pages.

    <strong><script></strong> 
    …………
    JavaScript code goes here….<strong> </strong>
    <strong></script></strong>

    JavaScript is the main scripting language in HTML

    Advantages of external .js file

    • It seperates HTML and code.
    • It makes HTML and Javascript easier to read and maintain.
    • cached Javascript can speed up page loading time.

    JavaScript Functions

    JavaScript Functios are block of codes

    JavaScript Functions can be entered in <head>——</head>

    Or <body>———</body>section in HTML.

    JavaScript print 

    JavaScript print function can be used to print the current window.

    <!DOCTYPE html>
    <html>
    <body>
    ​<h2>The window.print() Method</h2>​
    <p>Click the button to print the current page.</p>​
    <button onclick=”window.print()”>Print this page</button>​
    </body>
    </html>​

  • PHP

    PHP

    PHP is a powerful server scripting language for dynamic and attractive web pages.

    PHP is free and widely used scripting language.

    Echo and print statement

    In PHP to output a data echo and print statement is used

    Echo and print both provides the same output

    echo can be used wih or without parentheses 

    echo or echo ()

    echo statement ends with semicolon  “ ; ”

    Data type

    PHP supports following data types

    Integer

    String

    Float

    Boolean

    Array

    Object

    Null

    Resources 

    PHP Operators 

    • Arithmetic 
    • Assignment 
    • Comparison
    • Increment/Decrement operators
    • Logical operator
    • String
    • Array
    • Conditional assignment 

    PHP Switch 

    Switch statement is used to select one block of many blocks of code to be executed. 

    Like there are many codes to be executed but switch statement will provide us to chose one of them if condition satisfies.

    PHP Functions 

    A function name must start with a letter or _ function names are not case sensitive

    Example

    function functionname() {

    code to be executed;

    }

    PHP Superglabals Variables 

    Superglobal variables are built in variables that are always available

    $_SERVER

    $_SERVER is a super global variables which holds information about headers, paths and script locations.

    $_REQUEST

    $_POST

    $_GET

    $_FILES

    $_ENV

    $_COOKIE

    $_SESSION

    Forms in PHP

    The form is enclosed in form tags

    <Form method=“get” action=“path/to/submit/

     page”

    >

    <!–- form contents –>

    </Form>

    Explaining Form Tags

    action= “path/to/submit/

     page”

    is the page where form data is submitted

    method= “get” is the method which is used to submit form data. There are two methods to get form data “get” and “post”

  • Install And Configure VSFTPD On Ubuntu

    VSFTPD

    As the name suggest vsftpds stands for Very Secure File Transfer protocol Daemon Server. This is the default FTP server in Ubuntu and many other linux systems.

    Installation

    Mostly vsftpd is installed on you system by default and if not you can do the same by entering following commands in terminal 

    First of all update your linux 

    sudo apt-get updateNow to install vsftpd input

    sudo apt-get install vsftpd 

    Configuration 

    Now after you have successfully installed vsftpd

    Start configuring its conf file located in etc folder

    Note : Be extra cautious while editing vsftpd.conf file in nano editor, because if you make any mistake altering server configuration it will be a tedious process to troubleshoot. For safety you can backup original configuration file

    Backup original vsftpd configuration file

    Sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak

    Now open original conf file

    sudo nano /etc/vsftpd.conf

    Main configuration parameters 

    After editing configuration file do not forget to restart vsftpd by typing

    sudo /etc/init.d/vsftpd restart

    Check vsftpd status

    sudo systemctl status vsftpd

    Check Firewall Status

    sudo ufw status

    Now to access your newly created ftp server enter following 

    ftp://localhost

    Here localhost is the IP address of your server machine

    To know IP address enter following command

    hostname -I | awk ‘{print $1}’

    This will output your IP address which you can use in place of localhost

    With the above configuration you can access your ftp server on your local network from different devices.

  • Install Apache Web  Server On Linux

    Install Apache Web Server On Linux


    Apache server

    Apache is a free, open source and most popular HTTP web server. It establishes a connection between a server and the browser like mozila, chrome, opera etc.

    Here I will show you how to install Apache server on linux OS (Ubuntu 20.04)

    Install Apache server on Ubuntu

    First of all update your operating system, this will update all outdated packages and will make installation error free.

    sudo apt-get update

    Now run the foolwing command

    Sudo apt-get install apache2

    To verify correct installation of appache web server enter the following address in your browser on the host machine.

    http://local.server.ip

    The result page will be like this

    Here local.server.ip is your server host ip address to know the IP address you can simply enter the following command in terminal

    hostname -I | awk ‘{print $1}’

    Configure the default UFW firewall to listen on port 80

    sudo ufw app list

    sudo ufw allow apache

    This will allow apache connections through firewalls

    Now to know the ufw status enter

    sudo ufw status

    Apache system control commands

    To stop apache services 

    sudo systemctl stop apache2.service

    To start apache service

    sudo systemctl start apache2.service

    Restart

    sudo systemctl restart apache2.service

    Status

    sudo systemctl status apache2.service

    Setting up apache server

  • Install Android Studio On Ubuntu

    Install Android Studio On Ubuntu

    Installing android studio

    First of all download the android studio package for linux from the website

    https://developer.android.com/studio#downloads

    Then unpack the package in the desired directory in Home in my case I have unpacked it on Desktop.

    Now launch the terminal and navigate to the android studio folder

    cd Desktop/android-studio

    Or

    cd Desktop

    cd android-studio

    If you have trouble finding required directory path visit

    Then launch studio

    Enter the following command

    ./bin/studio.sh

    After few seconds a welcoming screen will appear on desktop here click Next to continue setup

    Choose type of installation

    Select user interface theme

    You may select Dark or light theme as per your choice

    At this point of installation you need to have an active internet connection to download required components, this will approximately take 1GB of data.

    After successfully installing android studio following window will appear 

    Now you can start using the studio to code and debug android applications.

    Soon in the upcoming post I will write different articles helpful for beginners.

  • Know About Your System Hardware in Terminal: LINUX

    DMIDECODE

    So Friends event occurs when you have to know about your system Hardware, on occasions like when upgrading your system or while replacing components. Like in windows have many options to know about your hardware but in Linux operating system you don’t have many options. So here I will discuss about some useful tool to know about your hardware installed in the systems, and the tool is DMIDECODE

    DMI stands for Desktop Management interface, using this powerful tool you can easily decode your whole system installed components vital information like RAM, Processor, BIOS details and various other cards installed.

    so first of all we have to launch terminal and then enter the following command

    sudo apt- get install dmidecod

    If your system had DMID code not stalled then this will install the DMIDECODE tool after this you have to enter the following command to know about your System board

    sudo dmidecode -t baseboard

    This command will basically show you Base Board information and to know more about your system hardware you can simply write the following command

    sudo dmidecode

    This command will show you all the information about BIOS, motherboard the RAM  installation about the the net card Wi-Fi card and about the processor installed etc this way you may know about your motherboard and all the hardware information on a Linux using terminal you need not open the laptop case to check the make andmodel of individual cards.