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.

Feb 8, 2024
The docker build -f command is used to specify the name of the Dockerfile to use for building a Docker image. This flag allows you to specify the path to the Dockerfile that you want to use for building the image. However, if you have a Dockerfile with a different name or located in a different directory, you can use the -f flag followed by the path to the Dockerfile.
nisanth
Nisanth
Feb 7, 2024
Storing Terraform State in S3 with Encryption and DynamoDB Locking , instead of Storing locally :
To improve security , you can configure Terraform to store its state file in an AWS S3 bucket with encryption and use DynamoDB for state locking. This setup prevents local state file risks, enables team access, and avoids state conflicts.


syntax : 

 terraform {
      backend "<BACKEND_NAME>" {
        [CONFIG...]
      }
}




example :

terraform {
  backend "s3" {
    bucket         = "my-terraform-state"
    key            = "state/production/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
    dynamodb_table = "my-terraform-lock"
  }
}

soniya.rayabagi
Soniya Rayabagi
Feb 6, 2024
act utility can be used to simulate GitHub Actions locally, for testing the GitHub workflows.
To install act on Mac: brew install act
To use the act navigate to the GitHub repo and use act -l to list all jobs
To run any particular job: act -j job_id
To run a job on any particular platform: act -j job_id -P

[To run the jobs locally, docker must be running on the system.]
mahesh.bhosle
Mahesh Bhosle
DevOps Engineer
Feb 6, 2024
square brackets [ ] indicate that the entire expression within them is optional
example : FROM [--platform=<platform>] <image> [AS <name>]
here , you can choose whether or not to include the --platform=<platform>
soniya.rayabagi
Soniya Rayabagi
Feb 6, 2024
When ActiveJob is set to :inline it does not depends upon a scheduler anymore. Use perform_later as per your requirements and that will perform the job instantly.
satya
Satya
Feb 4, 2024
If you face error as " Sprockets::Rails::Helper::AssetNotFound: The asset "tailwind.css" is not present in the asset pipeline " while running CI/CD pipeline or during deployment, then check whether you have add the the "app/assets/builds/*" in gitignore. Remove it and precompile assets again using "rake assets:precompile" or "rails assets:precompile". Make sure "tailwind.css" file exists in "app/assets/builds/" folder.
sachin.kabadi
Sachin Kabadi
System Analyst
Feb 3, 2024
while running psql postgres if we face the below error:
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
That can be because of 2 reasons.
1. Your service isn't running , that can be fixed using brew services start postgresql@15
2. Your service is running , but there is some error like


Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/<user>/Library/LaunchAgents/homebrew.mxcl.postgresql@15.plist` exited with 5.


We can fix the 2nd error by removing the process pid file.
• Step 1 -> brew services stop postgresql@15
• Step 2 -> rm -f /opt/homebrew/var/postgresql@15/postmaster.pid (apple sillicon install it at opt/homebrew)
• Step 3 -> brew services start postgresql@15
These 3 steps should fix the error and we can check the info by running brew services info postgresql@15
satya
Satya
Feb 3, 2024
While testing request spec in rails, configure host in your environment(development/test) :-
Add below line in your "config/environment/test" file.


config.hosts << "www.example.com"

sachin.kabadi
Sachin Kabadi
System Analyst
Feb 2, 2024
CIDR Block(Classless Inter-Domain Routing)
Example : CIDR block: 192.168.1.0/28
This CIDR block represents all IP addresses between 192.168.1.0 and 192.168.1.15. The "/28" notation indicates that the first 28 bits of the IP address are fixed (192.168.1.0), and the remaining 4 bits (from 0 to 15) can vary, resulting in 16 possible IP addresses in the range. This range allows for 16 IP addresses, from 192.168.1.0 to 192.168.1.15.
soniya.rayabagi
Soniya Rayabagi
Feb 2, 2024
pg_dump commands:
Standard pg_dump without DROP table queries:
pg_dump -h your-hostname -p your-port -U your-username -d your-database-name -f output-file.sql`` pg_dump with DROP table queries (clean dump): pg_dump -h your-hostname -p your-port -U your-username -d your-database-name --clean -f output-file.sql pg_dump for schema only: pg_dump -h your-hostname -p your-port -U your-username -d your-database-name --schema-only -f output-file.sql pg_dump for data only: pg_dump -h your-hostname -p your-port -U your-username -d your-database-name --data-only -f output-file.sql pg_dump for data only (no schema, INSERT commands only): pg_dump -h your-hostname -p your-port -U your-username -d your-database-name --data-only --inserts -f output-file.sql`
sujay
Sujay

Showing 31 to 33 of 82 results

Ready to Build Something Amazing?

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