Wednesday, June 30, 2021

Linux: Checksum :sha256

https://www.baeldung.com/linux/sha-256-from-command-line

Azure:Devops Stakeholder:Basic Access

https://stackoverflow.com/questions/48863308/in-vsts-how-to-move-access-level-from-stakeholder-to-basic-access


Supported access levels

Assign users or groups of users to one of the following access levels:

  • Stakeholder: Provides partial access, can be assigned to unlimited users for free. Assign to users with no license or subscriptions who need access to a limited set of features.
  • Basic: Provides access to most features. Assign to users with a Visual Studio Professional subscription, an Azure DevOps Server CAL, and to users for whom you're paying for Basic access in an organization.
  • Basic + Test Plans: Provides access to all features included in Basic, as well as Azure Test Plans. Assign to users with a Visual Studio Test Professional or MSDN Platforms subscription, and to users for whom you're paying for Basic + Test Plans access in an organization.
  • Visual Studio subscription: Assign to users who already have a Visual Studio subscription. The system automatically recognizes the user's subscription—Visual Studio Enterprise, Visual Studio Professional, Visual Studio Test Professional, or MSDN Platform—and enables any other features that are included in their subscription level. If you assign Basic or Stakeholder, they also receive their Visual Studio subscription benefits upon sign-in.

Tuesday, June 29, 2021

Linux: Unlock User

https://www.2daygeek.com/lock-unlock-disable-enable-user-account-linux/

id <username>

passwd --status <username>


passwd -u <username>

usermod --unlock <username>

AWS : Mount EFS on EC2 - Part II - V Important

 sudo mkdir -p /efs

sudo chmod -R ugo+rwx /efs     

ls -ld /efs 

sudo vi /etc/fstab


fs-face524e.efs.us-east-1.amazonaws.com:/ /efs nfs4 rw,intr,hard,_netdev,nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport


sudo mount -a

sudo reboot now


chmod -R 777 /efs  is not safer

chmod -R ugo+rwx /efs is safer - Does not override SETUID AND SETGID BITS - Just Appends permissions

https://unix.stackexchange.com/questions/296675/is-chmod-r-ugorwx-safer-than-chmod-r-777


cd / && sudo umount /efs && sudo mv /efs /fileshare && sudo chmod ugo+w /fileshare  && cat /etc/fstab 

sudo sed  -i 's+/efs+/fileshare+g' /etc/fstab 

sudo mount -a && sudo reboot now

ls -l /fileshare 

df -h


ls -l /fileshare ; df -h

ls -l /fileshare && df -h


umount /efs 

sudo mv /efs /fileshare

sudo chmod ugo+w /fileshare

sudo vi /etc/fstab

sudo reboot now


https://www.cyberciti.biz/faq/how-to-use-sed-to-find-and-replace-text-in-files-in-linux-unix-shell/


sudo sed   's/efs/fileshare/g' /etc/fstab   //Replace content and its temporary

sudo sed   's+/efs+/fileshare+g' /etc/fstab  // Change Delimiter

sudo sed  -i 's+/efs+/fileshare+g' /etc/fstab //-i save changes to file/stream

sudo sed  -e '/fs-face524e/s/fileshare/helloooo/' /etc/fstab //Replace only if lines contain specific string "fs-face524e"

How to replace a string in file in Linux

https://www.cyberciti.biz/faq/how-to-use-sed-to-find-and-replace-text-in-files-in-linux-unix-shell/

sudo sed   's/efs/fileshare/g' /etc/fstab   //Replace content and its temporary

sudo sed   's+/efs+/fileshare+g' /etc/fstab  // Change Delimiter

sudo sed  -i 's+/efs+/fileshare+g' /etc/fstab //-i save changes to file/stream

sudo sed  -e '/fs-face524e/s/fileshare/helloooo/' /etc/fstab //Replace only if lines contain specific string "fs-face524e"

Friday, June 25, 2021

Sort PS output

https://serverfault.com/questions/27887/how-to-sort-ps-output-by-process-start-time/27900


ps -ef --sort=start_time

Azure Agent - Configure As a Service Linux or Standalone or Nohup &

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


#Configure it as a linux process and using nohup &

./run.sh 

ps -ef --sort=start_time |grep -E 'Agent|run.sh'

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

#Configure Listener as a service in Linux, It actually, starts 3 Services 

sudo ./svc.sh install    #Creates a symlink under /etc/systemctl/system

sudo ./svc.sh start

sudo ./svc.sh status

sudo ./svc.sh uninstall  #Uninstall Service(SystemD) ,You should stop before you uninstall.

ps -ef --sort=start_time |grep -E 'Agent|runsvc'


ps -ef --sort=start_time |grep -E 'vsts|Agent|run.sh'

sudo systemctl is-active 'vsts.agent.GenpactDigitalEngineering.eks\x2ddev.dev.service'

sudo systemctl is-enabled 'vsts.agent.GenpactDigitalEngineering.eks\x2ddev.dev.service'

sudo systemctl status 'vsts.agent.GenpactDigitalEngineering.eks\x2ddev.dev.service'


#Configure Listener as a service in Linux, It actually, starts 3 Services 

Loaded: loaded (/etc/systemd/system/vsts.agent.GenpactDigitalEngineering.eks\x2ddev.dev.service; enabled; vendor preset: enabled)

   Active: active (running) since Sat 2021-06-26 04:12:27 UTC; 17min ago

 Main PID: 27333 (runsvc.sh)

    Tasks: 21 (limit: 4915)

   CGroup: /system.slice/vsts.agent.GenpactDigitalEngineering.eks\x2ddev.dev.service

           ├─27333 /bin/bash /home/eks/agent/runsvc.sh

           ├─27336 ./externals/node/bin/node ./bin/AgentService.js

           └─27356 /home/eks/agent/bin/Agent.Listener run --startuptype service


Remove and re-configure an agent (Not Service) The Whole Agent

To remove the agent:

1) Stop and uninstall the service as explained above.

2) Remove the agent.            [As it appears in Agent Pool]

./config.sh remove  [Enter your credentials.]


After you've removed the agent, you can configure it again.

Azure - Pipeline - Add Approver for Stage

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