Select and deselect multiple checkbox and store date into JavaScript set for unique value

<form method="post" action="/live-yearly" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<input type="hidden" name="selectedLiveValue" id="selectedLiveValue" required>
<input type="submit" value="Live">
</form>
 <th><input type="checkbox" id="selectAll"></th>
  <td><input type="checkbox" class="id" value="{{ $d->id }}" name="ids" ></td>
  <td><input type="checkbox" class="id" value="{{ $d->id }}" name="ids" ></td>
  <td><input type="checkbox" class="id" value="{{ $d->id }}" name="ids" ></td>
  <td><input type="checkbox" class="id" value="{{ $d->id }}" name="ids" ></td>
<script>
 var  selectedIds = new Set();


$(document).ready(function() {
$("#selectAll").click(function(){

if(! $(this).prop("checked")) {
              $(".id").prop("checked", false);
              $("#selectedLiveValue").val("");
              selectedIds.clear();
          } else {
              $(".id").prop("checked", true);
              $('input[name="ids"]:checked').each(function() {  
   selectedIds.add(this.value);
   selectedIds.forEach(function(value) {
  $("#selectedLiveValue").val(value+","+$("#selectedLiveValue").val());
});
});
   }  
        //  console.log($('input[name="ids"]:checked').serialize());
});


});

$(".id").click(function(){
  $("#selectedLiveValue").val("");
  if( $(this).prop("checked")) {
    selectedIds.add($(this).val());
  }else{
    selectedIds.delete($(this).val());
  }

selectedIds.forEach(function(value) {
  $("#selectedLiveValue").val(value+","+$("#selectedLiveValue").val());
});

});


  </script>

javascript:void(0)

Usage of javascript:void(0) means that the author of the HTML is misusing the anchor element in place of the button element. Anchor tags are often abused with the onclick event to create pseudo-buttons by setting href to “#” or “javascript:void(0)” to prevent the page from refreshing.

Get value of selected checkbox jQuery

    <th><input type="checkbox" id="selectAll"></th>
     <td><input type="checkbox" class="id" value="{{ $d->id }}" name="ids" ></td>
     <td><input type="checkbox" class="id" value="{{ $d->id }}" name="ids" ></td>
     <td><input type="checkbox" class="id" value="{{ $d->id }}" name="ids" ></td>
     <td><input type="checkbox" class="id" value="{{ $d->id }}" name="ids" ></td>
     <td><input type="checkbox" class="id" value="{{ $d->id }}" name="ids" ></td>
$(document).ready(function() {
$("#selectAll").click(function(){

if( $(this).prop("checked")) {
              $(".id").prop("checked", false);
          } else {
              $(".id").prop("checked", true);
          }  

          console.log($('input[name="ids"]:checked').serialize());

//OR


          $('input[name="ids"]:checked').each(function() {
   console.log(this.value);
});

});
});

how to remove sorting option from datatables

 $(document).ready(function() {

    $('#example').DataTable( {
      "aoColumnDefs": [
          { 'bSortable': false, 'aTargets': [ 0 ] }
       ]
      
  });

});
 $(document).ready(function() {

    $('#example').DataTable( {
  
       "columnDefs": [
        { "orderable": false, "targets": [1] }
    ]
  });

});

Select all checkbox jQuery

  <th><input type="checkbox" id="selectAll"></th>
<input type="checkbox" class="id" >
<input type="checkbox" class="id" >
<input type="checkbox" class="id" >
<script>

$(document).ready(function() {
$("#selectAll").click(function(){

if( $(this).prop("checked")) {
              $(".id").prop("checked", false);
          } else {
              $(".id").prop("checked", true);
          }

});
});

  </script>

check the system configuration in Linux

To know only the system name, you can use the uname command without any switch that will print system information or the uname -s command will print the kernel name of your system.

$ uname

To view your network hostname, use the ‘-n’ switch with the uname command as shown.

$ uname -n

To get information about kernel-version, use the ‘-v’ switch.

$ uname -v

To get the information about your kernel release, use the ‘-r’ switch.

$ uname -r

To print your machine hardware name, use the ‘-m’ switch:

$ uname -m

All this information can be printed at once by running the ‘uname -a’ command as shown below.

$ uname -a

lshw is a relatively small tool and there are few options that you can use with it while extracting information. The information provided by lshw was gathered from different /proc files.

$ sudo lshw

You can print a summary of your hardware information by using the -short option.

$ sudo lshw -short

If you wish to generate output as an html file, you can use the option -html.

$ sudo lshw -html > lshw.html

To view information about your CPU, use the lscpu command as it shows information about your CPU architecture such as a number of CPUs, cores, CPU family model, CPU caches, threads, etc from sysfs and /proc/cpuinfo.

$ lscpu

lsblk command is used to report information about block devices as follows.

$ lsblk 

If you want to view all block devices on your system then include the -a option.

$ lsblk -a

The lsusb command is used to report information about USB controllers and all the devices that are connected to them.

$ lsusb

You can use the -v option to generate detailed information about each USB device.

$ lsusb -v

set timezone in laravel 8

edit file /config/app.php and change value of timezone

'timezone' => 'Asia/Dhaka'

Using Environment file (.env)

Inside env
add DB config
DB_TIMEZONE=+08:00

AH01079: failed to make connection to backend: httpd-UDS

In order to fix this issue we need to restart the improved PHP handler ( ea-php72-php-fpm.service )

# systemctl restart ea-php72-php-fpm.service

It seems there is an issue with PHP-FPM mode (Mod-PHP works fine).
I installed version p3 on CentOS 6.5 succesfully and works OK.

Email : adityaypi@yahoo.com, Mobile : +91-9555699081

If problem exists, remove PHP-FPM module

FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features (mostly) useful for heavy-loaded sites.

These features include:

  • advanced process management with graceful stop/start;
  • ability to start workers with different uid/gid/chroot/environment, listening on different ports and using different php.ini (replaces safe_mode);
  • stdout and stderr logging;
  • emergency restart in case of accidental opcode cache destruction;
  • accelerated upload support;
  • “slowlog” – logging scripts (not just their names, but their PHP backtraces too, using ptrace and similar things to read remote process’ execute_data) that are executed unusually slow;
  • fastcgi_finish_request() – special function to finish request and flush all data while continuing to do something time-consuming (video converting, stats processing etc.);
  • dynamic/static child spawning;
  • basic SAPI status info (similar to Apache mod_status);
  • php.ini-based config file.

html5 structure example

<!DOCTYPE HTML>

<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Aditya Kumar Singh</title>
<meta name="description" content="Digital Marketing Company, Website Development Company">
<meta name=”robots” content="index, follow">
</head>

<body>

	<header>
		<nav>
			<ul>
				<li>Your menu</li>
			</ul>
		</nav>
	</header>
	
	<section>
	
		<article>
			<header>
				<h2>Article title</h2>
				<p>Posted on <time datetime="2009-09-04T16:31:24+02:00">September 4th 2009</time> by <a href="https://www.youtube.com/channel/UCK97h8vcjqXmS6nELQUpewQ?sub_confirmation=1">Writer</a> - <a href="#comments">6 comments</a></p>
			</header>
			<p>YouTube channel contain programming languages video, tricks, website development platforms etc.</p>
		</article>
		
		<article>
			<header>
				<h2>Article title</h2>
				<p>Posted on <time datetime="2009-09-04T16:31:24+02:00">September 4th 2009</time> by <a href="http://adityakumarsingh.co.in/aditya-kumar-singh">Writer</a> - <a href="#comments">6 comments</a></p>
			</header>
			<p>Information about aditya Kumar singh, here you find total experience, managed website, skills.</p>
		</article>
		
	</section>

	<aside>
		<h2>About Aditya</h2>
		<p>Information about aditya Kumar singh, here you find total experience, managed website, skills.</p>
	</aside>

	<footer>
		<p>Copyright 2021 Aditya Kumar Singh</p>
	</footer>

</body>

</html>