Showing posts with label PATH. Show all posts
Showing posts with label PATH. Show all posts

Wednesday, June 2, 2021

Linux ENV Setings ---- /etc/profile /etc/bashrc ~/.bashrc ~/.bash_profile

export PATH=$PATH:/usr/local/bin/nodeSetup/

Any Folder Path we put on PATH is scanned for Executables


~/.bash_profile
~/ .bashrc
~/.profile

/etc/sudoers
/etc/yum.conf
/etc/os-release
/etc/hosts
/etc/hosts.allow
/etc/fstab
/etc/shells

/etc/passwd
/etc/group
/etc/shadow

/etc/profile
etc/bashrc      [/etc/profile.d]

/etc/bashrc          # Functions and aliases go in /etc/bashrc
/etc/profile            # System wide environment and startup programs, for login setup + Environment stuff (It sources/executes shell in /etc/profile.d)
/etc/profile.d        # It's much better to create a custom.sh shell script in  /etc/profile.d/ to make custom changes to your environment 

~/.bash_profile    # User specific environment and startup programs    #PATH=$PATH:$HOME/.local/bin:$HOME/bin       #export PATH --- It sources(executes)  ~/.bashrc
~/.bashrc              #Get the aliases and functions                                              

-----------------------------------------------------------------------------
/etc/profile file is used to set system wide environmental variables on users shells. 
/etc/profile is the system wide version of .bash_profile.

/etc/bashrc for Red Hat and /etc/bash.bashrc in Ubuntu is the system wide version of .bashrc.

.bashrc file in your home directory. 
This file is meant for setting command aliases and functions used by bash shell users

.bash_profile or .profile - in  your home directory.
These files are used to set environmental items for a particular user's shell

The difference is simple, 
/etc/profile is executed only for interactive shells 
/etc/bashrc is executed for both interactive and non-interactive shells.
-------------------------------------------------------------------------------


For User specific Stuff, You can put aliases in ~/.bashrc and ~/.bash_profile sources it , but ENV Paths etc should be put in ~/.bash_profile

For Stuff relevant to all , You should put stuff in custom shell inside /etc/profile.d 

https://shreevatsa.files.wordpress.com/2008/03/bashstartupfiles1.png
https://bencane.com/2013/09/16/understanding-a-little-more-about-etcprofile-and-etcbashrc/

The importance of using a login shell is that any settings in /home/user/.bash_profile will get executed.






Sunday, April 18, 2021

Java + HTTPS: Unable to Find Valid Certification Path to Requested Target

https://myshittycode.com/2015/12/17/java-https-unable-to-find-valid-certification-path-to-requested-target-2/

https://www.baeldung.com/java-import-cer-certificate-into-keystore

https://stackoverflow.com/questions/43188589/what-is-the-difference-between-keytool-commands-import-and-importcert/43188724


From this documentation keytool - Key and Certificate Management Tool, the Changes section at the end of the page says :

Renamed commands:

-import, renamed to -importcert


The keytool has many options but the one we're interested in is importcert which is as straightforward as its name. Since there are usually different entries inside a KeyStore, we'll have to use the alias argument to assign it a unique name:

> keytool -importcert -alias baeldung_public_cert -file baeldung.cer -keystore sample_keystore
> Enter keystore password:
...
> Trust this certificate? [no]:  y
> Certificate was added to keystore

Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass