Path - /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
ps ax | grep java
kill -TERM <processid>
sudo rm -rf /Applications/Docker.app
sudo su
- Open Terminal and type this command
top
- This will list all the process.
Let us say that you want to delete the java process that is already running.
- Check for the PID java process in the list that is displayed by running the top command.
- Run this command
kill -9 [PID]
sudo lsof -i :8080
kill -9 [PID]
How to display the Hidden files in Mac?
- Open the Terminal and run the below command.
defaults write com.apple.finder AppleShowAllFiles YES
- If you have finder open already, then close all the windows and press control + option and click on the touch pad . Press relaunch option.
ifconfig |grep inet
https://osxdaily.com/2010/11/21/find-ip-address-mac/
- Open Terminal
- Type printenv in the terminal.This command will prints out all the environment variables.
z001qgd@6c4008c0f7fa ~ $ echo 'mystring' | openssl base64
bXlzdHJpbmcK
z001qgd@6c4008c0f7fa ~ $ echo 'bXlzdHJpbmcK' | openssl base64 -d
mystring
Cmd + Opt + I
Follow the below link for more options:
https://developers.google.com/web/tools/chrome-devtools/inspect-styles/shortcuts
command + m
command + `
- Add the below piece of code at the bottom of the .bash_profile file.
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
Run the below command.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run the below command :
brew install postgres
How to Start PostGres?
brew services start postgresql
How to Stop PostGres?
brew services stop postgresql
https://www.postgresql.org/docs/9.1/static/app-createuser.html
createuser -h localhost -p 5432 -S -D -R -e postgres
https://www.postgresql.org/docs/9.1/static/app-createdb.html
createdb -p 5432 -h localhost -e localDB
Download the postgres client pgAdmin from the below link.
- Installation steps are available in this link.
https://sdkman.io/install
- Command to list the local java versions
sdk list java local
- You will notice the installed message in the status of the list thats displayed.
- Command template to install a specific version.
sdk install java <Identifier>
- Example:
sdk use java 17.0.5-tem
sdk use java 11.0.18-tem
- To simplify things, set this up in the Zshell
alias j17="sdk use java 17.0.5-tem"
alias j11="sdk use java 11.0.18-tem"
- Download gradle from the Gradle website from the following link Gradle Download
- Download the complete distribution and unzip it.
- Open the .bash_profile that will be present in the /Users/[username]/ folder.
- Add below lines in to the profile file.
- GRADLE_HOME - folder which has the downloaded path of Gradle.
GRADLE_HOME=/Users/[username]/Dilip/Soft/gradle-3.2.1;
export GRADLE_HOME
export PATH=$PATH:$GRADLE_HOME/bin
-
Open a new terminal and type Gradle
-
Below message will be displayed.
Welcome to Gradle 3.2.1.
To run a build, run gradle <task> ...
To see a list of available tasks, run gradle tasks
To see a list of command-line options, run gradle --help
To see more detail about a task, run gradle help --task <task>
BUILD SUCCESSFUL
Total time: 0.926 secs
gradle assemble - This will build the project and places the artifact in the build folder.