author avatar

ayushsrivastava

Mon Jun 17 2024

Password recovery command for Influxdb when running in local as the UI does not provide any other way to set a new password if you have forgotten

influxd recovery user update \
  --username example-username \
  --password ExAmPL3-paS5W0rD

#influxdb

author avatar

ayushsrivastava

Mon Jun 17 2024

Uninstall / remove a Homebrew package including all its dependencies

brew tap ggpeti/rmrec
brew rmrec pkgname

#homebrew

author avatar

nisanth

Tue Jun 11 2024

Terminating a AWS EC2 Instance #devops #aws

If the Instance is no longer in use and has been stopped, it is necessary to proceed with terminate the Instance. This step ensures that we free up resources, reduce potential security risks, and maintain a clean and efficient infrastructure.

Checklist:

  1. Take a Snapshot of the EBS Volume: ◦ It is best practice to take a snapshot of the EBS volume as a backup before decommissioning the service.
  2. Verify Terraform Management: ◦ Check if the service is managed by Terraform.
  3. Terminate the Instance
author avatar

nisanth

Mon Jun 10 2024

Restarting a DaemonSet in Kubernetes #devops #kubernetes

To find a DaemonSet in a specific namespace:

kubectl get ds -n <namespace>

To restart the DaemonSet:

kubectl rollout restart ds <name-of-the-daemon-set> -n <namespace>
author avatar

sujay

Mon Jun 03 2024

Log shipping is a process used in database management to automate the backup and restoration of transaction logs (history of every action) from a primary database server to a secondary standby server. The main purpose of log shipping is to provide a disaster recovery solution, ensuring data availability and integrity in case of a primary server failure #db

author avatar

vaibhav.yadav

Sat Jun 01 2024

Recently I came across an interesting use case of combining CSS variables with environment variables. The challenge was to change a CSS property, particularly a color, based on an environment variable. Since CSS doesn't support environment variables directly, here's the approach I took:

The global css file:

:root {
  /* ----- fallback value ----- */
  --primary-color: #3498db;
}

h1 {
  color: var(--primary-color);
}

Then, in our React application:

const App = () =&gt; {
  const primaryColor = process.env.NAME === 'a' ? '#fff' : '#000';

  return (
    &lt;div style={{ '--primary-color': primaryColor }}&gt;
      &lt;h1&gt;Hello, World!&lt;/h1&gt;
    &lt;/div&gt;
  );
};

#css #cssvariables #react

author avatar

vaibhav.yadav

Fri May 31 2024

Using choice Input in GitHub Actions

Choice input in Github actions can be used to provide a predefined list of options for workflow dispatch events. This makes it easier for users to select from a set of valid options when triggering workflows manually.

Example:

name: Example Workflow

on:
  workflow_dispatch:
    inputs:
      environment:
        description: 'Select the environment'
        required: true
        default: 'sandbox'
        type: choice
        options:
          - sandbox
          - uat
          - production

jobs:
  example_job:
    runs-on: ubuntu-latest
    steps:
      - name: Display Inputs
        run: |
          echo "Environment: ${{ github.event.inputs.environment }}"

#githubactions #devops #automation #dropdown

author avatar

adithya.hebbar

Wed May 29 2024

To generate an Entity-Relationship Diagram (ERD) using Prisma-erd-generator, follow these steps : • Install the following package

npm i -D prisma-erd-generator @mermaid-js/mermaid-cli
# or
yarn add -D prisma-erd-generator @mermaid-js/mermaid-cli

Add this to your schema.prisma

generator erd {
  provider = "prisma-erd-generator"
}

Run the generator

npx prisma generate

#javascript #erd

author avatar

adithya.hebbar

Mon May 27 2024

To use Client Components, states, useState, useEffect, onClick, and other client-side features, add "use client" at the top of your file. This ensures the component runs on the client side.

#javascript #nextjs

author avatar

adithya.hebbar

Mon May 27 2024

Key difference between App router and Page router :

App Router:File-based routing: Uses nested folders to define routes. • Components: Server Components by default. • Data fetching: Uses fetch function. • Layouts: Can be nested and dynamic. • Dynamic routes: Supported, but syntax differs. • Client-side navigation: Supported with router.push. • Priority: Takes precedence over Page Router. Page Router:File-based routing: Files directly represent routes. • Components: Client Components by default. • Data fetching: Uses getServerSideProps, getStaticProps, getInitialProps. • Layouts: Static. • Dynamic routes: Supported. • Client-side navigation: Supported with Link component. • Priority: Fallback if no matching route in App Router. #javascript #nextjs

Showing 4 to 5 of 65 results