Page tree
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

Cloning private repos in GIT when using Github PAT or 2FA

# If you are using a PAT or 2FA on GitHub - use a credential manager - it may need to be configured
# windows
git config --global credential.helper wincred

# this is a new M1 mac mini - one that has not cloned a private repo yet
# try to clone any private repo
% git clone https://github.com/obrienlabs/uipath         
Cloning into 'uipath'...
Username for 'https://github.com': obriensystems
Password for 'https://obriensystems@github.com': 
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/obrienlabs/uipath/'
% git config --global user.name "Michael O'Brien"
% git config --global user.email "micahel@obrienlabs.org"
% git config --global credential.helper osxkeychain
# on windows credential manager is already off system - on a new Mac install it below
% brew tap microsoft/git
% brew install --cask git-credential-manager-core
# select PAT login, then login password of your Mac
% git clone https://github.com/obrienlabs/uipath
Cloning into 'uipath'...
Receiving objects: 100% (230/230), 84.36 KiB | 1.79 MiB/s, done.
Resolving deltas: 100% (172/172), done.

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

Install the regular Intel deb file for now for M1 Macs (use Rosetta2 for now) until the ARM library is finished
add path to .zprofile or .bash_profile

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home

ssh
git
python
pip
Maven

download from https://maven.apache.org/download.cgi

# install homebrew first
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
wget https://dlcdn.apache.org/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz
tar -xzvf apache-maven-3.8.4-bin.tar.gz
sudo chown -R root:wheel ~/opt/apache-maven-3.8.4
vi ~/.bash_profile
add
export M2_HOME=/Users/michaelobrien/opt/apache-maven-3.8.4
export PATH=$PATH:$M2_HOME/bin
below libjansi problem is only for JDK 1.8 - use 11 or 17


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

/opt/mvn/lib/jansi-native/osx

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

Install the SSM CLI in addition

http://docs.aws.amazon.com/console/systems-manager/session-manager-plugin-not-found

https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html

curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/mac/sessionmanager-bundle.zip" -o "sessionmanager-bundle.zip"
unzip sessionmanager-bundle.zip
sudo ./sessionmanager-bundle/install -i /usr/local/sessionmanagerplugin -b /usr/local/bin/session-manager-plugin



homebrew

after install do

PATH=/opt/homebrew/bin:${PATH}

jq (json query)

brew install jq

install brew first

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


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
yq (yaml query)

https://mikefarah.gitbook.io/yq/

brew install yq

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 $ /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


sample eclipse springsource tool suite 44 ini content

-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.2.100.v20210209-1541
-product
org.springframework.boot.ide.branding.sts4
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx6144m
--add-modules=ALL-SYSTEM
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Xdock:icon=../Resources/sts4.icns
-javaagent:lombok-1.18.12

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
Xcodeinstall xcode and xcode command line tools first
OpenCL https://developer.apple.com/opencl/
https://developer.apple.com/library/archive/samplecode/OpenCL_NBody_Simulation/Introduction/Intro.html
Google Cloud SDK CLI

https://cloud.google.com/sdk/docs/install-sdk

Will update python from 2.7 to 3.7

cp ~/Downloads/google-cloud-sdk-376.0.0-darwin-arm.tar.gz .

tar -xvf google-cloud-sdk-376.0.0-darwin-arm.tar.gz

michaelobrien@mbp7 opt % cd google-cloud-sdk

michaelobrien@mbp7 google-cloud-sdk % ./install.sh 

│ Not Installed │ App Engine Go Extensions                             │ app-engine-go            │  4.0 MiB │

│ Not Installed │ Appctl                                               │ appctl                   │ 18.5 MiB │

│ Not Installed │ Cloud Bigtable Command Line Tool                     │ cbt                      │  8.1 MiB │

│ Not Installed │ Cloud Bigtable Emulator                              │ bigtable                 │  5.7 MiB │

│ Not Installed │ Cloud Datalab Command Line Tool                      │ datalab                  │  < 1 MiB │

│ Not Installed │ Cloud Datastore Emulator                             │ cloud-datastore-emulator │ 18.4 MiB │

│ Not Installed │ Cloud Firestore Emulator                             │ cloud-firestore-emulator │ 40.5 MiB │

│ Not Installed │ Cloud Pub/Sub Emulator                               │ pubsub-emulator          │ 60.7 MiB │

│ Not Installed │ Cloud SQL Proxy                                      │ cloud_sql_proxy          │  7.3 MiB │

│ Not Installed │ Google Cloud Build Local Builder                     │ cloud-build-local        │  6.2 MiB │

│ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr    │          │

│ Not Installed │ Kustomize                                            │ kustomize                │  7.4 MiB │

│ Not Installed │ Minikube                                             │ minikube                 │ 27.1 MiB │

│ Not Installed │ Nomos CLI                                            │ nomos                    │ 23.6 MiB │

│ Not Installed │ On-Demand Scanning API extraction helper             │ local-extract            │ 12.9 MiB │

│ Not Installed │ Skaffold                                             │ skaffold                 │ 18.3 MiB │

│ Not Installed │ anthos-auth                                          │ anthos-auth              │ 18.0 MiB │

│ Not Installed │ config-connector                                     │ config-connector         │ 49.8 MiB │

│ Not Installed │ gcloud Alpha Commands                                │ alpha                    │  < 1 MiB │

│ Not Installed │ gcloud Beta Commands                                 │ beta                     │  < 1 MiB │

│ Not Installed │ gcloud app Java Extensions                           │ app-engine-java          │ 51.8 MiB │

│ Not Installed │ gcloud app PHP Extensions                            │ app-engine-php           │ 21.9 MiB │

│ Not Installed │ gcloud app Python Extensions                         │ app-engine-python        │  7.8 MiB │

│ Not Installed │ gcloud app Python Extensions (Extra Libraries)       │ app-engine-python-extras │ 26.4 MiB │

│ Not Installed │ kpt                                                  │ kpt                      │ 11.7 MiB │

│ Not Installed │ kubectl                                              │ kubectl                  │  < 1 MiB │

│ Not Installed │ kubectl-oidc                                         │ kubectl-oidc             │ 18.0 MiB │

│ Not Installed │ pkg                                                  │ pkg                      │          │

│ Installed     │ BigQuery Command Line Tool                           │ bq                       │  1.0 MiB │

│ Installed     │ Cloud Storage Command Line Tool                      │ gsutil                   │  8.1 MiB │

│ Installed     │ Google Cloud CLI Core Libraries                      │ core                     │ 22.4 MiB │


https://cloud.google.com/sdk/auth_success

michaelobrien@mbp7 google-cloud-sdk % gcloud auth login account-email

Your browser has been opened to visit:

You are now logged in as [account-email].

Your current project is [None].  You can change this setting by running:

  $ gcloud config set project PROJECT_ID


Windows 10


Tool
Network
Machine
Java

https://www.oracle.com/java/technologies/javase-jdk11-downloads.html

set JAVA_HOME and PATH

$ java -version
java version "11.0.12" 2021-07-20 LTS
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode)

$ echo $JAVA_HOME
c:\opt\jdk110

$ echo $PATH
/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/bin:/c/opt/jdk110/bin:/c/Program Files/Common Files/Oracle/Java/javapath:....
eclipsehttps://spring.io/tools
git

https://git-scm.com/downloads
git will install git bash
load ssh pem keys via

eval $(ssh-agent -s)
ssh-add ~/.ssh/ob**5.pem
ssh/Puttyhttps://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
python
pip
pgadminhttps://www.pgadmin.org/download/
Maven

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

extract out to /opt/mvn

set M2_HOME, MAVEN_HOME and PATH

Gradlehttps://gradle.org/install/#manually
add to eclipse https://www.vogella.com/tutorials/EclipseGradle/article.html
Docker

Install Docker Desktop 4.0.0 - https://www.dropbox.com/install#downloaded
WSL2 version

https://docs.microsoft.com/en-ca/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package

update WSL in powershell

wsl --set-default-version 2

Kubernetes
kubectl
https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/
AWS CLI V2

https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-windows.html

Install the SSM CLI in addition

http://docs.aws.amazon.com/console/systems-manager/session-manager-plugin-not-found

curl https://s3.amazonaws.com/session-manager-downloads/plugin/latest/windows/SessionManagerPluginSetup.exe -o SessionManagerPluginSetup.exe
jq

https://github.com/stedolan/jq/releases

alias jq=/c/opt/jq-win64.exe
source ~/.bash_rc
npm
angular
Eclipse / Springsource

https://spring.io/tools 

 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
IntelliJhttps://www.jetbrains.com/idea/download/#section=windows
Visual Studio Codehttps://code.visualstudio.com/download


Linux - Ubuntu 16.04/18.04/20.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
sudo apt install openjdk-11-jre-headless

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/19.03.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 11, 17 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

Adding an existing project to a new repo - https://docs.github.com/en/github/importing-your-projects-to-github/importing-source-code-to-github/adding-an-existing-project-to-github-using-the-command-line

git config pull.rebase true
git pull origin main
git push origin main


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

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

Git Tag

michaelobrien@mbp7 private % git tag -a 0.1.0 -m "initial"
michaelobrien@mbp7 private % git tag                      
0.1.0
michaelobrien@mbp7 private % git status
On branch main
Your branch is up to date with 'origin/main'.
michaelobrien@mbp7 private % git push origin 0.1.0
Enumerating objects: 1, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 166 bytes | 166.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/obriensystems/private.git
 * [new tag]         0.1.0 -> 0.1.0
michaelobrien@mbp7 private % git tag              
0.1.0


Merging

Pull Requests


Git Permissions problems

warning: unable to access '/Users/user/.config/git/attributes': Permission denied

turn back on permissions - switch .config back from root

id -a
sudo ls -la /Users/user/.config
total 0
drwx------    3 root           staff    96  1 Feb 10:47 .

sudo chown -R user /Users/user/.config


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

Spring Boot Microservice

Solutions

JAVA

Kubernetes

Kubernetes Developer Guide


Python 3

.NET

https://www.c-sharpcorner.com/article/deev-dive-into-c-sharp-9/

Idris

https://www.idris-lang.org/

Links

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

  • No labels