Sometimes it’s important to set proper timezone on the server and recently I’ve got this task: set proper timezone automatically based on the server’s location in Azure Cloud. Moreover, I needed timezone to be set automatically by Terraform upon virtual machine creation. In my case I had Ubuntu VMs in Azure and here is the simple and elegant solution I came with: Continue reading
Mar 23 2023
How to find unattached Public IPs in Azure
Finding the Unassociated IP Addresses
- Open the Azure Portal.
- Perform a search for Public IP addresses.
- Click on the +Add filter option.
- From the drop-down for Operator, select “==”.
- Select “–” for Value.
- Click Apply.
After you complete these steps, you’ll have a list of unattached Azure public IP addresses. The next phase of the operation involves selecting and deleting the addresses that the system isn’t using for any resources. Continue reading
Feb 20 2023
Publish Code Coverage of .NET app in SonarQube from Azure DevOps
This article enhances the one where I explained the steps of generation and publication code coverage in Azure DevOps pipeline. This time we go further and implement “shift-left” strategy by introducing SonarQube in Azure DevOps CI/CD process. Our task here will be not only configure code analysis in SonarQube but also get code coverage metrics so we can use it in quality gates and follow “clean as you code” principle. Continue reading
Feb 18 2023
Correct Way to Generate and Publish .NET Code Coverage in Azure DevOps
Publishing code coverage in Azure DevOps and making it look pretty is way harder than it should be. It’s something that sounds simple, oh just check the box on the task – but nope you have to make sure to read the notes and add the additional parameter to the test task. Okay great, now you have a code coverage tab, but what is this .coverage file and how do I open it? That’s not very user friendly. And don’t get me started on having to wait for the entire pipeline to finish before you can even see the code coverage tab – nonsensical. Continue reading
Jan 20 2023
How to resolve merge conflicts in Azure DevOps
There is a simple and effective extension that allows resolving Pull Requests merge conflicts directly in Azure DevOps: Pull Request Merge Conflict Extension Continue reading
Jan 19 2023
How to enable trace log and debug in Terraform CLI
Jan 11 2023
Postfix lookup in hosts file
In case you need to make Postfix look in your local /etc/hosts
files before doing DNS lookup add following in main.cf
file: Continue reading
Jan 10 2023
How to handle React routes in Apache and Nginx
Usually little setup of Apache and Nginx is needed so they can handle React routes properly without trying to treat them as real files or directories resulting in 404 Not Found in React.
Here are the snippets of the React routes related settings for Apache and Nginx. Continue reading
Dec 23 2022
Implement Secure Headers in Apache and Nginx
HTTP security headers are very important part of website security as it protect you against different types of attacks including, XSS, SQL injection, clickjacking, etc.
When you visit any website from your web browser, your browser requests it from the web server where the web site is hosted on. The web server then responds with HTTP Response Headers. These headers contains meta data, status error codes, cache rules and more. It also tell your browser how to behave when handling your website’s content. When you use the web and interacts with websites, your browser stores its information. These headers will help you to outline communication and improve web security. There are six most important security headers that you should be aware of and we recommend implementing if possible.
Be careful, these headers are applying globaly in server if you want to change to specific files please add headers inside a location (nginx) or filesMatch (apache) block. So if you add headers inside any location, files will apply only headers inside location block and global headers will not works for these types of files. Continue reading
Dec 23 2022
Implementing Cache control headers in Nginx and Apache
Cache-Control are HTTP cache headers that holds instructions for caching for requests and responses. It is used to defines how a resource is cached, where it’s cached and its maximum age before expiring. When you visit a website, your browser will save images and website data in a store called the cache. When you revisit the same website again, cache-control sets the rules that determine whether your resources loaded from your local cache or if the browser should send a request to the server for fresh resources.
For better understanding of how the browser renders pages quickly using the cache, you need to know about browser caching and HTTP headers. Continue reading