Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop
    1. Home
    2. b6
    3. Posts
    • Profile
    • Following 5
    • Followers 8
    • Topics 14
    • Posts 104
    • Best 34
    • Controversial 0
    • Groups 2

    Posts made by b6

    • Hacking websites with SQL Injection 💉

      What is SQL Injection ?


      alt text

      SQL Injection is a attack against websites / web applications which are using SQL Database.

      Simply, Hacker will insert malicious SQL command and takeover the database.

      How Does it Work?


      Let's say, You have a code like this,

      <?php
      
             $username = $_POST['username'];
             $password = md5($_POST['password']); 
             $sql = "SELECT * FROM `users` WHERE username = '$username' AND password = '$password'";
             
      ?>
      

      If user input,
      Username : admin
      Password : admin123

      The SQL will looks like,

      SELECT * FROM `users` WHERE username = 'admin' AND password = '0192023A7BBD73250516F069DF18B500'
      

      It will works fine,


      But If user input,

      If your input,
      Username : admin' OR 1 = 1 --
      Password : admin123

      The SQL will looks like,

      SELECT * FROM `users` WHERE username = 'admin' OR 1 = 1 --' AND password = '0192023A7BBD73250516F069DF18B500'
      

      Here you can see, The password query will be commented (Will not Execute).
      And 1 = 1 is always true, The hacker can get all the information of Users.

      They can delete or change any record too.

      Click Here | Watch SQl Injection tutorial

      SQL Injection Strings

      Click Here | Some injection Strings


      How to prevent SQL Injections?

      Nowadays, Most of the back-end frameworks handle injections itself. But If you don't use any frameworks, You can do it manually.

      Every language has built-in functions for handle SQL injections while binding data.

      PHP
      PyTHON
      .NET
      NodeJS
      Java

      posted in Information Security
      b6
      b6
    • RE: 👉👉 Important things you should avoid in CSS Style Sheet

      @dev_lak thank you

      posted in Web Development
      b6
      b6
    • RE: 👉👉 Important things you should avoid in CSS Style Sheet

      @root ✌✌

      posted in Web Development
      b6
      b6
    • RE: 👉👉 Important things you should avoid in CSS Style Sheet

      @Malith 😊😊

      posted in Web Development
      b6
      b6
    • 👉👉 Important things you should avoid in CSS Style Sheet

      alt text

      Avoid put px to 0 values.


      ❌ Wrong

      .className {
            padding-top: 0px;
      }
      

      ✔ Correct

      .className {
            padding-top: 0;
      }
      

      Optimize styles.


      ❌ Wrong

      .className {
            padding-top: 0;
            padding-right: 5px;
            padding-bottom: 7px;
            padding-left: 10px;
            margin-top: -3px;
            margin-right: -30px;
            margin-bottom: -8px;
            margin-left: -4px;
      }
      

      ✔ Correct

      .className {
            padding: 0 5px 7px 10px;
            margin: -3px -30px -8px -4px;
      }
      

      Use small letters for Color Code


      ❌ Wrong

      .className {
            background-color: #6f8CBA;
            color: #FFFFFF;
      }
      

      ✔ Correct

      .className {
            background-color: #6f8cba;
            color: #ffffff;
      }
      

      Do not put unwanted Spaces,Line Breaks


      ❌ Wrong

      .className{
      
            font-size : 15px;
            font-family: sans-serif, arial;
      
      }
      

      ✔ Correct

      .className {
            font-size : 15px;
            font-family: sans-serif, arial;
      }
      

      Do not put Duplicate styles


      ❌ Wrong

      .className1 {
            font-size : 15px;
            font-family: sans-serif, arial;
      }
      
      .className2 {
            font-size : 15px;
            font-family: sans-serif, arial;
      }
      
      .className3 {
            font-size : 15px;
            font-family: sans-serif, arial;
      }
      

      ✔ Correct

      .className1, .className2, .className3 {
            font-size : 15px;
            font-family: sans-serif, arial;
      }
      

      Do not create too much Class names


      ❌ Wrong

      <div class="section-one">
            <div class="section-one-title">
                 Title 1
            </div>
      </div>
      
      
      <div class="section-two">
            <div class="section-two-title">
                 Title 1
            </div>
      </div>
      
      .section-one {
            background-color: #000000;
      }
      
      .section-one-title {
            font-size : 15px;
            font-family: sans-serif, arial;
            color: #ffffff;
      }
      
      .section-two {
            background-color: #57d675;
      }
      
      .section-two-title {
            font-size : 5px;
            font-family: sans-serif, arial;
      }
      

      ✔ Correct

      <div class="section-one">
            <div class="title">
                 Title 1
            </div>
      </div>
      
      
      <div class="section-two">
            <div class="title">
                 Title 1
            </div>
      </div>
      
      .section-one {
            background-color: #000000;
      }
      
      .section-one .title {
            font-size : 15px;
            font-family: sans-serif, arial;
            color: #ffffff;
      }
      
      .section-two {
            background-color: #57d675;
      }
      
      .section-two .title {
            font-size : 5px;
            font-family: sans-serif, arial;
      }
      
      posted in Web Development
      b6
      b6
    • RE: What is Docker 🐋 ?

      @keethan Danku :)

      posted in System & Network Configurations
      b6
      b6
    • RE: What is Docker 🐋 ?

      @lkdev ❤❤❤

      posted in System & Network Configurations
      b6
      b6
    • RE: What is Docker 🐋 ?

      @Dinush Thank you

      posted in System & Network Configurations
      b6
      b6
    • RE: What is Docker 🐋 ?

      @root Thx bro

      posted in System & Network Configurations
      b6
      b6
    • RE: What is Docker 🐋 ?

      @dev_lak thx bro

      posted in System & Network Configurations
      b6
      b6
    • What is Docker 🐋 ?

      What is Containerization & Why?


      The Problem

      When you develop a application, It may work fine on your PC or Laptop. But when you going to deploy it, Sometimes It will not work properly in production or others computer.

      Reasons

      Version Problems
      Missing Dependencies
      Other programs may disturb yours.

      Because everything is on same server/PC.

      Solution

      To solve this issue, Developers uses a technology called Containerization.

      Containerization

      Containerization is a lightweight alternative to full machine virtualization that involves encapsulating an application in a container with its own operating environment. This provides many of the benefits of loading an application onto a virtual machine, as the application can be run on any suitable physical machine without any worries about dependencies.

      It means, Each and every application / services can work on dedicated environment is same machine (Like Virtual Machine But Not Exactly).

      alt text

      Just Image a Container & Ship. The stocks are packed into containers. And each containers are locked and shipped. The actions inside container will not effect the ship. Because container is protecting/separating outside.

      Just Like that, Imagine you computer as a ship. Now you can create a separate container for Database, separate container for App, separate container for Cache and so on. And you can deploy all together in your ship (Computer).

      So each services can run independently, If any service occurs, It will not effect your server.

      What is Docker?


      Docker one of the most famous containerization tool, use by Software Engineers. It allows you create, maintain & deploy containers easily.

      alt text

      Virtualization vs Containerization


      alt text

      posted in System & Network Configurations
      b6
      b6
    • RE: Top 7 Javascript Best Practices For Beginners 👍

      @kapilsri thx bro

      posted in Front-End Development
      b6
      b6
    • RE: Top 7 Javascript Best Practices For Beginners 👍

      @dee_kas thx bro

      posted in Front-End Development
      b6
      b6
    • RE: Top 7 Javascript Best Practices For Beginners 👍

      @DevKasun thx bro

      posted in Front-End Development
      b6
      b6
    • RE: Top 7 Javascript Best Practices For Beginners 👍

      @lkdev 😊😊😊

      posted in Front-End Development
      b6
      b6
    • RE: Top 7 Javascript Best Practices For Beginners 👍

      @tnlthanzeel yep.. the assets will.be loaded quickly before javascript. So the site renders before, functions loads after

      posted in Front-End Development
      b6
      b6
    • RE: Top 7 Javascript Best Practices For Beginners 👍

      @dev_lak thx bro

      posted in Front-End Development
      b6
      b6
    • RE: Top 7 Javascript Best Practices For Beginners 👍

      @GeethOnion Thx bro

      posted in Front-End Development
      b6
      b6
    • RE: Top 7 Javascript Best Practices For Beginners 👍

      @devR Thx bro

      posted in Front-End Development
      b6
      b6
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 4 / 6