Homebrew

From Chorke Wiki
Revision as of 09:26, 19 November 2023 by Shahed (talk | contribs)
Jump to navigation Jump to search
install homebrew or brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

https://github.com/settings/tokens >> generate new token
1. Note >> HOMEBREW_GITHUB_API_TOKEN
2. Select scopes >> repo >> public_repo

export HOMEBREW_GITHUB_API_TOKEN=xxxx

RBEnv

brew install rbenv
rbenv init
:'
# Load rbenv automatically by appending
# the following to ~/.bash_profile:

eval "$(rbenv init -)"
'

curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
:"
Checking for `rbenv' in PATH: /usr/local/bin/rbenv
Checking for rbenv shims in PATH: OK
Checking `rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20201118)
Counting installed Ruby versions: none
  There aren't any Ruby versions installed under `/Users/shahed/.rbenv/versions'.
  You can install Ruby versions like so: rbenv install 2.2.4
Checking RubyGems settings: OK
Auditing installed plugins: OK
"

#echo "gem: no-document" > ~/.gemrc 
brew upgrade rbenv ruby-build
rbenv install --list
rbenv install 2.7.2
rbenv global 2.7.2

rbenv install --list    |grep graalvm
rbenv install --list-all|grep graalvm

du -sh ~/.rbenv/versions/truffleruby*
rbenv install truffleruby+graalvm-22.3.1

Cocoapods

gem install cocoapods
#eval "$(rbenv init -)"
export LANG=en_US.UTF-8
pod --version

Derby

brew services stop derby
brew uninstall derby
brew cleanup

rm -rf ~/Library/LaunchAgents/homebrew.mxcl.derby* 
rm -rf  /usr/local/var/derby*

brew install derby
brew services start derby
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.derby.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.derby.plist
brew services list

MongoDB

brew tap | grep mongodb
xcode-select --install
brew tap mongodb/brew
brew tap

brew services stop mongodb-community
brew uninstall mongodb-community
brew cleanup

rm -rf ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community*
rm -rf  /usr/local/var/mongodb*

brew install mongodb-community
brew services start mongodb-community
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist

brew services stop mongodb-community
vim /usr/local/etc/mongod.conf
: <<'END_COMMENT'
net:
  bindIp: 127.0.0.1,10.19.83.110
END_COMMENT
brew services start mongodb-community
brew services list

PostgreSQL

brew services stop postgresql
brew uninstall postgresql
brew cleanup

rm -rf ~/Library/LaunchAgents/homebrew.mxcl.postgresql*
rm -rf  /usr/local/var/postgres*

brew install postgres
brew services start postgresql
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
brew services list

vim /usr/local/var/postgres/postgresql.conf 
: <<'END_COMMENT'
listen_addresses = '*'                 # what IP address(es) to listen on;
                                       # comma-separated list of addresses;
                                       # defaults to 'localhost'; use '*' for all
                                       # (change requires restart)
END_COMMENT

vim /usr/local/var/postgres/pg_hba.conf
: <<'END_COMMENT'
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
host    all             all             10.19.83.1/24           trust
END_COMMENT

createuser -s postgres
createuser $USER
createdb $USER
CREATE USER postgres SUPERUSER;
CREATE DATABASE postgres WITH OWNER postgres;

Redis

brew services stop redis
brew uninstall redis
brew cleanup

rm -rf ~/Library/LaunchAgents/homebrew.mxcl.redis* 
rm -rf  /usr/local/var/redis*

brew install redis
brew services start redis
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
vim /usr/local/etc/redis.conf
brew services list

Knowledge

git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" \
fetch --unshallow
brew update
brew doctor
brew cleanup

brew pin derby
brew unpin derby
brew list --pinned

brew services run derby
brew services stop derby
brew upgrade
brew upgrade --cask
brew doctor
brew cleanup

brew list
brew list --cask
brew deps --tree --installed
brew services list

brew services start derby
brew services restart derby

brew link --overwrite postgresql@12
brew services start postgresql@12
brew services stop postgresql@12
brew uninstall postgresql@12
brew install [email protected]
brew services list

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

rm -rf  /usr/local/var/postgres*
ls -lah ~/Library/LaunchAgents/
ls -lah /usr/local/opt/

brew uninstall --cask adoptopenjdk8
brew untap adoptopenjdk/openjdk
brew install --cask temurin

References