Wednesday, January 31, 2024

[PM2][WARN] Current process list is not synchronized with saved list.

How to solve: [PM2][WARN] Current process list is not synchronized with saved list.


pm2 update

pm2 startup

pm2 save

Monday, January 29, 2024

get timezone id from display name

 import java.util.TimeZone;


public class TimeZoneExample {

    public static void main(String[] args) {

        // Set the desired time zone display name

        String timeZoneDisplayName = "IST";


        // Get the time zone ID based on the display name

        String timeZoneID = getTimeZoneIDByDisplayName(timeZoneDisplayName);


        if (timeZoneID != null) {

            System.out.println("Time zone ID for " + timeZoneDisplayName + ": " + timeZoneID);

        } else {

            System.out.println("No matching time zone found for display name: " + timeZoneDisplayName);

        }

    }


    private static String getTimeZoneIDByDisplayName(String displayName) {

        String[] availableIDs = TimeZone.getAvailableIDs();

        for (String id : availableIDs) {

            TimeZone timeZone = TimeZone.getTimeZone(id);

            if (displayName.equals(timeZone.getDisplayName())) {

                return id;

            }

        }

        return null; // Return null if no match is found

    }

}


Monday, January 22, 2024

Sunday, January 7, 2024

configure BREW to not delete old versions on upgrade

 set below environment variable

export 

HOMEBREW_NO_INSTALL_CLEANUP=TRUE

JENV - Manage multiple Java environnments

1) install using brew

2) jenv add <JRE location>

3) jenv versions

4)jenv global <version name>


add below to .profile/.zshrc

export PATH="$HOME/.jenv/bin:$PATH"

eval "$(jenv init -)"