Skip to main content

Posts

Showing posts from July, 2022

Ubuntu Linux useradd vs adduser which is the easier command?

There are two main commands in Ubuntu for creating users. I've found them confusing and I always forget which to use when. So, thought to write them down clearly as a quick reference.

Note to self: Extract TLS certificate from SMTP mail server

Replace the server name and the port. Usually the port will be 25.  openssl s_client -connect <hostname>:<port> -starttls smtp eg:  openssl s_client -connect smtp.office365.com:587 -starttls smtp Copy the output section of the certificate that looks like below. -----BEGIN CERTIFICATE----- ###bunch of encoded text### -----END CERTIFICATE----- You can copy it and save it to a file with ".crt" or ".cert" extension and that's the mail server's certificate. Make sure to include the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines. Note: OpenSSL is required. Ubuntu:  sudo apt install openssl Other OSs:  https://wiki.openssl.org/index.php/Binaries

AWS CodeDeploy events don't start issue

Issue The code deploy events keep hanging in the pending status without starting.  Possible Reasons 1. CodeDeploy agent not installed? Make sure to install the CodeDeploy agent in the EC2 instance (If you are using EC2 instances to deploy the application) Refer to the documentation for the CodeDeploy agent installation . 2. Is the code deploy service role properly created? Make sure to check the proper permissions for the service role that you have used for the code deploy service role.  https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-create-service-role.html 3. Make sure the IAM instance profile is properly created https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-create-iam-instance-profile.html 4. Is the code deploy endpoint command endpoint reachable?  For each region, there is a CodeDeploy command endpoint. Make sure that you can reach the command endpoint from your EC2 instance.  eg: for us-east-1 ping codedeploy.us...

Google cloud (GCP) UI is not loading issue

Issue: If you log in to the Google Cloud console from a secondary Google account (while you have logged into your primary account), it doesn't render the UI properly. Some of the styles are missing and if you look at the browser dev console, there are a bunch of errors. It is to be mentioned that I've selected the correct Google account and the project from the top nav. First I thought this is due to their service down (which would be highly unlikely), but their health page , but everything was fine. With a quick search, I realized that this is a known issue for some more users, and also there's a bug already logged for this. Even though it states fixed, a few more folks seem to have experienced this recently as per this date.  Workaround: Use an incognito window or another browser to log in to the Google Cloud console from your second Google account. When you have logged in with multiple Google accounts, even though you have selected the proper account from the navigation...

How to use WSL Linux commands in Windows CMD and PowerShell

If you're a Linux user and recently move to Windows like me, must be missing the familiar Linux commands in the terminal. WSL comes to help in this case.  Assuming you have already installed WSL in Windows, you can just use the keyword wsl followed by the Linux command that you want to run.                        wsl <command>                                                         eg: If you haven't installed WSL yet, see the post below. Installing WSL Ubuntu 22.04 on Windows 11

Installing WSL Ubuntu 22.04 on Windows 11

  Installing WSL Ubuntu 22.04 on Windows 11 1. Enable Windows Subsystem for Linux and Virtual Machine platform Go to  Control Panel -> Programs -> Programs and Features -> Turn Windows features on or off 2. Switch to WSL 2 Open Powershell and type in the below command. wsl --set-default-version 2 If you don't have WSL 2, download the  latest WSL 2 package  and install it.  3. Install Ubuntu Open Microsoft Store and search for Ubuntu. Select the version you intend to install. I'd use the latest LTS version Ubuntu 22.04. Click on the Get button. It will take a couple of minutes to download and install. 4. Open up the installed Ubuntu version that was installed. If you get an error like the below image, make sure to install the  WSL2 Kernel update .  If it's an older Ubuntu version the error message would be something like the image below. Error: WSL 2 requires an update to its kernel component. Installing the  WSL2  kernel update ...