author avatar

vaibhav.yadav

Wed Apr 24 2024

We can check the default value for a given column using postgres query like this:

SELECT column_name, column_default
FROM information_schema.columns
WHERE table_name = '<table_name_placeholder>' AND column_name = '<column_name_placeholder>';

Same can be used for constraints like is_nullable as following:

SELECT column_name, is_nullable
FROM information_schema.columns
WHERE table_name = '<table_name_placeholder>' AND column_name = '<column_name_placeholder>';

#database #postgres #query

author avatar

sagar.ghorse

Mon Apr 22 2024

while integrating sentry with gitlab ip whitelisting needs to be done on gitlab server (self-hosted) #devops #sentry#gitlab

author avatar

soniya.rayabagi

Mon Apr 22 2024

The kubectl cordon NODE_NAME command is used in Kubernetes to mark a node as unschedulable, meaning no new pods will be scheduled onto that node. Existing pods on the node will continue to run unless explicitly terminated or moved. #devops #kubernetes

author avatar

nisanth

Mon Apr 22 2024

Debugging Kubernetes pod on helm helm upgrade unleash-app-toggle . --debug Adding --debug can provide more insight if the error persists, showing exactly what values are being passed to each template. #devops #kubernetes #helm

author avatar

nisanth

Fri Apr 19 2024

Avoid Using Double Quotes for Environment Variables When configuring the PostgreSQL user and database names in a Helm values.yaml file, I initially wrapped the values in double quotes. This led to a frustrating issue where I couldn’t connect to the database, receiving errors that the role did not exist. The double quotes were being interpreted literally, causing mismatches in authentication. Solution: I removed the double quotes around the environment variables in my Helm chart and reapplied the configuration. This corrected the problem, and I was then able to connect successfully to the database. #devops #postgres #env

author avatar

sagar.ghorse

Thu Apr 18 2024

create the redis cluster from existing backup we can use snapshot_name = <name of your backyp > #devops #redis #Terraform

author avatar

nisanth

Wed Apr 17 2024

To find the number of pods that exist in the “dev” environment (env), you can use the kubectl get pods --selector=env=dev #devops #kubernetes

author avatar

sachin.kabadi

Tue Apr 16 2024

#nextJs #TypeScript useEffect is a hook that allows you to perform side effects in function components.

import React, { useState, useEffect } from 'react';

function MyComponent() {
  const [count, setCount] = useState(0);

  // This effect will run only when the count state changes
  useEffect(() => {
    document.title = `You clicked ${count} times`;
  }, [count]); // Only re-runs when count changes

  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>
        Click me
      </button>
    </div>
  );
}

export default MyComponent;

In the above example: • We have a component MyComponent with a state variable count and a button to increment it. • Inside the component, we use the useEffect hook to update the document title with the current count after each render. • We pass [count] as the second argument to useEffect, which means the effect will only run when the count state changes. This is because we want to update the document title only when the count changes, not on every render.

author avatar

sachin.kabadi

Tue Apr 16 2024

#nextJs #TypeScript Function Argument Deconstructing: Deconstructing function arguments can make your code cleaner and more readable.

// Before deconstruction 
const BlogPost = (props) => { 
  const { title, content, author } = props; 
  // Render blog post using props
  return (
      <div>
          <h1>{props.title}</h1>
          <p>{props.content}</p>
          <p>Written by: {props.author}</p>
      </div>
  );
}; 

// After deconstruction 
const BlogPost = ({ title, content, author }) => { 
  // Render blog post with title, content, and author 
  return (
      <div>
          <h1>{title}</h1>
          <p>{content}</p>
          <p>Written by: {author}</p>
      </div>
  );
};

Showing 1 to 5 of 58 results