2019年12月16日 星期一

redis

command

  • redis-server:啟動服務
  • redis-client -h 127.0.0.1 -p 6379:client登入

Config File

  • Mac /usr/local/etc/redis.conf
  • Centos /etc/redis.conf

Set password

在redis.conf中設置,requirepass pass 這行。

執行session設置(僅限本session有效)

redis 127.0.0.1:6379> AUTH PASSWORD
(error) ERR Client sent AUTH, but no password is set
redis 127.0.0.1:6379> CONFIG SET requirepass "mypass"
OK
redis 127.0.0.1:6379> AUTH mypass

Mac Command

launchctl

Basic

launchctl依據plist的設定起動程式

Commands

load read a plist file and schedule a launch
unload stop and unschedule a config file
start start the service, ignore the schedule
stop stop the service, ignore the schedule

restart example

launchctl unload -w ~/Library/LaunchAgents/com.apple.myservice.plist

launchctl load -w ~/Library/LaunchAgents/com.apple.myservice.plist


Unload default apache
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

User defined schedule config
範例

2019年12月4日 星期三

homebrew

command

  • brew help
  • brew update
  • brew upgrade
  • brew search
  • brew list
  • brew info
  • brew install
  • brew uninstall

Services

brew services list //list all services
brew services start redis
brew serivces stop redis

問題

安裝某個formula 之後,執行發生 command not found

brew需要寫入某些自己的資料夾,
如果裡面有檔案是owner是root,會出錯。
把/usr/local下,所有brew 開頭資料夾,裡面的檔案, owner 改成自己,並且加上 R 屬性。