Eric Guo's

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

Using the NFS Drive in Ubuntu 20.04


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

Clean Xcode Disk Usage


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

Quick Clean Server Disk Usage Command in Safe Way


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


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


Installation Elastic Search using Debian/Ubuntu repository

wget -qO - | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb 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 gitlab-elasticsearch
http.port: 9200
discovery.seed_hosts: [""] true 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