Showing posts with label 2MinutesHowTo. Show all posts
Showing posts with label 2MinutesHowTo. Show all posts

End of Line Matters for Shell Script in CICD Pipeline

End of Line Matters for Shell Script in CICD Pipeline

You may get an error or failed pipeline if the end of line of a shell script file is CRLF (\r\n) not LF (\n) 

LF

CRLF


In VS Code, you may convert the End of Line from CRLF to LF. Or you may change the default setting



Know How to Use the chmod Command on Linux in Two Minutes

Know How to Use the chmod Command on Linux in Two Minutes

  1. Understand permissions
    1. how to check ($ls -l)
    2. file (-)
    3. dir (d)
    4. read (r)
    5. write (w)
    6. execute (x)
  2. User types
    1. user (u)/group (g)/other (o)
  3. Understand operations
    1. + (add)
    2. - (remove)
    3. = (set equal)
  4. Numerical shorthand
    • The digits you can use and what they represent are listed here:
        • 0: (000) No permission.
        • 1: (001) Execute permission.
          2: (010) Write permission.
          3: (011) Write and execute permissions.
          4: (100) Read permission.
          5: (101) Read and execute permissions.
          6: (110) Read and write permissions.
          7: (111) Read, write, and execute permissions.
    1. Recursive (-R)
        • If we had wanted to include files in subdirectories, we could have used the -R (recursive) option.
    2. Examples
        • $ls -l






        • $chmod 777 chmod_test.txt


        • $chmod u-x chmod_test.txt

      How to Change Your Hostname on WSL Ubuntu in Less Than 2 Minutes

      How to change your hostname on wsl ubuntu

      • Note down your hostname
      • Open /etc/wsl.conf or create the same if it does not exist ($vi wsl.conf)
      • Add the following lines in /etc/wsl.conf

      [network]
      hostname = yourHostname
      generateHosts = false

      • Open /etc/hosts and update
      Find all occurences of hostname (e.g. "DESKTOP-ABC222") and replace with the new one (e.g. "yourHostname").

      • Close Ubuntu and re-launch
      You could open Windows Terminal or Windows PowerShell run wsl --shutdown to shut down the WSL 2 VM and relaunch it.

      check it with $echo "$HOSTNAME"




      if you need some help with the UNIX commands, please refer to this page https://aufullstackde.blogspot.com/2023/05/basic-unix-commands.html

      Enjoy!

      Featured Posts

      SnowPro Badges and Certificates

      SnowPro Badges and Certificates Online Verification https://achieve.snowflake.com/profile/richardhou888/wallet

      Popular Posts Recommended