Skip to content

Instantly share code, notes, and snippets.

@misostack
Last active November 9, 2022 05:44
Show Gist options
  • Select an option

  • Save misostack/c0d362935af0bb5c119edc89e0d24652 to your computer and use it in GitHub Desktop.

Select an option

Save misostack/c0d362935af0bb5c119edc89e0d24652 to your computer and use it in GitHub Desktop.
100 days Linux

100 days linux

Disk size

df -H

image

Clean up

du -s -h /var/www

Logs

du -s -h /var/log/

How to fix /var/log/journal/ sizes increase by time?

https://ubuntuhandbook.org/index.php/2020/12/clear-systemd-journal-logs-ubuntu/ https://askubuntu.com/questions/1238214/big-var-log-journal

journalctl --disk-usage
# If you decide to clear the logs, run command to rotate the journal files.
# All currently active journal files will be marked as archived, so that they are never written to in future.
sudo journalctl --rotate

#Delete journal logs older than X days:
sudo journalctl --vacuum-time=2days
#Delete log files until the disk space taken falls below the specified size:
sudo journalctl --vacuum-size=100M
#Delete old logs and limit file number to X:
sudo journalctl --vacuum-files=5

Optimize Image Size

#Install optimization libs
sudo apt install jpegoptim pngquant gifsicle;
#Optimize gif images
find PATH -name '*.gif' -exec gifsicle -O3 -b {} \;
#Optimize jpg images
find PATH -name '*.jpg' -exec jpegoptim --strip-all --preserve --totals --all-progressive {} \;
#Optimize png images
find PATH -name '*.png' -exec pngquant --speed 1 -f -v --ext .png {} \;
@misostack
Copy link
Author

Setup a secure VPS

1st step

  • Create user for deployment
  • Disable root login, password authentication mechanism
  • Enable SSH login
  • Add SSH Keys
  • Test

2nd step

  • Setup ssh forward agent
  • Pull sample code from your git
  • Setup gitlab runner for deployment

@misostack
Copy link
Author

Devops JD

Yêu cầu:

  • Có kinh nghiệm thực tế làm việc với hệ thống cloud AWS (EC2, CloudFront, S3, IAM, EKS, RDS, ELB...).
  • Có kinh nghiệm thực tế về việc vận hành và triển khai hệ thống trên Kubernetes (EKS/kops).
  • Có kiến thức tốt và kinh nghiệm thực tế về container.
  • Có kiến thức tốt về hệ điều hành Linux, shell script.
  • Có kiến thức tốt về mạng máy tính và bảo mật.
  • Có khả năng xây dựng và vận hành CI/CD workflows với Gitlab CI hoặc Github Action.
  • Có kiến thức và kinh nghiệm thực tế về mô hình triển khai microservice, có thể xây dựng và vận hành các hệ thống centralized logging, distributed tracing, application metrics visualizing and monitoring,...
  • Biết hoặc có kinh nghiệm với ít nhất 01 ngôn ngữ/nền tảng lập trình backend, ví dụ java, dotnet, python, golang, nodejs…
  • Có kinh nghiệm làm việc với 01 hệ thống messaging: kafka, rabbitmq, nats...
  • Có kinh nghiệm làm việc với 01 hệ thống database: sql hoặc nosql.
  • Đã từng triển khai GitOps/ChatOps/DevSecOps/DataOps là một lợi thế.
  • Có kinh nghiệm và kiến thức về việc tối ưu chi phí AWS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment