Logo Ricky
  • Home
  • About
  • More
    Skills Experiences Education Projects
  • Posts
  • Notes
  • Activities
  • Transform
  • English
    English Chinese
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Tags
  • A10
  • ACME
  • AD
  • AES
  • AI
  • Aliyun
  • Ansible
  • APP
  • Application Delivery Controller
  • Arceus
  • Argo CD
  • ASCII
  • Authentication
  • Authorization
  • AWS
  • BASH
  • Bayonet
  • Benchmark
  • BGP
  • BIRD
  • Board Game
  • Browser
  • Byte
  • Cache
  • CDN
  • Channel
  • Chart
  • Checklist
  • Chrome
  • Chrome OS
  • Chrony
  • CI
  • Cilium
  • Cisco
  • Cloud-Native
  • Cloudflare
  • Cluster
  • Command Line
  • Completion
  • Config
  • Container
  • CPU
  • CURL
  • Data
  • Database
  • Debug
  • Dehydrated
  • Design
  • DevSecOps
  • Diagrams
  • Dmg
  • DNS
  • DNS-01
  • Docker
  • EFF
  • ElasticSearch
  • ELK
  • Emoji
  • EMQX
  • Encode
  • Encrypt
  • ESXi
  • Extension
  • Firewall
  • Fortigate
  • Fortinet
  • FortiOS
  • Game
  • GeoIP
  • GIN
  • Git
  • GitBook
  • Github
  • Gitlab
  • GitOps
  • Gluetun
  • Go
  • Go-Mysql-Elasticsearch
  • Golang
  • Google
  • GPG
  • GraphQL
  • HA
  • HAProxy
  • Hash
  • HomeLab
  • Htop
  • HTTP
  • Infra
  • Infrastructure
  • Input Method
  • Interview
  • Introduction
  • IPhone
  • Iptables
  • Iso
  • Issue
  • ITerm2
  • Jenkins
  • Jsoniter
  • Juniper
  • JWT
  • Kibana
  • Kubernetes
  • LDAP
  • Leetcode
  • Lightweight
  • Linkerd
  • Links
  • Linux
  • Llamafile
  • LLM
  • Log
  • Lua
  • Lullaby
  • LVM
  • Machinelearning
  • MacOS
  • Markdown
  • Mattermost
  • Mermaid
  • MinIO
  • Module
  • MQTT
  • MSS
  • MTU
  • Music
  • MyDumper
  • MySQL
  • NAS
  • Netcat
  • Network
  • Nftables
  • Nginx
  • OAuth
  • OIDC
  • Ollama
  • OpenResty
  • Parquet
  • Percona
  • Pinyin
  • Pip
  • Plugin
  • Pokemon
  • PostgreSQL
  • PowerDNS
  • PowerShell
  • Pprof
  • Principle
  • Prometheus
  • Protobuf
  • Proxy
  • Push
  • Python
  • QRCode
  • R
  • RAID
  • RDP
  • Redis
  • Regex
  • Ringtone
  • Route
  • Rust
  • S3
  • ScreenShot
  • Security
  • Selenium
  • Sentry
  • Service Mesh
  • SFTP
  • SHELL
  • Slides
  • Snow
  • Software
  • SonarQube
  • SQL
  • SSH
  • SSL
  • String
  • Switch
  • Sync
  • Synology
  • System
  • Tcpdump
  • Telegram
  • Terminal
  • Terraform
  • Test
  • Testing
  • Time
  • Timeout
  • TLS
  • Tor
  • Trace
  • Traefik
  • Travel
  • Tunnel
  • Typora
  • Ubuntu
  • URL
  • UserAgent
  • V2Ray
  • Vagrant
  • Video
  • Vim
  • Virtualization
  • Visualization
  • VNC
  • VPN
  • VSCode
  • WAF
  • Web
  • WebAssembly
  • Webp
  • Windows
  • WSL
  • YAML
  • Youtube
  • Zabbix
  • Zero Trust
  • Zim
  • ZSH
  • 台語
Hero Image
Zsh Config Files and Priority

Zsh Config Files and Priority Zsh environment variable config files: .zprofile .zlogin .zshrc .zshenv .zlogout .zshrc is used for overall shell customization .zprofile and .zlogin are similar. They both set environment variables for login shells, but their load timing differs. .zprofile is based on Bash’s .bash_profile, while .zlogin is the CSH-style .login legacy name. .zshrc sets environment variables for interactive shells. It loads after .zprofile. Typically used for $PATH, $PROMPT, aliases, functions, etc. .zshenv is always read, so you can set environment variables like $PATH or $EDITOR there, but it is generally not used. .zlogout is loaded when a session logs out, which is good for cleanup, such as resetting terminal titles. Zsh loads ~/.zprofile at login (login shell).

Monday, May 8, 2023 Read
Hero Image
Zsh tab-completion not working

Zsh tab-completion not working Question Although I’ve used Oh-My-Zsh in the past, I decided this time around (i.e. setting up a new computer) I’d try to avoid installing it to keep things a bit leaner. Right now I’m trying to cherry-pick Oh-My-Zsh’s insensitive tab-completion feature. Digging around its source repo, I found the following line: zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' I’m fairly confident this is the line Oh-My-Zsh executes to do what I want, so I tried adding it to my .zshrc. Restarted my terminal. Typed cd desk, then hit [tab]. No dice – I didn’t get cd Desktop/.

Friday, December 10, 2021 Read
Hero Image
Super easy! Build a beautiful and handy zsh terminal

Super easy! Build a beautiful and handy zsh terminal Make your terminal stylish and fast with zsh + zim + powerlevel10k Build a 10X Engineer shell environment

Thursday, October 7, 2021 Read
Hero Image
I can feel the speed — optimize zsh and oh my zsh cold start

I can feel the speed — optimize zsh and oh my zsh cold start Profiling # .zshrc zmodload zsh/zprof $ /bin/zsh $ zprof num calls time self name ----------------------------------------------------------------------------------- 1) 1 395.66 395.66 33.10% 395.59 395.59 33.09% _zsh_nvm_auto_use 2) 1 216.22 216.22 18.09% 216.13 216.13 18.08% nvm_die_on_prefix 3) 1 648.00 648.00 54.20% 168.85 168.85 14.12% nvm_auto 4) 2 479.15 239.57 40.08% 160.50 80.25 13.43% nvm 5) 1 102.30 102.30 8.56% 84.99 84.99 7.11% nvm_ensure_version_installed 6) 2 51.21 25.60 4.28% 29.55 14.78 2.47% compinit 7) 1 680.18 680.18 56.89% 22.17 22.17 1.85% _zsh_nvm_load 8) 2 21.66 10.83 1.81% 21.66 10.83 1.81% compaudit 9) 1 17.31 17.31 1.45% 17.31 17.31 1.45% nvm_is_version_installed 10) 193 17.43 0.09 1.46% 14.50 0.08 1.21% _zsh_autosuggest_bind_widget [Redacted] The zprof module only reports the time for each zsh function, so it is useful for finding oh-my-zsh plugins that slow down cold start. To profile the entire .zshrc, use xtrace. Add the following at the top of .zshrc:

Thursday, July 15, 2021 Read
Hero Image
Let Zsh read macOS system proxy settings and set env vars

Let Zsh read macOS system proxy settings and set env vars $ system_profiler SPNetworkDataType # get full network configuration $ networksetup -listallnetworkservices # list all network services $ networksetup -getwebproxy Wi-Fi # get system proxy settings for a specific service $ scutil --proxy # get enabled proxy settings (wrapper for system_profiler)

Monday, January 11, 2021 Read
Navigation
  • About
  • Skills
  • Experiences
  • Education
  • Projects
Contact me:
  • zeyanlin@outlook.com
  • linzeyan
  • Ricky
  • Ricky