TILs - 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.

Published
Author
user-image
Mahesh Bhosle
DevOps Engineer
We can leverage the AWS Systems Manager service to execute the Ansible scripts on the EC2 hosts, this removes the overhead of maintaining SSH keys and other instance details.
How it is done:
• Prerequisites:
◦ EC2 instance should have an IAM role attached for SSM
◦ Ansible should be installed on the instance
• In the AWS System Manager go to State Manager and create a new association
• The association details will include: association name, Document, Ansible playbook, Target selection, schedule, and Rate control
• Based on the Association configuration, the playbook will be executed.
#automation #awsssm #ansible
Published
Author
user-image
Nisanth
Securing Sensitive Data in Kubernetes with Base64 Encoding
Today I learned that the base64 command can be used in Kubernetes to encode sensitive data such as passwords and API keys when creating secrets. By encoding the sensitive information in base64 format, it can be safely stored in Kubernetes secrets without exposing it in plaintext. This adds an additional layer of security to the sensitive data used by applications running in Kubernetes clusters. echo -n "some_password" | base64
#devops #kubernetes #encoding
Published
Author
user-image
Satya
while doing npm install or yarn install we might run into this error mentioned below:


Code

error /Users//project/node_modules/sharp: Command failed.
Exit code: 127
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)


to fix this just do npm rebuild & then run npm install or yarn install .
#sharp-error #npm #node
Published
Author
user-image
Soniya Rayabagi
git stash want to store commit temporarily then , stashing will save your modifications and revert your working directory to its clean state
Published
Author
user-image
Satya
SAP is divided into two types of data:
Master Data - Consists product data , person data (eg: vendor, customer) or place data.
Transaction Data - Consists of quotation , sales order , good issue, good receipt , invoice.
#SAP
Published
Author
user-image
Nisanth
Docker Hub & Pushing Docker Images
Why We Need Docker Hub: Docker Hub is like a social media platform, but instead of sharing photos or updates, we share Docker images. Docker Hub provides a centralized place for storing and managing these images. We use Docker Hub to:
◦ Share our Docker images with others.
◦ Store different versions of our Docker images.
◦ Access our Docker images from any machine, making deployment and scaling much easier.
◦ Find and use Docker images created by others, which can be very helpful.
How to Push a Docker Image to Docker Hub: To push a Docker image, we follow a few simple steps:
a. Log In: Just like logging into your favorite app, we log in to Docker Hub on our computer.
b. Tagging: We give our image a label (or a tag) that describes what it is and which version it is—kind of like tagging a friend in a photo docker tag flix-rails:latest nishanthmathiyazhagan/flix-rails:latest
c. Pushing: With our image tagged, we ‘push’ it to Docker Hub, which means uploading it so others can download and use it.
docker push nishanthmathiyazhagan/flix-rails:latest
What Happens After Pushing the Image to Docker Hub: Once the image is pushed:
◦ It’s stored in our Docker Hub repository,
◦ Other people can ‘pull’ the image to their own computers or servers to run the application it contains.
◦ If we update the application, we can push the new version to Docker Hub so everyone can get the update.
◦ We can pull it down on any server
#devops #docker
Published
Author
user-image
Sujay
Sidekiq Capsule allows to configure queues to execute jobs serially.
Before Sidekiq version 7, to manage dependencies between jobs, a delay was often manually set with set(wait: 30.seconds) to ensure the sequential execution of dependent jobs. This can be achieved now by setting their concurrency to 1.

Code

Sidekiq.configure_server do |config|
  config.capsule("capsule") do |cap|
    cap.concurrency = 1
    cap.queues = %w[capsule-queue]
  end
end


#rails #sidekiq
Published
Author
user-image
Ayush Srivastava
System Analyst
Use pluck to fetch only the necessary columns if you don't need the entire object
This reduces memory usage and database load

For example

Code

adults = User::User.where("age > ?", "18").pluck(:name)


The above code will return an array of name of users who are above age of 18

#rails #db
Published
Author
user-image
Soniya Rayabagi
ps aux | grep defunct displays information about any zombie processes (that have completed execution but still have an entry in the process table with specific PID because, their parent process has not yet collected their exit status) currently running on the system.
#devops
Published
Author
user-image
Vaibhav Yadav
Senior System Analyst
When eslint is not working on your repository in local for any reason you can try restarting the ES Lint Server on VS Code, and if the issue is cause cause server is not reading the config from root directory you can set root: true in your eslint config file, that should resolve the issue. And to fix all your lint issue in a single commit you can use command npx eslint . --fix.

#javascript #eslint

Showing 27 to 29 of 82 results

Ready to Build Something Amazing?

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