Eric Guo's blog.cloud-mes.com

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Using the NFS Drive in Ubuntu 20.04

Permalink

Run as root
apt-get install nfs-common
mkdir -p /mnt/codebase_backup
chown root:root codebase_backup/
mount -t nfs 172.17.0.1:/ifs/NFS-Directory/codebase_backup-NFS /mnt/codebase_backup
echo '172.17.0.1:/ifs/NFS-Directory/codebase_backup-NFS /mnt/codebase_backup nfs defaults 0 0' >> /etc/fstab

Clean Xcode Disk Usage

Permalink

xcode-select -p # default /Library/Developer/CommandLineTools
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
xcrun simctl delete unavailable
sudo xcode-select --switch /Library/Developer/CommandLineTools

Quick Clean Server Disk Usage Command in Safe Way

Permalink

SystemD journal clean

journalctl --disk-usage
sudo journalctl --vacuum-size=2000M # Delete log files until the disk space taken falls below the specified size:

Or see further command

Apt cache clean

sudo apt-get clean

Yum cache clean

sudo yum clean all

Yarn cache clean

yarn cache clean --force

Docker cache clean

docker system df
docker system prune -a

original from stackoverflow

My Monthly Subscription Review List

Permalink

No one like subscription, but we must pay something we really need every month and here is my list in RMB:

  1. (21) iCloud 200GB
  2. (15) Apple Music
  3. (23) Dragonruby Pro (annual 42 USD)
  4. (33) bandwagon host (month 33 USD)
  5. (6) Adblock Pro (annual 70 RMB)
  6. (6) MarginNote 3 OCR (annual 68 RMB)
  7. (28) Rubymine (annual 53 USD)
  8. (27) Medium Member (annual 50 USD)
  9. (6) blog domain (annual 10 USD)
  10. (1.5) 香哈菜谱 (annual 18 RMB)
  11. (10) AWS hosting
  12. (16.8) Meituan biking
  13. (50) Slack (month 8 USD)
  14. (38) Google Workspace Business Starter (month 6 USD)

So totally 282 RMB per month have to pay.

Setup Advanced Search in Gitlab 14.7 Log

Permalink

Installation Elastic Search using Debian/Ubuntu repository

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install elasticsearch
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
curl localhost:9200/

Enable correct IP and other securty settings:

/etc/elasticsearch/elasticsearch.yml
cluster.name: gitlab-elasticsearch
network.host: 192.168.100.20
http.port: 9200
discovery.seed_hosts: ["192.168.100.20"]
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

Initial password and record it down.

/usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto

Install analysis-smartcn

cd /usr/share/elasticsearch/
sudo bin/elasticsearch-plugin install analysis-smartcn
sudo systemctl restart elasticsearch