What is the difference between init 6 and reboot

Reboot

reboot uses the shutdown command (with the -r switch). The shutdown command used to kill all the running processes, unmount all the file systems and finally tells the kernel to issue the ACPI power command.

Init 6

init 6 tells the init process to shutdown all of the spawned processes/daemons as written in the init files (in the inverse order they started) and lastly invoke the shutdown -r now command to reboot the machine

why swap memory not used with ssd

0

SSD Endurance is measured in so called DWPD units. DWPD stands for Drive full Writes Per Day. For Mobile, Client and Enterprise Storage Market segments DWPD requirements are very different. SSD Vendors usually state warranty as, for example, 0.8 DWPD / 3 years or 3.0 DWPD / 5 years. First example means that writing 80% of Drive Capacity every single day will result into 3 years life-time. Technically you can kill your 480GB Drive (let’s say with 1 DWPD / 3 years warranty) within 12 days if to perform non-stop write access at the speed of 500 MB/s.

SSDs show much higher throughput on the one side if to compare with HDDs, but at the same time quite low endurance level. Partially it is due to the media physical structure and mapping. For example, when writing 1GB of user data to the HDD drive – internally physical media will receive around 10% more data (meta data, error protection data, etc.). Ratio between Host Data Amount and Internal Data Amount is called Write Amplification Factor (WAF). In comparison SSD may need to write 4 times more data than received from Host. Pure Random access is the worst scenario, when writing 1GB of Host Data will result into writing 4GB of data to the Internal Flash Media. If to perform only sequential write access WAF for SSDs will be close to 1.0, like for HDDs.

Enabling System swap and its intensive usage (probably due to DRAM shortage) will generate more Random access to the SSD. Endurance will degrade quicker if to compare with disable swap. Unless you are running Enterprise System with non-stop IO traffic to the SSD, I would not expect Swap enablement to affect SSD endurance much. You can always monitor SSD SMART Health parameter called – SSD Life Left. How it is changing in dynamic with/without swap enabled will help to make a decision.

How To Add Swap on CentOS 7

Although swap is generally recommended for systems utilizing traditional spinning hard drives, using swap with SSDs can cause issues with hardware degradation over time. Due to this consideration, we do not recommend enabling swap on DigitalOcean or any other provider that utilizes SSD storage. Doing so can impact the reliability of the underlying hardware for you and your neighbors.

If you need to improve the performance of your server, we recommend upgrading your Droplet. This will lead to better results in general and will decrease the likelihood of contributing to hardware issues that can affect your service.

New DLT Platform – TRAI Rules For BULK SMS

Telecom Regulatory Authority of India (TRAI) has released The Telecom Commercial Communication Customer Preference Regulation (TCCCPR) 2018 to regulate Unsolicited Commercial Communication (UCC) and bring transparency in the unorganised SMS industry. TRAI has formulated the guidelines to enhance control, prevent any fraudulent practice and provide greater safety to the end customer.

Check here: DLT SMS Registration Process

As per the revised TRAI guidelines, the companies who want to communicate with their customers will now have to register themselves with Telecom Operators for sending SMS. The Businesses and Bulk SMS Service Providers will be accountable to telecom operators who will be directly accountable to TRAI. The system will be governed using Blockchain technology also known as Distributed Ledger Technology (DLT) and the whole panel entities will be interlinked with each other.

TRAI

Commercial Communications Ecosystem

The roles and responsibilities of the five entities present in the Blockchain are:

  • Mobile Subscriber: Mobile subscriber is the customer who will receive the SMS. Mobile subscriber has been given the right to provide consent to receive a promotional text from any business, opt-out from receiving texts at any point of time, set preferences and register complains for receiving unwanted and spam messages.
  • Principal Entity: Principal Entity is the company or organisation who is sending SMS to its clients and customers. It can be an individual, sole proprietor, partnership firm, or any private/public or Government company who wishes to send SMS to their respective clients. As per the new TRAI DLT rules, it is mandatory for every entity to register with the Telecom Operators in the DLT platform.
  • Telemarketer: Telemarketer means the Bulk SMS Service Provider from which an individual or company purchases Bulk SMS to send to their customers. As per the updated TRAI rules, every telemarketer needs to register on the DLT platform to send messages on behalf of the Principal Entity(businesses).
  • Access Provider: Access Providers are the telecom Operators such as Vodafone, Ideal, Airtel, MTNL, BSNL who will be directly connected to TRAI and assist in the regulation process.
  • Regulator: TRAI, being the regulator has the role of establishing regulatory compliance by auditing and governing the operations to safeguard customers’ interest and prevent the occurrence of any fraudulent practices.
Comparison between old and new TRAI regulations. DLT SMS Registration process and DLT Rules

What has changed in the new updated TRAI regulations for Bulk SMS?

  • Entity and Telemarketer Registration: Every Business(Principal Entity) and Bulk SMS Service Provider (Telemarketer) will now have to register with the Telecom Operators to send messages to their clients.Earlier the Bulk SMS Providers were required to register with TRAI and there was no registration for the business firms. But with the updated rules, both the Bulk SMS Service Provider and the companies who want to send SMS to their clients need to register with the Telecom Operators.
  • Header and Template Registration: Sender ID will now be known as Headers and every header needs to be approved and registered with the Telecom Operators. Similarly, each SMS or template has to be approved by the telecom operators directly.Bulk SMS Service Providers will no longer control the Sender ID, template approval and every header and template detail will be available on the panel to view.
  • Message type: Earlier there were 2 routes for sending SMS – Transaction and Promotional.  In the latest update, 3 routes have been introduced – Transactional, Promotional, Service( Implicit and Explicit).As per the new rules,  Transactional route will be reserved only for the banks for sending OTPs and service related informative messages will come under the Implicit category.If a customer has opted to receive promotional SMS from a particular company then it will be come under the Explicit category. General Promotional SMS including offers, discounts will be delivered only to Non DND numbers.
  • Customer consent: The new regulation grants complete control to the mobile subscriber(customer) for managing their consent for receiving messages and also opt-out it at their will. The list of consents which they have given will be made visible on a single dashboard allowing them to manage and even withdraw their consent at any point of time.
  • Customer Preferences: Previously, customers only have the choice between DND and Non DND. In the new rules, the customer, also known as the mobile subscriber has been offered a time-window where they can manage their preferences based on a specific time or day and allow certain kind promotional messages regardless of their selected preferences.It means even if a customer has activated DND on his number then also he can receive promotional text from a company if he wish to. Also, customers can allow to receive promotional texts on a particular time of the day.
  • Scrubbing function: To ensure that the messages are sent according to the specifications set by the customer, scrubbing function has been introduced. In this, numbers on which messages has to be sent will be filtered in real-time to match the desired criteria set by the customer.It means that if a customer has given consent to receive messages on Monday, but withdraws the permission on Sunday, then the SMS will not be delivered on Monday. Filtration of the customer preferences is done in real-time and the results are immediately visible.
  • Complaint Management: To enhance the safety and authenticity in the system, customers are allowed to register complains regarding the violation of their preferences or consent via different mediums like call and SMS.
  • Interoperability between telecom service providers: Each Telecom Service Provider will be eligible to view the details such as registration of entity, telemarketer, header, template submitted, etc. on the platform. The information shared by a particular Business and Bulk SMS Service Provider will be made available across the network which can be viewed at any time.
  • 100% Traceability: The whole system operates in a Distributed Ledger Technology (DLT). This means that everything is recorded and shared on the network using Blockchain Technology and can be traced back at any given time.

DLT SMS Meaning: The sole objective of the regulation is to bring transparency in the system and it is expected that with the use of Blockchain-based DLT platform, unsolicited, spam and fraudulent activities can be minimized to a great extent.

How to add Header or Sender ID in Jio DLT?

How to add Header or Sender ID in Jio DLT?

Meaning of Headers: Header is a unique combination of six characters representing the brand or company name of the message sender. Header was earlier known as Sender ID. In the revised TRAI DLT regulations for Bulk SMS, Sender ID is denoted by the term Header.

Header Types for different SMS categories

1. Promotional: These messages are related to marketing purposes and are intended for promoting a product or a service. Promotional SMS are sent to the Non DND numbers. Headers for sending Promotional SMS should be of six numeric digits and based on the business category.

Header Examples for Promotional SMS: 562993, 248751, 495573, 583985, 784321

2. Others: The Others category comprise of Transactional, Service Implicit and Service Explicit. Headers for sending Transactional, Service Implicit and Service Explicit messages should be of six alphabetical characters. These Headers are case-sensitive.

Header Examples for Others SMS: FSTSMS, fstsms, FstSMS, DLTDLt, dltdlt

  • Transactional: As per the latest TRAI Guidelines, only the OTP SMS sent by banks will come under the category of Transactional SMS. Transactional SMS can be used only by banks for sending One Time Password (OTP) to its clients. All banks including National/Scheduled/Government/Private and MNC Banks can send OTP to their clients from the Transactional route.

Note: Banks can use Transactional route for sending OTP only. Transactional details, amount debited, credited, account status and all other bank messages cannot be delivered from this route.

  • Service Implicit: Informative messages other than Banks OTP will come under this category. Important notifications such as purchase updates, order alerts, payment status, reminders, booking confirmations, OTP SMS from other sites, and other crucial updates will fall in the Service Implicit category.
  • Service Explicit: Sending offer/marketing SMS to your registered users will come under this category. These SMS can only be sent to the registered customers after receiving their consent.

Click here to read about New Bulk SMS route in DLT.

How to add Header in Jio DLT?

Header SMS Registration

1. Login to your Jio DLT SMS portal. Header SMS option will be visible on your dashboard screen. Once you click on that tab, two options will get displayed – Header SMS Registration and Header SMS Details. Select the first option Header SMS Registration.

Header SMS Registration

2. Once you select it the following screen will get displayed.

Header Type Option

3. Select the Header Type based on your SMS content. If your SMS is promotional in nature select the first option Promotional and if the SMS is informative then choose the second option Others (Transactional, Service Explicit, Service Implicit).

Header Category

4. Select the Header Category from the dropdown list. If your business or industry is related to Finance choose the first option, if you are a Real Estate Business owner choose the second and so on. If your business does not fall in any of the listed categories, select Others.

5. Create a Header Name of six letters representing your company name.

Important points to remember while creating Header Name

  • If you have selected Promotional in the Header Type tab, then your Header must be in numeric digits. The starting digit must be according to the category selected. For example, if your business comes under the first category that is Banking/Insurance/Financial products/credit cards, then your Header should begin with 1. Similarly, if you are in Real Estate Business then the Header will begin with the numeric digit 2. Your Header Name should begin with the numeric digits as displayed in the table below:
Business CategoryHeader must start withExamples
Banking/Insurance/Financial products/Credit cards1163849, 154772
Real Estate2243563, 287623
Education3387659, 384342
Health4498723, 498766
Consumer Goods and Automobiles5567439, 521987
Communication/Broadcasting/Entertainment/IT6678775, 691223
Tourism and Leisure7768972, 754327
Food and Beverages8829653, 896544
Others0035647, 076421
  • If you have selected ‘Others’ as the Header Type, then your Header must be in 6 alphabetical characters. You can choose a string of six letters representing your business or brand name.
  • The Header names are case-sensitive. For example, the Header FSTSMP and fstsmp will be considered two different Headers and both are valid.

Create a Header name in accordance with the above stated points and then click on the Submit button. As you can see in the image below, we have created Header Name as FSTSMP as the Header Type is Others and is for Transactional, Service Explicit and Service Implicit messages.

Create Header in Jio DLT

Header Name must be as follows:

Promotional Route: 6 Digit Numeric only.

Other Route: 6 alphabetical characters only (without number)

Request for header submitted

6. As you click on the Submit button, a dialog box will appear on your screen as shown below.

Note: If your Header name has been already taken by someone else, the following message will appear on your screen.

Header Already registered

7. Once you have submitted the Header request, an email will be sent on your registered email ID stating that Header registration request is received and is being processed.

Jio confirmation email of header registration request

8. It can take 3-7 working days for headers approval from Jio DLT after submitting your request.

You can check the status of your Header Registration Request from the Header SMS Details option in the Header SMS tab. The status of Headers pending for approval, rejected and registered can be viewed from this tab.

As you can see in the image below, Header FSTSMP submitted for approval is in the Pending Approval tab. Here, the Header Name, Type and Registered Date will also be displayed. You can even search for a Header within a specific time frame. As shown in the image, a date selection field is visible. Enter the time period in the Date From and Date To fields and then click on Apply. The Headers based on the selected time frame will be displayed.

Pending for approval FSTSMP

The Headers which have been rejected will be visible in the Rejected tab. As you click on that tab, the Headers rejected will be displayed as shown in the image. The Header Type, Rejected Date and the Reason for Rejection will also be available to view.

As you can see in the image below, Header Pbsa has been rejected with the reason of improper Header length. Next, Beauty16Salon has been rejected because of Invalid length and Invalid format.

Similarly, your registered Headers can be viewed from the Registered tab.

Header rejected

Next steps will be to approve your Consent & Content Template.

how to download files or backup data from aws server instance or any other server

how to download files or backup data from aws server instance or any other server
*Technical Trainer.
*Website developer
*SEO Service
*Digital Marketing Service
Aditya Kumar Singh, +91-9555699081

Aditya Kumar singh by profession he is a website developer, manage AWS or other server, also working on virtualization and server security.

Available Column Types in Laravel

CommandDescription
$table->id();Alias of $table->bigIncrements('id').
$table->foreignId('user_id');Alias of $table->unsignedBigInteger('user_id').
$table->bigIncrements('id');Auto-incrementing UNSIGNED BIGINT (primary key) equivalent column.
$table->bigInteger('votes');BIGINT equivalent column.
$table->binary('data');BLOB equivalent column.
$table->boolean('confirmed');BOOLEAN equivalent column.
$table->char('name', 100);CHAR equivalent column with a length.
$table->date('created_at');DATE equivalent column.
$table->dateTime('created_at', 0);DATETIME equivalent column with precision (total digits).
$table->dateTimeTz('created_at', 0);DATETIME (with timezone) equivalent column with precision (total digits).
$table->decimal('amount', 8, 2);DECIMAL equivalent column with precision (total digits) and scale (decimal digits).
$table->double('amount', 8, 2);DOUBLE equivalent column with precision (total digits) and scale (decimal digits).
$table->enum('level', ['easy', 'hard']);ENUM equivalent column.
$table->float('amount', 8, 2);FLOAT equivalent column with a precision (total digits) and scale (decimal digits).
$table->geometry('positions');GEOMETRY equivalent column.
$table->geometryCollection('positions');GEOMETRYCOLLECTION equivalent column.
$table->increments('id');Auto-incrementing UNSIGNED INTEGER (primary key) equivalent column.
$table->integer('votes');INTEGER equivalent column.
$table->ipAddress('visitor');IP address equivalent column.
$table->json('options');JSON equivalent column.
$table->jsonb('options');JSONB equivalent column.
$table->lineString('positions');LINESTRING equivalent column.
$table->longText('description');LONGTEXT equivalent column.
$table->macAddress('device');MAC address equivalent column.
$table->mediumIncrements('id');Auto-incrementing UNSIGNED MEDIUMINT (primary key) equivalent column.
$table->mediumInteger('votes');MEDIUMINT equivalent column.
$table->mediumText('description');MEDIUMTEXT equivalent column.
$table->morphs('taggable');Adds taggable_id UNSIGNED BIGINT and taggable_type VARCHAR equivalent columns.
$table->uuidMorphs('taggable');Adds taggable_id CHAR(36) and taggable_type VARCHAR(255) UUID equivalent columns.
$table->multiLineString('positions');MULTILINESTRING equivalent column.
$table->multiPoint('positions');MULTIPOINT equivalent column.
$table->multiPolygon('positions');MULTIPOLYGON equivalent column.
$table->nullableMorphs('taggable');Adds nullable versions of morphs() columns.
$table->nullableUuidMorphs('taggable');Adds nullable versions of uuidMorphs() columns.
$table->nullableTimestamps(0);Alias of timestamps() method.
$table->point('position');POINT equivalent column.
$table->polygon('positions');POLYGON equivalent column.
$table->rememberToken();Adds a nullable remember_token VARCHAR(100) equivalent column.
$table->set('flavors', ['strawberry', 'vanilla']);SET equivalent column.
$table->smallIncrements('id');Auto-incrementing UNSIGNED SMALLINT (primary key) equivalent column.
$table->smallInteger('votes');SMALLINT equivalent column.
$table->softDeletes('deleted_at', 0);Adds a nullable deleted_at TIMESTAMP equivalent column for soft deletes with precision (total digits).
$table->softDeletesTz('deleted_at', 0);Adds a nullable deleted_at TIMESTAMP (with timezone) equivalent column for soft deletes with precision (total digits).
$table->string('name', 100);VARCHAR equivalent column with a length.
$table->text('description');TEXT equivalent column.
$table->time('sunrise', 0);TIME equivalent column with precision (total digits).
$table->timeTz('sunrise', 0);TIME (with timezone) equivalent column with precision (total digits).
$table->timestamp('added_on', 0);TIMESTAMP equivalent column with precision (total digits).
$table->timestampTz('added_on', 0);TIMESTAMP (with timezone) equivalent column with precision (total digits).
$table->timestamps(0);Adds nullable created_at and updated_at TIMESTAMP equivalent columns with precision (total digits).
$table->timestampsTz(0);Adds nullable created_at and updated_at TIMESTAMP (with timezone) equivalent columns with precision (total digits).
$table->tinyIncrements('id');Auto-incrementing UNSIGNED TINYINT (primary key) equivalent column.
$table->tinyInteger('votes');TINYINT equivalent column.
$table->unsignedBigInteger('votes');UNSIGNED BIGINT equivalent column.
$table->unsignedDecimal('amount', 8, 2);UNSIGNED DECIMAL equivalent column with a precision (total digits) and scale (decimal digits).
$table->unsignedInteger('votes');UNSIGNED INTEGER equivalent column.
$table->unsignedMediumInteger('votes');UNSIGNED MEDIUMINT equivalent column.
$table->unsignedSmallInteger('votes');UNSIGNED SMALLINT equivalent column.
$table->unsignedTinyInteger('votes');UNSIGNED TINYINT equivalent column.
$table->uuid('id');UUID equivalent column.
$table->year('birth_year');YEAR equivalent column.

Complete Laravel installation and API guide

How to install Laravel using composer

composer create-project laravel/laravel example-app

cd example-app

php artisan serve

Create View in Laravel

<!-- View stored in resources/views/home.blade.php -->

<html>
    <body>
        <h1>My Home Page {{ $name }}</h1>
    </body>
</html>


<!-- Route stored in routes/web.php -->


Route::get('/', function () {
    return view('greeting', ['name' => 'James']);
});

Create model, controller and view in Laravel

Step 1: Create model and controller

php artisan make:controller HomeController --resource --model=Home

Step 2: Create View in Laravel



<!-- View stored in resources/views/home.blade.php -->

<html>
    <body>
        <h1>My Home Page {{ $name }}</h1>
    </body>
</html>

Step 3: call controller using route and display view




<!-- Route stored in routes/web.php -->

Route::get('/home', 'App\Http\Controllers\HomeController@index');

or 

Route::get('/home', 'HomeController@index');

Note: changing the RouteServiceProvider.php file in App/Providers/ path by uncommenting the code.

protected $namespace = ‘App\Http\Controllers’;

Create and Rest Api in Laravel

php artisan make:controller ApiController

You will find a new file named ApiController.php in the app\http\controllers directory. Next, we can add the following methods:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ApiController extends Controller
{
    public function sendResponse($result, $message)
  {
    $response = [
          'success' => true,
          'data'    => $result,
          'message' => $message,
      ];
   return response()->json($response, 200);
  }

  /**
     * return error response.
     *
     * @return \Illuminate\Http\Response
     */
    public function sendError($error, $errorMessages = [], $code = 404)
    {
    	$response = [
            'success' => false,
            'message' => $error,
        ];


        if(!empty($errorMessages)){
            $response['data'] = $errorMessages;
        }


        return response()->json($response, $code);
    }


//
    public function getList() {

      /*  $test = Test::get()->toJson(JSON_PRETTY_PRINT);
        return response($tests, 200);*/

      /*  return response()->json([
            "message" => "student record created"
        ], 201);*/

$data= array();     
          $data = DB::connection('default')->table('users')->where('id',$id)->get();
        return $this->sendResponse($data, 'Successfully');
        
      }
}

Proceed to the routes directory and open the api.php file and create the endpoints that will reference the methods created earlier in the ApiController

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

<!-- Route stored in routes/api.php -->

Route::get('getList', 'App\Http\Controllers\ApiController@getList');

or

Route::get('getList', 'ApiController@getList');

Test Api using Postman

Useful command for Laravel

composer dumpautoload

php artisan cache:clear

php artisan config:clear

php artisan view:clear

command php artisan list

 make:channel         Create a new channel class
  make:command         Create a new Artisan command
  make:controller      Create a new controller class
  make:event           Create a new event class
  make:exception       Create a new custom exception class
  make:factory         Create a new model factory
  make:job             Create a new job class
  make:listener        Create a new event listener class
  make:mail            Create a new email class
  make:middleware      Create a new middleware class
  make:migration       Create a new migration file
  make:model           Create a new Eloquent model class
  make:notification    Create a new notification class
  make:observer        Create a new observer class
  make:policy          Create a new policy class
  make:provider        Create a new service provider class
  make:request         Create a new form request class
  make:resource        Create a new resource
  make:rule            Create a new validation rule
  make:seeder          Create a new seeder class
  make:test            Create a new test class