วันพุธที่ 17 เมษายน พ.ศ. 2567

New E-Claim API

 ได้ทำการเพิ่มบทบาทในระบบ DCenter เพื่อเข้าใช้งาน API Claim ในส่วนของ Production Zone เรียบร้อยครับ

ขอนำไฟล์แชร์ ให้ไว้ใช้โหลดเอกสารและคู่มือครับ

วันพุธที่ 6 มีนาคม พ.ศ. 2567

เทียบเวลามาตรฐาน

 ทดสอบบน Ubuntu 14.04 LTS


  1. การเทียบเวลาให้ตรงกับServer Clock ของมหาวิทยาลัย
      - ด้วยคำสั่ง sudo ntpdate winnie.rmutsv.ac.th
      - หากต้องการให้ตั้งเทียบเวลาอัตโนมัติทุกวัน ให้สร้างแฟ้มชื่อ /etc/cron.daily/update-time มีข้อมูลว่า
สร้างไฟล์  touch update-time
sudo nano /etc/cron.daily/update-time
ใส่เข้าไป
       #!/bin/bash
       /usr/sbin/ntpdate pool.ntp.org

sudo ntpdate pool.ntp.org

       แก้ไขให้แฟ้มนี้สามารถ execute ด้วยคำสั่ง sudo chmod +x /etc/cron.daily/update-time
       แล้วสั่งให้ cron ทำงานใหม่ด้วยคำสั่ง sudo service cron restart

       หากไม่ตั้งเทียบเวลาทุกวัน นาฬิกาจะเดินผิดพลาดไปวันละประมาณ 2 วินาที

ที่มา http://www.phuketadmin.org/index.php?topic=7210.0

วันพุธที่ 24 มกราคม พ.ศ. 2567

Script Backup Database

.สคริปต์สำรองข้อมูล MySQL บนระบบปฏิบัติการลีนุกซ์

1. backup_all_db.sh  ==> สำรองรวมทุกดาต้าเบสเป็น 1 ไฟล์

2. backup_all_db2.sh ==> สำรองแยกดาต้าเบสออกเป็นหลายไฟล์เท่ากับจำนวนดาต้าเบสที่มีใน MySQL Server นั้นๆ

 backup_all_db.zip

https://drive.google.com/file/d/1XQvnwVsSAwlmVgMivpxpaKPzl4Qq0a1-/view?usp=sharing

 backup_all_db2.zip

https://drive.google.com/file/d/1YgYIJ6ALNKooFhURvlKUYOTTzKwRSddj/view?usp=sharing

วันพฤหัสบดีที่ 14 ธันวาคม พ.ศ. 2566

วันศุกร์ที่ 8 ธันวาคม พ.ศ. 2566

Yii2 Spinner

html

<div id="loading-spinner" style="display: none;">

    <!-- Add your spinner image or loading text here -->

    Loading...

</div>

หรือ

<div id="loading-spinner" style="display: none; color: purple; font-size: 20px;">

    <!-- Customize the text and style as needed -->

    <strong>Loading...</strong>

</div>


<javascript>

<script>

$(document).ready(function() {

    $('.popup-link').click(function(e) {

        e.preventDefault();

        var url = $(this).data('url');

        openModalWithData(url);

    });

    $('#selectAll').click(function() {

        // Show the spinner when the button is clicked

        $('#loading-spinner').show();

    });


    // Assuming you have a form with the class 'your-form-class'

    $(document).on('beforeSubmit', 'form[name="frmMain"]', function() {

        // Show the spinner before form submission

        $('#loading-spinner').show();

        return true;

    });

    // If you're using Pjax, hide the spinner on successful Pjax response

    $(document).on('pjax:success', function() {

        $('#loading-spinner').hide();

    });


    // If you're not using Pjax, hide the spinner on any AJAX request completion

    $(document).ajaxStop(function() {

        $('#loading-spinner').hide();

    });

});

function openModalWithData(url) {

    $.ajax({

        url: url,

        method: 'GET',

        success: function(response) {

            $('#myModal .modal-body').html(response);

            $('#myModal').modal('show');

        },

        error: function() {

            alert('An error occurred while fetching data.');

        }

    });

}

</script>