Friday, July 28, 2023

How to set up ssh to login remote host

 ssh config file facilitates remote access.  In a config file you can specify an alias for the host, identify its IP address, identify the userid you are logging in with, and most importantly indicate and identity file that will save you from entering/remembering your password each time you want to ssh to the host.

  •  create a public/private key for the host

On your machine run 

  >ssh-keygen

Enter the file to which to save the key.  Usually I create/save all my ssh id files in my home directory under directory called .ssh

The dot preceding ssh makes the directory hidden.  You can see the hidden files and directories by passing -a option to the ls command.

   >ls -a

  • copy the ssh public file to the host

   >ssh-copy-id -i ~/.ssh/my-host-key user@host

  • create and populate the config file

  >vi ~/.ssh/config

  Host my-host

    HostName IP-Address

    User    JoeDoe

    IdentityFile ~/.ssh/my-host-key


  •  remote login using ssh

  >ssh my-host


  You don't need to pass user@host  <<HostName and User entries of config file>> 

  You don't need to pass password        <<IdentityFile entry of config file>> to ssh


Any questions and/or problems setting this up, you can let me know in the comments.


Later


Friday, April 22, 2022

Toastmasters Icebreaker speech: title?

The first time I gave an ice breaker speech was a long time ago.  


Our toastmasters club had a theme for each meeting, and on that day the theme was "Backwards toastmasters meeting"


My speech title was "I am an extraordinary person living an ordinary life".


When I announced the speech title, I sensed my audience judging me as an "arrogant" person.  I often make snap judgements about people and their social status, and life too.  I could relate.  


But, I had a plan.  I took a deep breath and started.


I had taken advantage of our toastmaster theme meeting, and structured my speech backwards.  So extraordinary were my life stances and I was the ordinary one.  


I am an ordinary person living an extraordinary life.   I am so grateful for what I have in life.


Life happened.  I stopped going to Toastmasters.  I became pregnant, went on maternity, and changed jobs.  


After a couple of years at my new place of employment, I found out there's a corporate Toastmasters Club.  I was so happy and happier when my manager was supportive of me joining the club, and happiest when I found out my second line manager was a club member.  Oh all the opportunities I could embarrass myself in front of my managers!  


I have a self defeating sense of humour.


It's a deja vu moment for me to be standing here, and giving another ice breaker speech.  Feeling all your energy through miles, cuz I am in Canada, and you are not.  It seems, and I am saying this based on my experience of two Toastmasters club, the common denominator here is positive energy. 


so my fellow toastmasters, I can't wait to start this new journey with you.  In this one I plan on identifying my sense of humour and incorporating it in the words I choose to deliver the messages.

   

Back to you!

Notes to self:  need an example to for self-defeating sense of humour.  

Thursday, April 07, 2022

Impromptu speech

 Mark Twain hit the proverbial nail on the head when he said, “It usually takes me more than three weeks to prepare a good impromptu speech.” 

I relate to this!


Today's topic: Explain Covid19 Pandemic to a five years old.

What I said:

Literally telling the story of explaining to our child about Covid19.  The only high point in the speech was using the word of the day, commiserate.

What I came up with later:

How do you explain COVID-19 pandemic to a child, without freaking her out of day to day things: like opening a door, pushing an elevator button, playing in the park, meeting up with friends.  

First approach: don't explain and hope it will go away soon.  That doesn't work.  Why?  Because the damn thing doesn't go away!

Second approach: google, Facebook, twitter: how other parents are telling their kids.  

Third approach: channel out the fear of unknown and calmly say, hey kiddo for a while we just need to stay low, keep to ourselves and find new ways to learn, and play.  It's gonna be fun, because we haven't done it before.

Friday, February 18, 2022

python2 virtual environment

The pip installer for python 2.7 can be found here: 

curl -O https://bootstrap.pypa.io/pip/2.7/get-pip.py

Verify that the pip2 is installed by looking for it in

$HOME/Library/Python/2.7/bin


To setup the virtual environment in Python2, use virtualenv  


Library/Python/2.7/bin/virtualenv -p $(which python2.7) venv


Activate the virtual environment


source /venv/bin/actiave


Install packages in the virtual environment


python -m pip install lxml jinja2


To exit the virtual environment 


deactivate


If you don't have virtualenv you can install using pip


python -m pip virtualenv --user

Tuesday, February 01, 2022

Installing openJDK on macOS

 If you don't have a java version requirement, and/or you want the latest version of openJDK, you can simply issue the following at the command line.


brew install openjdk 


On January 28, 2022 the latest version available was 17.  

I had a tool that required openJDK 15.  I was getting this error:

class com.oopsconsultancy.xmltask.jdk15.XPathAnalyser15 (in unnamed module @0x5c86dbc5) cannot access class com.sun.org.apache.xpath.internal.XPathAPI (in module java.xml) because module java.xml does not export com.sun.org.apache.xpath.internal to unnamed module @0x5c86dbc5


    at com.oopsconsultancy.xmltask.jdk15.XPathAnalyser15.analyse(XPathAnalyser15.java:28)....

Version 15 has been archived so, I downloaded it from the idk archive https://jdk.java.net/archive/.  

#I decompressed with the tar command:

tar -xvf openjdk-15_osx-x64_bin.tar

# Installed the JDK 

 sudo mv jdk-15.0.1.jdk /Library/Java/JavaVirtualMachines/

#Verified

/usr/libexec/java_home -V

Matching Java Virtual Machines (1):

    15 (x86_64) "Oracle Corporation" - "OpenJDK 15" /Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home

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

#Made it the default version

export JAVA_HOME=`/usr/libexec/java_home -v 15`


Voila!

Monday, November 29, 2021

Adding disk space to Linux VM in Parallels Desktop

 This is a two step project:


Step 1:  Get the storage

Step 2: Allocate it/make it known to the Linux VM


Step 1: 

Shut down the Linux VM

Use information here to assign more storage to the Linux VM

https://www.parallels.com/blogs/resize-your-parallels-desktop-vm/


Step 2:

Use gparted to add the additional storage to the Linux VM partition

Download the amd64 gparted from here https://gparted.org/download.php

Change the boot order to boot from CD/DVD

Set the DVD to point to the location of the iso file.




Tuesday, November 16, 2021

gnutools-gcc: dump switch

 #gcc #debugging 

details appended to fdump-rtl-pass generates messages during RTL transformations for the pass
for example:
-fdump-rtl-expand-details
produces gimple inline with its matching RTL, as well as messages on optimizations happening during expand pass.
output:

;; Generating RTL for gimple basic block 2


;; moveTo_state = 0;


(insn 10 9 0 (set (mem/c:SI (symbol_ref:SI ("|bss|moveTo_state") [flags 0x6] <var_decl 0x10382c630 moveTo_state>) [1 moveTo_state+0 S4 A32])

(const_int 0 [0])) "../library/PcCut/pccut.c":287 -1

(nil))

if some optimization doesn't react to adding details check if the pass uses TDF_DETAILS 
TDF_DETAILS is implemented in dumpfile.c


gnutools: learning resources

I have been working on GNU toolchain for about two years now.  I have worked on target ports, code upgrades, feature development and bug fixes in a target backend.

GCC has an internal document, gccint, but much of it is kept very high level.  

Developers can learn through seeing the results of an optimization, to assist a list of optimization switches and their description is provided, GCC developer-options.

In this space I intend to expand on these resources.

The information here is to augment the already in place resources highlighter above.