Monday, September 20, 2021

Github and SSH

ssh-keygen -t ed25519 -f github.com

ssh-add ~/.ssh/github.com

# save the keys to the cloud or somewhere where you will not lose them


#Now make an ssh config file

# https://gist.github.com/rbialek/1012262
nano ~/.ssh/config

#Mac 
Host github.com
User git
        Hostname github.com
        PreferredAuthentications publickey
        IdentityFile /home/user/.ssh/github.com

# Ubuntu
Host github.com
User git
        Hostname github.com
        IdentityFile /home/<user>/.ssh/github.com

https://garywoodfine.com/use-pbcopy-on-ubuntu/

sudo apt-get install xclip -y

nano ~/.bashrc

# insert at the end of the .bashrc file

alias pbcopy='xclip -selection clipboard'

alias pbpaste='xclip -selection clipboard -o'

eval "$(ssh-agent -s)"

# save the file

source ~/.bashrc

# copy the public key to GitHub
# Mac
pbcopy < ~/.ssh/github.com.pub

https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh
# Adding a new SSH key to your GitHub account
# To configure your GitHub account to use your new (or existing) # SSH key, you'll also need to add it to your GitHub account.

eval "$(ssh-agent -s)"






# Now check the ssh connection

ssh git@github.com

# Setup two factor authentication

https://docs.github.com/en/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication

Put an encryption key on Lastpass or some other password service

Use the key to encrypt the keys and recovery codes and move them to a Google Drive folder



Friday, September 3, 2021

Install Java and Scala on the Mac M1



https://stackoverflow.com/questions/66464412/install-scala-to-apple-silicon

https://sdkman.io


https://stackoverflow.com/questions/64788005/java-jdk-for-apple-m1-chip

You can install Java JDK using sdkman (see sdkman install):


vim .sdkman/etc/config

set sdkman_rosetta2_compatbile=false


###### Instal packages

sdk install java 8.0.302-zulusdk install 
sbt sbt compile
sdk install spark

sdk current 
Using:
java: 8.0.302-zulu
sbt: 1.5.5
scala: 2.13.6
spark: 3.1.2

https://springframework.guru/using-sdkman-to-manage-java-versions/

###### Test Spark
~/.sdkman/candidates/spark/3.1.2/bin/run-example SparkPi 10