At Codemancers, we believe every day is an opportunity to grow. This section is where our team shares bite-sized discoveries, technical breakthroughs and fascinating nuggets of wisdom we've stumbled upon in our work.
Published
Author
Nisanth
Restarting a DaemonSet in Kubernetes #devops #kubernetes
To find a DaemonSet in a specific namespace:
Code
kubectl get ds -n
To restart the DaemonSet:
Code
kubectl rollout restart ds -n
Published
Author
Sujay
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
Published
Author
Vaibhav Yadav
Senior System Analyst
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:
Code
:root {/* ----- fallback value ----- */--primary-color:#3498db;}h1 {color:var(--primary-color);}
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.
To generate an Entity-Relationship Diagram (ERD) using Prisma-erd-generator, follow these steps : • Install the following package
Code
npm i -D prisma-erd-generator @mermaid-js/mermaid-cli# oryarn add -D prisma-erd-generator @mermaid-js/mermaid-cli
• Add this to your schema.prisma
Code
generator erd { provider ="prisma-erd-generator"}
• Run the generator
Code
npx prisma generate
#javascript #erd
Published
Author
Adithya Hebbar
System Analyst
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
Published
Author
Adithya Hebbar
System Analyst
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
Published
Author
Soniya Rayabagi
How to schedule tasks using cron expressions in GitHub Actions: By defining a cron schedule in the workflow YAML file, we can automate the execution of tasks at specific intervals. For instance, setting */5 * * * * in the cron expression triggers the workflow every 5 minutes. Monitoring workflow runs in the "Actions" tab of the GitHub repository allows to verify that the scheduled tasks are executing as intended. #cronjobs #workflowautomation
Published
Author
Mahesh Bhosle
DevOps Engineer
When terraform state file is locked and you are unable to acquire a state lock, you can use terraform force-unlock <LOCK_ID> to forcefully remove the lock. #terrafrom
Published
Author
Vaibhav Yadav
Senior System Analyst
Use git reset --mixed HEAD~1 command to undo your last commit without losing the changes made in your last commit.
#git #gitReset #github
Showing 22 to 24 of 82 results
Ready to Build Something Amazing?
Codemancers can bring your vision to life and help you achieve your goals