2020年12月8日 星期二

Win10 關閉(大易輸入法關閉相關詞)

電腦\HKEY_CURRENT_USER\SOFTWARE\Microsoft\TableTextService\0x00000404\{037B2C25-480C-4D7F-B027-D6CA6B69788A}
HKEY_CURRENT_USER\Software\Microsoft\TableTextService\0x00000404\{037B2C25-480C-4D7F-B027-D6CA6B69788A} 實測 新增DWORD類型EnableAssociatePhrase數值改為 0 即可關閉相關字詞

2020年10月12日 星期一

Windows 10 MTU

TCP Analyzer
https://www.speedguide.net/

netsh interface ipv4 show subinterfaces
netsh int ipv4 set subinterface "iPhone-jojo" mtu=1440 store=persistent

2020年9月22日 星期二

openssl 1.1.1g

wget https://www.cpan.org/src/5.0/perl-5.28.0.tar.gz
tar -zxvf perl-5.28.0.tar.gz
cd perl-5.28.0
./Configure -des -Dprefix=$HOME/localperl
make test
make install

wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz
tar -xzf OpenSSL_1_1_1g.tar.gz
cd openssl-OpenSSL_1_1_1g
./config --prefix=/usr
make && make install
ldconfig
openssl version

2020年8月3日 星期一

Redis Cluster docker-compose.yml

run.sh
docker-compose down
docker-compose up -d

#設定 cluster
docker exec -it redis1 redis-cli --cluster create 10.123.123.11:7001 10.123.123.11:7002 10.123.123.11:7003 10.123.123.11:7004 10.123.123.11:7005 10.123.123.11:7006 --cluster-replicas 1
docker exec -it redis1 redis-cli -h 10.123.123.11 -p 7001 -c
docker-compose.yml
version: '2'
services:
  redis1:
    image: redis
    hostname: redis1
    container_name: redis1
    restart: always
    network_mode: host
    entrypoint:  
      - redis-server
      - --port 7001
      - --appendonly yes
      - --cluster-enabled yes
      - --protected-mode no
    ports:
      - 7001

  redis2:
    image: redis
    hostname: redis2
    container_name: redis2
    restart: always
    network_mode: host
#    volumes:
#      - ./vol/opt/:/opt/
    ports:
      - 7002
    entrypoint:  
      - redis-server
      - --port 7002
      - --appendonly yes
      - --cluster-enabled yes
      - --protected-mode no

  redis3:
    image: redis
    hostname: redis3
    container_name: redis3
    restart: always
    network_mode: host
    ports:
      - 7003
    entrypoint:  
      - redis-server
      - --port 7003
      - --appendonly yes
      - --cluster-enabled yes
      - --protected-mode no

  redis4:
    image: redis
    hostname: redis4
    container_name: redis4
    restart: always
    network_mode: host
    ports:
      - 7004
    entrypoint:  
      - redis-server
      - --port 7004
      - --appendonly yes
      - --cluster-enabled yes
      - --protected-mode no

  redis5:
    image: redis
    hostname: redis5
    container_name: redis5
    restart: always
    network_mode: host
    ports:
      - 7005
    entrypoint:  
      - redis-server
      - --port 7005
      - --appendonly yes
      - --cluster-enabled yes
      - --protected-mode no

  redis6:
    image: redis
    hostname: redis6
    container_name: redis6
    restart: always
    network_mode: host
    ports:
      - 7006
    entrypoint:  
      - redis-server
      - --port 7006
      - --appendonly yes
      - --cluster-enabled yes
      - --protected-mode no

2020年6月26日 星期五

CentOS 安裝 redis

yum -y --enablerepo=remi,remi-test install redis
設定 Redis 為背景服務
sudo systemctl daemon-reload
sudo systemctl enable redis.service
開啟防火牆 6379 埠號
# Add allow port 6379
firewall-cmd --permanent --add-port=6379/tcp
firewall-cmd --reload
啟動 Redis
# Start Redis service
sudo systemctl start redis.service
Ping Redis
redis-cli ping
yum -y remove redis

nginx /var/log/nginx/error.log failed (13: Permission denied), SELinux Problem

2020/06/26 00:59:59 [error] 9825#0: *52 open() "/home/user/www/index.html" failed (13: Permission denied),
解決方式,SELinux
chcon -R -u system_u -t httpd_sys_content_t /home/user/www

CentOS 安裝nginx

安裝能夠選擇指定 yum 的套件:
yum install yum-utils -y
vim /etc/yum.repos.d/nginx.repo
# 穩定版
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
module_hotfixes=true

# 最新版
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=0
enabled=0
module_hotfixes=true
yum-config-manager --enable nginx-stable
切換使用 nginx-stable 穩定版:
yum-config-manager --enable nginx-stable
查看欲安裝的 NGINX 版本資訊:
yum info nginx
安裝 NGINX:
yum install nginx -y
查看安裝的 NGINX 版本:
nginx -v
移除nginx
yum remove nginx -y