Fueling Curiosity, One Insight at a Time

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.

Jun 19, 2024
Common procedure to monitor data in Devops Environment

First we need a source of metrics that can be Applications, Databases, Containers etc

After that we need Exporters

Exporters are components that collect and export metrics from various systems, applications, and services, making them available to monitoring tools

Then we need Datasource

Datasource aggregates, stores, and allows querying of the metrics collected from Exporters, making it the data source for visualization tools and alerting mechanisms.

Collected data is stored in Time Series database

A time series database (TSDB) is a special type of database designed to store and manage data that is recorded over time. Each piece of data has a timestamp, which helps keep track of when it was collected.

Then comes the visualisation part

We can use tools like Grafana that make use of the data that is stored in Time Series Database like prometheus to visualise data

#monitoring #devops
ayushsrivastava
Ayush Srivastava
System Analyst
Jun 18, 2024
util.inspect use-case:

• Without util.inspect


const obj = {
  name: "Adi",
  age: 24,
  details: { details1: { details2: { hobbies: "travelling" } } },
};
console.log(obj);
//Output: { name: 'Alice', age: 30, details: { details1: { details2: [Object] } } }


• With util.inspect


import util from "util";

const obj = {
  name: "Adi",
  age: 24,
  details: { details1: { details2: { hobbies: "travelling" } } },
};

console.log(util.inspect(obj, { depth: null, colors: true }));

//Output: { name: 'Adi', age: 24, details: { details1: { details2: { hobbies: 'travelling' } } } }


console.log doesn't show all details of complex objects, especially nested ones or hidden properties. util.inspect gives a complete and customizable view for better debugging and understanding.

#javascript
adithya.hebbar
Adithya Hebbar
System Analyst
Jun 18, 2024
To kill a process running on a specific port in mac:
1. lsof -i :<port_number>
2. Note the PID of the process from the output.
3. kill -9 <pid>
#killprocess
adithya.hebbar
Adithya Hebbar
System Analyst
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
ayushsrivastava
Ayush Srivastava
System Analyst
Jun 17, 2024
Uninstall / remove a Homebrew package including all its dependencies



brew tap ggpeti/rmrec
brew rmrec pkgname


#homebrew
ayushsrivastava
Ayush Srivastava
System Analyst
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
nisanth
Nisanth
Jun 10, 2024
Restarting a DaemonSet in Kubernetes #devops #kubernetes

To find a DaemonSet in a specific namespace:


kubectl get ds -n 


To restart the DaemonSet:



kubectl rollout restart ds  -n 

nisanth
Nisanth
Jun 3, 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
sujay
Sujay
Jun 1, 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 = () => {
  const primaryColor = process.env.NAME === 'a' ? '#fff' : '#000';

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


#css #cssvariables #react
vaibhav.yadav
Vaibhav Yadav
Senior System Analyst
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
vaibhav.yadav
Vaibhav Yadav
Senior System Analyst

Showing 21 to 23 of 82 results

Ready to Build Something Amazing?

Codemancers can bring your vision to life and help you achieve your goals