Bash Script: Cảnh báo dung lượng ổ đĩa trên server về Telegram BOT
Nhận đường liên kết
Facebook
X
Pinterest
Email
Ứng dụng khác
Trong cuộc sống nhiều khi server nó đầy bất ngờ. Script sau sẽ giúp monitoring và cảnh báo về telegram của system admin để lắp thêm storage trước khi service chết không kịp ngáp
SSH là gì? SSH (Secure Shell) là một phương thức mã hoá trên internet để tiện lợi cho việc đăng nhập từ xa và tăng tính bảo mật. Bản chất mã hoá của nó là sử dụng thuật toán RSA vì vậy mà nó sẽ 2 key: Private key và Public key. Puclic key sẽ được lưu trữ trên server còn Private key thì được lưu trữ tại client. Khi gửi một yêu cầu đăng nhập sẽ kèm theo Private key này và server có thể kiểm tra được xem có phải cùng bộ với Pulic key không, nếu đúng thì sẽ cho qua. Tạo SSH key Mở phần mềm Terminal gõ: ls -al ~/.ssh Lệnh trên sẽ kiểm tra có SSH tạo ra trước đó chưa? Nếu chưa tiếp tục gõ lệnh: ssh-keygen -t rsa Sau đó nó sẽ hỏi chỗ lưu. Mặc định là homeuser/.ssh Sau đó nó sẽ hỏi có muốn tạo keyphare không? (keyphare là mật khẩu để mở private key, khi đăng nhập vào server sẽ hỏi). Copy SSH key vào Clipboard: pbcopy < ~/.ssh/id_rsa.pub Sau đó vào Finder→Edit→Show Clipboard để copy hoặc lưu public key lại. OK, vậy là xong 😃
Introduction Systemd logs all Linux messages from the kernel and system processes. The journalctl command enables viewing and editing the systemd logs, making it a powerful tool for service and process debugging. This guide shows how to read, control, and maintain systemd logs using journalctl through examples. Prerequisites Access to the command line/terminal window. A text editor (such as nano ) to edit the config file. A user with sudo privileges (see how to add a user to sudoers ). What Is Systemd? Systemd is a Linux service and system manager. While users do not invoke systemd directly, the manager contains many tools and daemons to run individually for various system processes. One of the most powerful systemd functionalities is the logging features. Systemd provides a centralized solution for logging all kernel and user processes through logs known as journals . The...
Hôm qua gặp quả lỗi PhpStorm do cấu hình sai Reformat, sau 1 hồi tìm kiếm thì ra thông tin sau, nếu lỗi có thể thử fix Ấn phím tắt Option + Shift + Command + L, 1 popup sẽ hiện ra như sau PhpStorm Reformat File Dialog Cấu hình popup trên như sau Scope - Only changes uncommitted to VCS : Nếu được chọn, thì việc reformat code sẽ chỉ áp dụng cho mã đã được thay đổi cục bộ nhưng chưa được đưa vào kho lưu trữ. Tùy chọn này chỉ khả dụng cho các tệp được kiểm soát phiên bản. - Selected text : Nếu chọn scope này, PhpStorm sẽ chỉ format đoạn code được bôi đen - Whole file : Chọn options này để định dạng lại toàn bộ mã nguồn trong tệp hiện tại -> Nên chọn options này Options - Code cleanup : Chọn tùy chọn này để chạy kiểm tra dọn dẹp mã. PhpStorm tìm và tự động sửa các đoạn mã có khả năng gây ra sự cố -> nên bỏ để tránh tốn performance. Nên sử dụng các trình eslint và check để xử lý và kiểm soát tốt hơn - Do not keep line breaks : Định dạng lại ngắt dòng theo cài đặt kiể...
Nhận xét
Đăng nhận xét