Eric Guo's

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

Upgrade Redis to 6.x on Ubuntu 20.04


Add the official beta apt source

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list

Do install && restart

sudo apt-get update
sudo apt-get install redis
sudo systemctl restart redis

Original post

Fix core.fsyncObjectFiles Is Deprecated; Use core.fsync Instead in Gitlab


After upgrade to higher version of Gitlab, when I push the repository to Gitlab, it gives warning like:

The warning when you push
remote: warning: core.fsyncObjectFiles is deprecated; use core.fsync instead
remote: Resolving deltas: 100% (2654/2654), completed with 614 local objects.
remote: warning: core.fsyncObjectFiles is deprecated; use core.fsync instead
remote: warning: core.fsyncObjectFiles is deprecated; use core.fsync instead

More recent commit fix it, but maybe due to I upgrade from 14.6 source code installation, so the setting is not apply.

Running below command to fix it.

sudo su - git
git config -l
git config --global --unset core.fsyncObjectFiles
git config --global --add core.fsync objects,derived-metadata,reference
git config --global --add core.fsyncMethod fsync

Compare with before setting and after FYI:


Deploy Homeland Forum Rails App on Rocky Linux 8


Install htop and atop

sudo dnf update
sudo dnf install epel-release
sudo dnf install htop
sudo dnf install atop

Install nginx

sudo dnf install nginx

Install node.js v18

Using nodesource distribution

curl -fsSL | bash -
dnf install -y nodejs
yum install gcc-c++ make
curl -sL | sudo tee /etc/yum.repos.d/yarn.repo
yum install yarn

Install postgresql

Following DO manual

dnf module list postgresql
sudo dnf module enable postgresql:13
sudo dnf install postgresql-server
sudo dnf install postgresql-devel
sudo postgresql-setup --initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo -i -u postgres

Install homeland other depends

yum install redis
yum install memcached
yum install ImageMagick
yum install ghostscript

Setup thape_forum user account

adduser thape_forum
cd /etc/sudoers.d/
echo "thape_forum ALL=(ALL) NOPASSWD:ALL" > 20-thape_forum-user
sudo su - thape_forum
mkdir .ssh
chmod 700 .ssh
vi .ssh/authorized_keys # and paste your public key
chmod 600 .ssh/authorized_keys

Install rbenv & ruby

sudo dnf -y install git git-lfs make gcc curl openssl-devel zlib-devel libffi-devel readline-devel sqlite-devel
curl -fsSL | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
rbenv -v
rbenv install -l
rbenv install 3.1.2
ruby --version
echo "gem: --no-document" > ~/.gemrc
gem update --system

Prepare the capistrano deploy folder

cd /var
sudo mkdir -p www/thape_forum
cd www
sudo chown -R thape_forum:thape_forum thape_forum/
bundle exec cap production puma:config

Create postgresql db user and import DB

sudo su - postgres
createuser thape_forum
ALTER ROLE thape_forum LOGIN;
CREATE DATABASE thape_forum_prod WITH ENCODING='UTF8' OWNER=thape_forum;
psql -d thape_forum_prod -f thape_forum_db.sql

Install nginx-mod-http-image-filter

sudo dnf makecache --refresh
sudo dnf -y install nginx-mod-http-image-filter

Original post

Install Ruby 3.2

Ruby 3.2 need Rust to build JIT.

yum --enablerepo=powertools install libyaml-devel
yum install -y rust

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

Eric-Guo's Macbook Shortcut Cheetsheet


CMD keys

Shortcut Description
cmd+ctl+Q Lock screen

FN keys

Shortcut Description
fn+A Navigate Dock
fn+C Control Center
fn+E Emoji & Symbols
fn+F Enter/Exit Full Screen
fn+H Desktop
fn+M Navigate Main Menu
fn+N Notifications
fn+Q Quick Note


shortcut in Finder

Shortcut Description
cmd+opt+P Show/Hide Path bar