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

Friday, December 29, 2017

Install rEFInd on macOS High Sierra when System Integrity Protection (SIP) is enabled

# Download rEFInd from Sourceforge.net
$ curl -s -L http://sourceforge.net/projects/refind/files/0.11.2/refind-bin-0.11.2.zip -o refind.zip

# unpack downloaded file
$ unzip -q refind.zip

# Change directory
$ cd refind-bin-0.11.2

# Try installing rEFInd
$ sudo ./refind-install
ShimSource is none
Installing rEFInd on OS X....
Installing rEFInd to the partition mounted at /Volumes/ESP

**** ALERT: SIP ENABLED! ****

rEFInd cannot be installed because System Integrity Protection (SIP) seems
to be enabled! You must install rEFInd from your Recovery installation or
from another OS. To install from the Recovery system:

  1. Reboot
  2. Hold down Command+R as the chime sounds
  3. When the OS has booted, select Utilities->Terminal
  4. Change to this directory with the 'cd' command; it will probably be under
     /Volumes/Macintosh HD/Users/ericnoel/refind-bin-0.11.2
  5. Re-run this script.

If you believe SIP is NOT enabled, you may attempt an installation anyhow,
but it may fail.

For more on this subject, see http://www.rodsbooks.com/refind/sip.html

Do you want to attempt installation (Y/N)? y
Copied rEFInd binary files

Copying sample configuration file as refind.conf; edit this file to configure
rEFInd.

Could not set boot device property: 0xe00002bc


# If alerted with SIP, then try disabling SIP

# Reboot computer
# At startup chime, hold down Command+R key combination. The computer should turn into Recovery mode.
# Access Utilities->Terminal from the macOS Recovery window menu bar. 

# From Terminal consolel. Disable SIP
# csrutil disable

# Restart computer

# Change directory to the extracted rEFInd folder

# Install rEFInd
$ sudo ./refind-install
ShimSource is none
Installing rEFInd on OS X....
Installing rEFInd to the partition mounted at /Volumes/ESP
Found rEFInd installation in /Volumes/ESP/EFI/refind; upgrading it.
Copied rEFInd binary files

Notice: Backed up existing icons directory as icons-backup.
Existing refind.conf file found; copying sample file as refind.conf-sample
to avoid overwriting your customizations.


# Reboot to recovery and enable back SIP

# csrutil enable










Sunday, December 17, 2017

[Kubernetes] [minikube] [macOS] [ High Sierra] [VMware Fusion] Error starting host: Temporary Error: Error configuring auth on host: OS type not recognized.

ERROR:

$ minikube start --vm-driver=vmwarefusion
Starting local Kubernetes v1.8.0 cluster...
Starting VM...
E1217 20:38:52.628679     394 start.go:150] Error starting host: Temporary Error: Error configuring auth on host: OS type not recognized.

 Retrying.


FIX:

PRE-REQUISITES:
Check VM Driver
$ cat ~/.minikube/machines/minikube/config.json | grep DriverName
    "DriverName": "vmwarefusion",


Check ISO version:
$ cat ~/.minikube/machines/minikube/config.json | grep -i ISO
        "ISO": "/Users/ericnoel/.minikube/machines/minikube/boot2docker.iso",
        "Boot2DockerURL": "file:///Users/ericnoel/.minikube/cache/iso/minikube-v0.23.6.iso",
        "ConfigDriveISO": "",




Get password:
$ cat ~/.minikube/machines/minikube/config.json|grep -i pass
        "SSHPassword": "tcuser",


Copy
$ ssh-copy-id -i ~/.minikube/machines/minikube/id_rsa.pub docker@$(minikube ip)
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/spikes/.minikube/machines/minikube/id_rsa.pub"
The authenticity of host 'x.x.x.x (x.x.x.x)' can't be established.
ECDSA key fingerprint is SHA256:Df4JLDF3w7eBVj8Kw7XOXSXHjlWqXQI1fDLHtp12Nq3.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
docker@x.x.x.x's password:

Number of key(s) added:        1

Now try logging into the machine, with:   "ssh 'docker@x.x.x.x'"
and check to make sure that only the key(s) you wanted were added.


Start minikube
$ minikube start --vm-driver=vmwarefusion
Starting local Kubernetes v1.8.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Downloading localkube binary
 148.25 MB / 148.25 MB [============================================] 100.00% 0s
 65 B / 65 B [======================================================] 100.00% 0s
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.


 

Wednesday, September 27, 2017

No audio on headphone / earphone right channel when plugged into Macbook

1. Plug earphone / headphone in Macbook / Macbook Pro headphone jack.

2. Open Settings

3. Select the Sounds option


4. Slide Balance to Center.

Wednesday, March 1, 2017

[ ok ] Setting up ALSA...warning: 'alsactl restore' failed with error message 'alsactl: load_state:1686: No soundcards found...'...done.

# Edit configuration file read by the early-stage boot firmware
sudo vi /boot/config.txt

# Add entry and save
dtparam=audio=on

# Reboot
sudo reboot