Friday, July 6, 2018

Installing Z Shell and customize shell prompts using Oh My Zsh

# Install zsh
brew install zsh zsh-completion

# Install Oh My Zsh
# Copy Oh My zsh (clone from repo)
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
# Create zsh config file from template
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
# Change default shell to zsh
chsh -s /bin/zsh

vi .zshrc
#enable plugins (optional example)
plugins=(
  cp
  git
  golang
  helm
  kubectl
  minikube
  osx
  perl
  pip
  postgres
  ssh-agent
  sudo
  svn
  terminalapp
  terraform
  vagrant
  xcode
)

# Enable Kubernetes prompt (optional)
brew install kube-ps1

# Edit zsh config
vi .zshrc
# User configuration
source "/usr/local/opt/kube-ps1/share/kube-ps1.sh"
PS1='$(kube_ps1)'$PS1


Saturday, May 12, 2018

Error opening service: Could not find finalized endpoint being pointed to by app1-deployment: Temporary Error: No endpoints for service are ready yet

After exposing the deployment as a service for "app1-deployment" app

$ kubectl expose deployment app1-deployment --type=NodePort
service "app1-deployment" exposed

Getting the following error message when checking for ur URL exposed

$ minikube service app1-deployment --url
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Error opening service: Could not find finalized endpoint being pointed to by app1-deployment: Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet
Temporary Error: No endpoints for service are ready yet

# Just wait for kubernetes to successfully pull the image and check via command

$ minikube service app1-deployment --url
http://192.168.99.100:30816



Tuesday, May 8, 2018

Run Eclipse Neon macOS on any Java JDK version

Starting Eclipse Neon 3 on macOS High Sierra using JDK 10 produces the following error during startup:

View Eclipse error log
$ vi ~/Documents/workspace/.metadata/.log

!SESSION 2018-05-09 08:09:01.603 -----------------------------------------------
eclipse.buildId=4.6.3.M20170301-0400
java.version=10.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product -keyring /Users/xxxx/.eclipse_keyring
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/xxxx/.eclipse_keyring

!ENTRY org.eclipse.osgi 4 0 2018-05-09 08:09:05.117
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386)
        at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:294)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)

        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultH

Get full path list of available Java Runtimes
$ /usr/libexec/java_home --verbose
Matching Java Virtual Machines (2):
    10.0.1, x86_64: "Java SE 10.0.1" /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
    1.8.0_172, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home


Edit eclipse .ini
$ vi /Applications/Eclipse.app/Contents/Eclipse/eclipse.ini

Add the following to the start of the line, replace with appropriate java version
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/bin