Sunday, 21 July 2024

Manage disk usage in Ubuntu

- Show file system usage

$ df -h 

$ free -h

$ top

- Show disk usage in folder

$ sudo du -h --max-depth=1

$ sudo du -h

- Show performance

$ htop

- Clean disk

$ sudo apt-get clean
$ sudo apt-get autoremove 
$ sudo rm -rf {path-to-folder}
$ sudo rm -rf /tmp/*

- Check file max usage dis

$ sudo find / -type f -size +100M -exec ls -lh {} \; | awk '{ print $NF ": " $5 }'

Thank you

Thursday, 4 July 2024

Update SSH 9.8 for Ubuntu

 1. download openssh-9.8p1.tar.gz

$ wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz
$ tar -xvf openssh-9.8p1.tar.gz
$ cd openssh-9.8p1

2. install ssh

$ ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-privsep-path=/var/lib/sshd
$ sudo make install 

3. Restart ssh

sudo systemctl restart ssh
ssh -V

4. Errors can happen

- Need install apps for ssh: zlib-devel  LibreSSL or OpenSSL, Ccompiler

$ sudo apt update 

$ sudo apt install zlib-devel

$ sudo apt-get install libssl-dev

$ sudo apt install build-essential

Thank you

  • ./configure: Chạy tập lệnh cấu hình để chuẩn bị các tệp makefile và xác định các biến cần thiết cho quá trình biên dịch.
  • --prefix=/usr: Thiết lập thư mục cài đặt chính là /usr.
  • --sysconfdir=/etc/ssh: Đặt thư mục chứa các tệp cấu hình là /etc/ssh.
  • --with-md5-passwords: Bật hỗ trợ sử dụng mật khẩu được mã hóa MD5.
  • --with-privsep-path=/var/lib/sshd: Đặt thư mục cho quy trình tách quyền (Privilege Separation) là /var/lib/sshd
  • Sitemap

    Backend

    Laravel | Symfony | PHP | AdonisJs | NodeJs | PostgreSQL | MySql | Redis | Ec-Cube |

    Frontend

    JavaScript | TypeScript | Vue | Nuxtjs | React | Nextjs | SCSS | HTML |

    DevOps

    VPS | GCP | AWS | SSH | Git | Nginx | Apache2 | Jenkins | Docker | Kubernetes |

    Tools

    VsCode | Laragon | DBeaver

    Others

    Interview | Machine Learning

     

    Thank you


    Golang Advanced Interview Q&A