Ensuring that an email reaches its intended recipient’s mail server is crucial for effective communication. One way to manually verify this is by using Telnet to simulate the sending process. Below, we provide a detailed guide on how to use Telnet to check if a remote mail server is set up to receive emails for a specific mailbox. We will also include possible responses from the mail server, both correct and incorrect, to help you troubleshoot common issues such as spam filters, full mailboxes, and more.

Continue reading

Loading

Are you encountering the following error when trying to use yum on your CentOS system?

File "/bin/yum", line 30
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax

This error typically occurs when the default Python interpreter has been switched from Python 2 to Python 3. Since yum relies on Python 2, pointing the /usr/bin/python symlink to Python 3 causes syntax incompatibilities. In this article, we’ll guide you through resolving this issue and restoring your system’s package manager to working order.

Continue reading

Loading

Securing your server’s SSH daemon (SSHD) is crucial to protect against unauthorized access and potential security threats. In this article, we’ll explore the best practices for SSHD configuration, specifically focusing on methods to enhance security by leveraging public key authentication, disabling password authentication, preventing empty passwords, disallowing root login via SSH, and specifying the location for authorized keys. These settings ensure a robust defense mechanism for your server’s SSH access.

Continue reading

Loading

Introduction

Debugging HTTP headers is a crucial task for many web developers and system administrators. This guide will walk you through setting up Nginx to capture and inspect HTTP headers in real-time. Understanding how to efficiently debug these headers using Nginx can save you time and help troubleshoot issues more effectively.

Setting Up Nginx for Header Debugging

To start, you need a simple Nginx location directive that allows you to check HTTP headers directly from the console. Here’s how you can set it up:

location = /test-url {
  add_header Content-Type 'text/plain; charset=utf-8';
  return 200 "X-Some-Header: $http_x_some_header\n";
}

his configuration does the following:

  • Directs requests to /test-url to a specific location block.
  • Sets the Content-Type of the response to text/plain; charset=utf-8 for readability.
  • Returns a 200 status with the value of X-Some-Header displayed in the response.

Verifying the Configuration with Curl:

curl -H "X-Some-Header: test-value" https://my-nginx.domain.tld/test-url

You should receive a response like this:

X-Some-Header: test-value

This confirms that Nginx is receiving and returning the header without any issues.

Advanced Configuration: Logging Headers
If you wish to log this header in your access.log, you can modify the log_format in your nginx.conf. Here’s how you can do it:

http {
    log_format main   '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_some_header"';

This setup allows you to:

  • Extend the main log format to include $http_x_some_header, capturing the header value in the logs.
  • Customize logging for specific troubleshooting or monitoring requirements.
Continue reading

Loading

Elasticsearch, a widely used open-source search and analytics engine, often requires the creation of service tokens for authentication purposes. These tokens are typically generated via the command-line interface (CLI) without any issues. However, a recurring problem has been identified when these tokens are used with curl or other types of authentication methods, such as Kibana login.

The error message received is as follows:

received token fails with error
cannot authenticate with auth token to Elasticsearch, error: failed to authenticate service account [elastic/kibana] with token name [<token name>]
Continue reading

Loading

In some times you want to receive notifications from grafana only in working hours. You may configure quiet hours, but in this case grafana show status as unhealthy, just not notifying you.

It’s possible to set hours, when alerts actually present and should be sent.

Just add new prometheus condition with code (time in UTC):

((hour() >= 9) * (hour() <= 18)) OR on() vector(0)

This expression returns 81 at 9:00-9:59, 100 at 10:00-10:59 etc between 9:00 and 18:00 (6 p.m.).

And add condition for this expression >0

First condition – original value expression, second – time interval.

Loading

How to downgrade MS SQL database we can find from web-search. Its discribe simple method – use “Tasks – Generate Scripts…” with data and Win!

standard downgrade method

But! If you have huge database’s size, you cannot use that method. For example: My 10 Gb database, have exported size – 50 Gb. No one text editor can handle this size of plane text file, including command-line import (because its import data from text file line by line and some data cannot be inserted in buffer).

Here is article to help you downgrade huge database in “simple” way.

Continue reading

Loading