Page tree

Michael O'Brien

Skip to end of metadata
Go to start of metadata

TOC

Setting Up

We will be using public projects in one of my repos as an example - https://github.com/obrienlabs/difference-cloud

GIT

If you get a certificate error pulling all of a sudden from github for example because of "SSL certificate problem: self signed certificate in certificate chain" https://confluence.atlassian.com/fishkb/unable-to-clone-git-repository-due-to-self-signed-certificate-376838977.html

However the better method of cloning is via SSL certificate for PAT (Personal Access Token) via https://github.com/settings/tokens

git config --global http.sslVerify false

Maven

https://wiki.onap.org/display/DW/ONAP+Development#ONAPDevelopment-MavenConfiguration

OSX

generate keys - either ssh-add the key or rename it as id_rsa and put it into your ~/.ssh dir

Install the JDK (as dmg) - http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Install homebrew package manager - 

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

python should already be installed. - do a --version check

install pip - sudo easy_install pip

install docker (dmg) - https://docs.docker.com/docker-for-mac/install/#download-docker-for-mac

install maven - apache-maven-3.5.0-bin.tar, create ~/.m2 and place settings.xml there

git comes with Xcode or Homebrew - do a --version check

Tool
Network
shell
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.


switch back from zsh in 10.15 to bash
https://www.theverge.com/2019/6/4/18651872/apple-macos-catalina-zsh-bash-shell-replacement-features
in Terminal preferences | general - replace the default /bin/zsh to /bin/bash - we should be good for 1 more release

Machine
Java
ssh
git
python
pip
Maven

sudo chown -R root:wheel ~/mvn

add to .bash_profile

export M2_HOME=/Users/michaelobrien/opt/mvn

export PATH=$PATH:$M2_HOME/bin

Get rid of the popup or any type of security popup for OSX Catalina for "

“libjansi.jnilib” cannot be opened because the developer cannot be verified.

"

Find the jnilib in your mvn install - right click and select "open with" - use textedit

Then run the mvn build - see the changed popup with an open dialog - open it - then the popup will no longer occur

biometric:2019 michaelobrien$ mvn -version

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

Maven home: /Users/michaelobrien/opt/mvn

Java version: 11.0.5, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home

see MacBook Pro#OSXCatalina10.15Issues

Maven 5 = http://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html

Docker
Kubernetes
kubectl

AWS CLI
homebrew
jq (json query)

brew install jq

example

kubectl get pvc --all-namespaces -o json | jq -j .items[3].metadata.name
datadir-kafka-0
kubectl get pvc --all-namespaces -o jsonpath='{.items[3].metadata.name}'
datadir-kafka-0
npm
angular
Eclipse / Springsource

adjust the ini file (show package contents on the application icon)

https://wiki.eclipse.org/Eclipse.ini#-vm_value:_Mac_OS_X_Example

obrienlabs:_exp michaelobrien$ /usr/libexec/java_home --verbose
Matching Java Virtual Machines (2):
    11.0.4, x86_64:	"Java SE 11.0.4"	/Library/Java/JavaVirtualMachines/jdk-11.0.4.jdk/Contents/Home
    1.8.0_221, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home

Add to .ini
-vm
/Library⁩/Java⁩/⁨JavaVirtualMachines⁩/jdk-11.0.4.jdk⁩/Contents/Home/bin

or just use /usr/bin to use the latest

Verify by running jconsole

IntelliJ

Choose Ultimate edition - for Angular, Typescript, npm, spring support
https://www.jetbrains.com/idea/features/editions_comparison_matrix.html


Visual Studio Code
Xcode
OpenCL https://developer.apple.com/opencl/
https://developer.apple.com/library/archive/samplecode/OpenCL_NBody_Simulation/Introduction/Intro.html


Windows 10


Tool
Network
Machine
Javahttps://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
eclipsehttps://spring.io/tools
git
ssh/Puttyhttps://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
python
pip
Maven
Gradlehttps://gradle.org/install/#manually
add to eclipse https://www.vogella.com/tutorials/EclipseGradle/article.html
DockerInstall Docker Desktop 2.1.0.2
Kubernetes
kubectl

AWS CLI
npm
angular
Eclipse / Springsource

  Swapping out the JVM - make sure the -vm flag has a cr/lf between the value in the ini file

-vm 
c:\jdk180\bin\javaw.exe
IntelliJ
Visual Studio Code


Linux - Ubuntu 16.04/18.04

see Kubernetes Developer Guide#SetupSSHkeyaccess

Tool
Network
Machine

set hostname

sudo hostnamectl set-hostname kub1

and update /etc/hosts


verify known_hosts exists and is writable

sudo chmod 777 ~/.ssh/known_hosts


enable ubuntu desktop


apt-get update
apt-get install ubuntu-desktop


enable static IP

vi /etc/network/interfaces

add


iface enp0s25 inet static
address 192.168.15.101
netmask 255.255.255.0
network 192.168.15.0
broadcast 192.168.15.255
gateway 192.168.15.1
dns-nameservers 8.8.4.4



Enable non CD repositories so an apt-get update will work

comment out the CD first line in /etc/apt/sources.list


enable ssh if skipped during installation so we can remote ssh

sudo apt-get install openssh-server


enable root login and gui (no sudo su -)

sudo passwd root

sudo usermod -U root

sudo reboot now

sudo vi /etc/lightdm/lightdm.conf

[SeatDefaults]

greeter-session=unity-greeter

user-session=ubuntu

greeter-show-manual-login=true


: enable root login

vi /etc/ssh/sshd_config
FROM:
PermitRootLogin prohibit-password
TO:
PermitRootLogin yes

and disable passwords (use ssh) - uncomment and switch from yes to no

PasswordAuthenticationno


systemctl restart sshd

disable strict host checking (client and server)

in ~/.ssh/config
Host *
   StrictHostKeyChecking no
   UserKnownHostsFile=/dev/null



Java
if not

sudo apt install openjdk-8-jdk


set JAVA_HOME in ~/.bashrc or /etc/environment

ubuntu@ubuntu:~$ echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-amd64

ssh
gitsudo apt-get install git
python
pip
Maven

download and install Maven 3.5.0

create an ~/.m2 folder and copy our settings.xml there

add maven to your path - check it with mvn --version


http://maven.apache.org/download.cgi

tar -xvf apache-maven-3.5.0-bin.tar.gz

or

sudo apt install maven


Add the following option to your MAVEN_OPTS in order not to periodically hang on downloading artifacts in linux

in /etc/environment

-Djava.net.preferIPv4Stack=true

Dockercurl https://releases.rancher.com/install-docker/18.06.sh | sh
Kubernetes
kubectl

AWS CLI
npmsudo apt install npm
angular
Eclipse / Springsource
IntelliJ
Visual Studio Code


Linux - RHEL 8.0

ami-04a2d6660f1296314


Tool
Network
Machine
Java

set JAVA_HOME in ~/.bashrc

yum install java-1.8.0-openjdk-devel

get it via alternatives --config javac

currently

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64

ssh
git
yum install git
yum groupinstall 'Development Tools'

this will give you make and python

python
pip
Maven

download and install Maven 3.5.0

create an ~/.m2 folder and copy our settings.xml there

add maven to your path - check it with mvn --version

http://maven.apache.org/download.cgi

tar -xvf apache-maven-3.5.0-bin.tar.gz

Add the following option to your MAVEN_OPTS in order not to periodically hang on downloading artifacts in linux

-Djava.net.preferIPv4Stack=true


enable IP4 forwarding to enable the RHEL VM to act as an edge router - without this docker containers cannot communicate

add to /etc/sysctl.conf

net.ipv4.ip_forward = 1

Docker

sudo curl https://releases.rancher.com/install-docker/18.06.sh | sh

sudo wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -O jq

sudo chmod 777 jq

# not +x or jq will not be runnable from your non-root user

sudo mv jq /usr/local/bin

jq --version

sudo usermod -aG docker ubuntu

Kubernetes
kubectl

AWS CLI
npm
angular
Eclipse / Springsource
IntelliJ
Visual Studio Code

Install EclEmma for code coverage, and SonarLint for static code analysis.

Proxies

If you are behind a firewall remember to also set the proxy variables for command line usage - or else pulls from commands like the aws cli, terraform, npm, mvn and java network calls etc.... will timeout

# windows in Control Panel | user env variables (search)
http_proxy=http://server:port
https_proxy=https://server:port

NPM access to Nexus3/Artifactory in the firewall needs no Proxy

Make sure to disable the proxy above when running npm install -g

Developer Tools

Docker

Linux

curl https://releases.rancher.com/install-docker/19.03.sh | sh

via https://github.com/obrienlabs/infrastructure/blob/master/scripts/rke_setup.sh

Windows

https://docs.docker.com/docker-for-windows/install/ 

2.1.0.1 is latest for 20190808 on top of Docker 19.03.1 and kubernetes 1.14.3 support

https://docs.docker.com/docker-for-windows/release-notes/

Postman


Java

If you are installing mixed java versions like 12 and 8 - make sure that your 8 is higher in the env variable PATH and that JAVA_HOME is set.

https://www.oracle.com/technetwork/java/javase/downloads/index.html#JDK8

OSX

WIN

PS C:\> java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
PS C:\> setx -m JAVA_HOME "c:\jdk1.8.0"

Maven

PS C:\Windows\system32> mvn -version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T14:33:14-04:00)
Maven home: C:\opt\mvn354\bin\..
Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: c:\jdk1.8.0\jre


Node.js

https://nodejs.org/en/download/

michaelobrien@biometrics MINGW64 ~
$ node -v
v10.16.0
michaelobrien@biometrics MINGW64 ~
$ npm -v
6.9.0



ssh

Verify that host checking is off for Linux and OSX - for when IPs change under domain names

~/.ssh/config
host *
   StrictHostKeyChecking no
   UserKnownHostsFile=/dev/null


Git

Get git via an XCode install on OSX.

Github

New Projects

create project https://github.com/obrienlabs/difference-cloud

ssh-add your ssh key

setup/verify gitconfig

Clone repo

git clone git@github.com:obrienlabs/difference-cloud.git
git add README.md
git commit -m "#1 verify cli config 2"
git push --set-upstream origin refs/heads/master:refs/heads/master orgit push origin master

or
git push origin master

Cloning

Problems Cloning in Git

Usually on windows - check your username access - that the ~/.ssh/config file is setup correctly by running

ssh github.com git-receive-pack obrienlabs/difference-cloud.git
# bad - check pageant
obriensystems@github.com: Permission denied (publickey).
# good

Rebase

# switch to parent branch
git checkout master
git pull master
# switch back to private branch
git checkout private-branch
git rebase private-branch


Merging

Pull Requests



iOS

018-10-22 23:15:30.012492-0400 Biometric[567:124865] This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain both “NSLocationAlwaysAndWhenInUseUsageDescription” and “NSLocationWhenInUseUsageDescription” keys with string values explaining to the user how the app uses this data

2018-10-22 13:54:12.675114-0400 Biometric[48718:15691662] data: 105: OK:s00000000000:Record(null,20181022,0,3248040,null,null,

[[url	__NSCFString *	@"http://biometric.elasticbeanstalk.com/FrontController?action=setGps&u=20181022&de=iph5se&pr=12.000000&hr2=67&lg=-74.006463<=40.717190&al=0-1.000000&ac=11.993258&be=34&s=-1.000000&grx=0.000000&gry=0.000000&grz=0.000000&arx=-0.023102&ary=-0.009979&arz=-0.995789&lax=-0.023102&lay=-0.009979&laz=-0.995789&rvx=-0.003205&rvy=-0.009610&rvz=-0.010704&ts=1540230990844&mfx=-17.299030&mfy=14.502289&mfz=-28.233032&up=25"	0x0000000282e1dbc0]]



Frameworks

Spring

Spring Boot

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.1-Release-Notes

Solutions

JAVA

Kubernetes

Kubernetes Developer Guide


Python 3


Links

https://eclipsejpa.blogspot.com/2014/07/ldd-living-developer-dream.html

  • No labels