Thursday, July 15, 2021

Redhat Service : VSTS Agent Service :EAP Service : Azure Agent Service : Configure as a service

 https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html/installation_guide/configuring_jboss_eap_to_run_as_a_service

sudo cp EAP_HOME/bin/init.d/jboss-eap.conf /etc/default

sudo cp EAP_HOME/bin/init.d/jboss-eap-rhel.sh /etc/init.d

sudo chmod +x /etc/init.d/jboss-eap-rhel.sh

sudo chkconfig --add jboss-eap-rhel.sh

sudo service jboss-eap-rhel start

------------------------------------------------------------------------------------------------------

https://www.geeksforgeeks.org/setuid-setgid-and-sticky-bits-in-linux-file-permissions/

------------------------------------------------------------------------------------------------------

https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops

sudo ./svc.sh install [username]

sudo ./svc.sh status

sudo ./svc.sh start

sudo ./svc.sh stop

du vs df

https://stackoverflow.com/questions/10103604/linux-command-line-du-how-to-make-it-show-only-total-for-each-directories/10103709#10103709

du -cksh *


df -h

What does 'total' mean in "ls" command output ?

What does 'total' mean in "ls" command output ?

https://lists.fedoraproject.org/pipermail/users/2006-November/317250.html

> ls -la

> total 8

> drwxr-xr-x 2 fajar users 4096 2006-11-06 11:12 .

> drwxr-xr-x 3 fajar users 4096 2006-11-06 11:12 ..

> What 'total 8' stands for?

> Thank you very much.


That is the total number of file system blocks, including indirect

blocks, used by the listed files. 

How to see Sizes in MB/GB for Linux 'ls' command

https://net2.com/how-to-display-files-sizes-in-mb-in-linux-ubuntu/

Want to read Size in MB/GB for ls ?

ls -lh

Difference between "ls -1" and "ls -l" ?

 Difference between  "ls -1" and "ls -l" ?

ls -1
ls -l

AWS : EC2 Key Pairs : How to connect if I lose my Private Key : Replace Your SSH Keys: Login : AWS Key Lost


https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html


A key pair, consisting of a public key and a private key, is a set of security credentials that you use to prove your identity when connecting to an EC2 instance. Amazon EC2 stores the public key on your instance, and you store the private key. 


Create a key pair using Amazon EC2

Create a key pair using a third-party tool and import the public key to Amazon EC2

Tag a public key

Retrieve the public key from the private key

Retrieve the public key through instance metadata

Locate the public key on an instance

Identify the key pair that was specified at launch

Verify your key pair's fingerprint

Add or replace a key pair for your instance

Delete your key pair

Delete a public key from an instance


--------------------------------------------------------------------------------------------------------

::Connect to your Linux instance if you lose your private key::

Lost Private key --> Detach from orig- Attach to Temp - Modify authorized_keys - Detach from Temp - Attach Again to orig


https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/replacing-lost-key-pair.html


Step 1: Create a new key pair

Step 2: Get information about the original instance and its root volume

Step 3: Stop the original instance

Step 4: Launch a temporary instance

Step 5: Detach the root volume from the original instance and attach it to the temporary instance

Step 6: Add the new public key to authorized_keys on the original volume mounted to the temporary instance

Step 7: Unmount and detach the original volume from the temporary instance, and reattach it to the original instance

Step 8: Connect to the original instance using the new key pair

Step 9: Clean up

--------------------------------------------------------------------------------------------------------

To add or replace a key pair


Connect to Instance using old mechanism=>  Public Keys => add new Key => authorized-keys


https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#replacing-key-pair


Linux Variables: Shell Variables: Local Variables : Environment Variables

 https://www.tutorialspoint.com/unix/unix-using-variables.htm

https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-set-environment-variables-in-linux/

export NAME=VALUE

export JAVA_HOME=/opt/openjdk11


unset VARIABLE_NAME

unset JAVA_HOME


::Listing All Set Environment Variables::

set


variable_name=variable_value

NAME="John Doe"

echo $NAME


readonly NAME


export NAME


Linux Variable Types

When a shell is running, three main types of variables are present −

Local Variables

Environment Variables 

Shell Variables 

Azure - Pipeline - Add Approver for Stage

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