Category: Software, hardware and other IT

How to increase the color (saturation) of images, how to make a photo warmer or colder

You have probably noticed that other people's photographs can look very beautiful: incredible colors and shades, the landscape seems to be from a postcard.

You might think that it's all about some very expensive camera, the outstanding talent of a photographer, or incomprehensible skills in photo processing. All this can take place, but in fact, you can turn an ordinary photo into a very juicy and bright one with just one slider in the photo editor.

For this post, I'll be using the free and open source GIMP image editor. But in fact, you can find a similar function in other paid and free programs. You can transform your photos in photo editors on mobile phones as well.

How to enhance the color of an image. How to make colors vibrant

In GIMP, go to Color → Hue-Saturation.

Here you will see only one “Scale” slider.

Moving to the right will make the colors more saturated.

Original image:

Image with high saturation:

Original image:

Image with high saturation:

Original image:

Image with high saturation:

Perhaps I do not know the measures (I set the saturation almost to the maximum), and the photos became too colorful. You can change the saturation according to your taste and artistic intent.

How to make a photo warmer or colder

A warmer photo has more yellowness, a colder photo has more blueness.

Changing the temperature of a photo also greatly changes its perception.

To change the temperature of a photo in GIMP, go to Color → Color Temperature.

Here you will see two sliders “Original temperature” and “Intended temperature”. experiment with both of them.

Original Image:

Image in warm colors:

Image in cold colors:

Changes in shadows and light

Let’s consider how to emphasize the shadows and light sources in the photo.

From the GIMP menu, go to Color → Shadows-Highlights.

Here you can increase or decrease the shadows in the photo, as well as increase or decrease the intensity of the light source.

For example, reducing the amount of light:

Original Image:

Look how expressive and even menacing the clouds have become:

In the following example, the amount of light is added:

Original Image:

And now the clouds have become shining like in a biblical parable:

Experiment with color!

I guess you agree that the simplest manipulations shown above with literally one settings slider can significantly change the impression of a photo. The pictures have become noticeably more spectacular, but at the same time they have not lost their realism.

The GIMP Preferences menu under Color has other settings you can try.

Pay special attention to “Brightness”, “Contrast”, “Exposure”. With them, you can change the impression of the photo.

How good is 5G – review after real experience of use

How to connect to 5G network


How much talk about 5G, about new phones with 5G, about the assurances of mobile operators to start supporting 5G and increase the coverage of existing networks.

But how important is 5G? Is this really a breakthrough or a marketing ploy to force users to buy newer and more expensive phone models? It happens that new technologies advertised by marketers turn out to be hardly noticeable or simply invisible “by eye”. For example, a new generation of CPUs that either work faster, or work not faster, but better, or work even slower, but still somehow better – I think you roughly understand what I mean.

I am a real user of 5G mobile internet and in this post I want to share my opinion about 5G.

5G networks have appeared in my city, my phone supports 5G, so I decided to test this technology in normal use.

In fact, when talking about the Internet, including the mobile Internet, most users are primarily interested in only two characteristics:

  1. Transfer rate (bandwidth).
  2. Stability (reliability) of data transmission.

So I didn't invent any fancy tests, but just took measurements with Speedtest, and also used the Internet in my daily activities.

5G is a breakthrough in mobile Internet speeds!

Look at these screenshots:

Download speed 460 Mbps! If you are more accustomed to megabytes, then this is about 50-60 MB/s.

Data upload speed is about 30 Mbps!

Once again, mobile Internet at almost half a Gbps!

Not all users even have wired Internet at such speeds. That is, it is very fast.

Moreover, only router models that support the latest Wi-Fi standards are able to provide network connections at such speeds (in theory, in practice, speeds are much lower. For example, 802.11ac has speeds up to 1300 Mbps at 5 GHz plus up to 450 Mbps at 2.4 GHz.

I use my phone as a mobile hotspot through which my computer accesses the Internet. The Access Point must be enabled at 5 GHz, otherwise the Wi-Fi speed at 2.4 GHz may simply not be enough.

I made these measurements of the speed of accessing the Internet through a phone and a 5G network on a computer.

How stable is the Internet in 5G networks

To test how long the high speed of the Internet will last for long periods of time, I decided to check on torrents.

I got about half the speed compared to the measurements on Speedtest. However, I do not think that this is the limit. The fact is that the speed of downloading a torrent depends on the number of people involved in downloading and uploading a file (Seeds and Peers). But even relatively large files at such speeds are downloaded quite quickly. That is, at the beginning of the download there are few Seeds, so the speed is incomplete, in the future the number of Seeds increases, but the download of the file is coming to an end.

That is, I believe that even when downloading large files, 5G networks can consistently have high Internet speeds.

See also:

What you need to use 5G networks

You won't get any benefits from 5G if your phone doesn't support 5G networks. That is, first, you need a phone with 5G support.

To make sure your phone supports (or doesn't) go to Settings → Connections → Mobile networks → Network mode SIM.

If you do not see 5G there – then try clicking on the inscription “Network mode SIM” to see if there is a 5G mode.

If there is no 5G there, then most likely your phone cannot work with 5G mobile networks.

Of course, your mobile operator must deploy 5G mobile networks.

If both of these conditions are met, but your phone cannot connect to 5G networks, then this is possible for the following reasons (the list is not complete):

  1. You are out of range of 5G networks.
  2. You need to update your SIM card
  3. You need to enable 5G support in settings as shown above

You won't get any of the benefits of 5G if your carrier plan has a rate limit

Look at the following screenshot.

It is made by the proud owner of an annual tariff plan, which is unlimited (for the number of Gigabytes), but is limited to 10 Mbps.

That is, if you have chosen a tariff plan with a speed limit, then when you switch to 5G, you will not notice any difference. The Internet speed on your phone will be limited by the speed of your data plan.

How to enable saving videos in HEVC in Android to reduce file size

What is HEVC video

HEVC H.265 the new video format, which allows you to compress video files much stronger (almost 2 times compared to the old formats) without losing quality. It is important for 4K movies and high-definition video streaming.

Some mobile phones (for example, iPhone) already save videos in this format by default (although you can switch to the old format in the phone settings).

You can get the HEVC codecs for free through the Microsoft Store on Windows 11 and on Windows 10. You won't be able to find them in the Microsoft Store using the search feature. To get the free package, copy and paste the following code into your web browser's address bar, then press Enter:

ms-windows-store://pdp/?ProductId=9n4wgh0z6vhq

This is not so important, because many video media players work fine with the HEVC H.265 format. And in order for this format to be able to play even the built-in Windows media player, it is enough to install the codec mentioned above.

That is, the HEVC format is well supported by operating systems and mobile phones.

Anyway, should I use HEVC?

HEVC video examples

So that you can evaluate the file sizes and the quality of the HEVC picture, I made a few very short videos for you.

They are of the same duration.

When switching to the HEVC format, the video size is almost halved (about 1.6-1.8 times less).

I deliberately did not upload videos to YouTube so that you can evaluate the original quality before processing and converting files.

You can download video files to your computer to test how well your operating system works with HEVC files.

This video uses the H264 - MPEG-4 AVC (part 10) (avc1) codec:

Download file: https://zawindows.ru/wp-content/uploads/2022/08/Pattaya-H264.mp4

Video specifications:

Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5.2
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Format settings, GOP                     : M=1, N=60
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 10 s 163 ms
Bit rate                                 : 73.0 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels

And this video uses the MPEG-H Part2/HEVC (H.265) (hvc1) codec:

Download file: https://zawindows.ru/wp-content/uploads/2022/08/Pattaya-hevc.mp4

Video specifications:

Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L5.2@Main
Codec ID                                 : hvc1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 10 s 496 ms
Bit rate                                 : 41.5 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels

And the first surprise that you might encounter is that the video does not play at all, or the web browser offers to play it as an audio file.

You can download the file to your computer and make sure that it is still a video file.

If you have already read the article “How to enable saving photos in HEIC (HEIF) format in Android and whether it should be done”, then this problem should have been expected for you. New formats are good for everyone, except that web browsers have poor support for them.

Another video in H264:

Download file: https://zawindows.ru/wp-content/uploads/2022/08/Pattaya-beach-H264.mp4

Similar video in HEVC format (H.265):

Download file: https://zawindows.ru/wp-content/uploads/2022/08/Pattaya-beach-hevc.mp4

Does YouTube support HEVC format

Yes, I checked, when uploading a video in HEVC format, YouTube video hosting works fine with it, there are no restrictions or difficulties.

How to save video in HEVC in Android

If you still came to the conclusion that the HEVC format is interesting for you and you want to use it to significantly reduce the size of video files without changing the video quality, then the following shows how to enable saving captured videos on Android in the HEVC format (H.265 ) on the example of the Samsung Galaxy S21 Ultra phone.

Open the camera and switch to video recording.

Click the gear icon to go to the camera settings.

Go to the “Advanced recording options” section.

Find the “Reduce file size” option.

Turn on the slider.

The description of the option says that the Reduce file size option is designed to save space without sacrificing video quality. The results will be saved in HEVC format, which some apps and websites don’t support.

Ambient sound in Galaxy Buds2: an analogue of the transparency mode from Samsung

How to listen to ambient voices and sounds in Galaxy Buds2 without turning off the music

Apple's AirPods Pro have a feature called Transparency mode. Its essence is that instead of actively suppressing ambient sounds and noises, they are, on the contrary, transmitted to the user's ear. Thanks to this, you can hear the voice of the interlocutor without turning off the music, as well as hear what is happening around you when, for example, you are in public transport or walking down the street.

The function is at least interesting and many users find it very useful. But is it necessary to have an iPhone and AirPods Pro to have this feature?

In fact, many wireless headphones already support this feature, such as the Jabra Elite 75t and the Sony WF-1000XM4.

I want to talk about the transparency mode on Android.

I use headphones and a phone from Samsung, namely Galaxy Buds2 and Galaxy S21 Ultra.

In Galaxy Buds2, the analogue of the transparency mode is called “Ambient sound”.

For easy control of your Galaxy Buds2, install the Galaxy Wearable app. With this app, you can change Galaxy Buds2's touch action settings, select different modes, turn on Galaxy Buds2's headphone search function, and more.

By the way, updating the Galaxy Buds2 firmware is also done through the Galaxy Wearable app.

Galaxy Wearable has 3 options under Noise controls:

  • Active noise cancellation
  • Off
  • Ambient sound

It is the “Ambient sound” mode that enables amplification of the audibility of external sounds, such as the speech of people around and other noises.

When “Ambient sound” is enabled, a new setting "Ambient sound volume" will appear, you can choose from “Low”, “Medium”, “High”.

You don't have to launch the Galaxy Wearable app each time to change the Noise controls settings. You can also change these settings by touching the Galaxy Buds2.

A long touch on the Galaxy Buds2 means to switch the Noise controls to the opposite mode. For example, if “Active noise cancellation” is already selected, the “Ambient sound” mode will be enabled. If “Ambient sound” is already selected, “Active noise cancellation” will be enabled.

If both of these modes are disabled, then a long touch on the Galaxy Buds2 will first turn on “Active noise cancellation”, and a second long touch will turn on “Ambient sound”.

As with any feature that has to do with ergonomics and user habits, it takes getting used to Noise controls and its modes.

How to remove navigation bar buttons in Samsung Galaxy S22

The first Android phones had physical buttons at the bottom of the screen (there were 3 or 4 depending on the model). With these buttons, you could close the application or undo the last action, return to the main screen, or go to the list of recently opened applications.

Subsequently, these buttons became virtual, that is, part of the image displayed on the phone screen. But this did not stop them from taking up space on the surface of the phone.

The advantage of virtual buttons is that they can still be completely removed from the screen, as a result, the entire surface of the screen becomes a usable area, without the area constantly occupied by buttons.

Is it convenient to control swipe gestures on Android

The question may arise, how then to control the phone if there are no buttons? In this case, swipe gestures are used to control the phone.

In my case, I got used to gestures in a few days (although I used buttons for many years before that). Gestures are no more difficult to control than buttons.

But it cannot be said that there is absolutely no discomfort: when I pick up a phone with buttons, by inertia I try to control it with gestures. And only then, after making sure that nothing works, I notice the buttons.

There are no other inconveniences.

If you want to try switching to swipe gesture control, it's recommended that you try it out for at least a few days, as it's going to be weird at first anyway.

How to enable gesture control and remove buttons on Android

Start by opening your phone's settings menu. The easiest way to do this is to swipe down from the top of your phone's display and drag down the notification bar. From here, tap the gear icon in the top right corner.

Scroll down the menu and find the “Display” section.

Find the “Navigation bar” section and go to it.

Select “Swipe gestures”.

It is also recommended to enable the item “Show button to hide keyboard”.

This button is needed not so much to actually hide the keyboard, but to create a gap between the bottom edge of the screen and the keyboard. If it is not there, then it will not be easy to perform a gesture if there is a keyboard on the screen, since the phone will perceive touches not as a swipe gesture, but as input from the keyboard. As soon as there is a gap, the phone will correctly perceive both swipe gestures and keyboard input.

How to control swipe gestures in Android

In fact, the control is elementary, and there are only three gestures:

  1. Swiping from the right or left edge of the screen means Back, Cancel, Close App.
  2. Swiping up from the bottom of the screen means going to the main screen, similar to the Home button.
  3. Swiping up from the bottom of the screen without lifting your finger from the screen at the end of the gesture means to go to the list of recently opened programs.

The gesture from top to bottom opens the curtain, but the setting described in this manual does not affect it.

Analogue of Add-Computer in PowerShell 7

===========================================================

UPDATE:

Testing with PowerShell 7.3.0-preview.5 shows that Add-Computer is back!

Command

Get-Command -module Microsoft.PowerShell.Management

outputs the following:

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Add-Computer                                       1.0        Microsoft.PowerShell.Management
………………….
………………….

That is, Add-Computer is present, it is a function (not a cmdlet), the version is indicated as 1.0. The status of Add-Computer is not completely clear: is it a temporary hotfix or a gradual return of the cmdlet?

===========================================================

Add a computer to a domain or workgroup in PowerShell

The Add-Computer cmdlet joins a computer to a Windows Domain or to a Workgroup. The Add-Computer cmdlet adds the local computer or remote computers to a domain or workgroup, or moves them from one domain to another. It also creates a domain account if the computer is added to the domain without an account. You can use the parameters of this cmdlet to specify an organizational unit (OU) and domain controller or to perform an unsecure join.

An example of a command that adds the local computer to the domain and restarts the computer:

Add-Computer -DomainName Domain01 -LocalCredential Domain01\Administrator -Restart

The following command adds the local computer to the workgroup, or renames the workgroup (if the computer is already in a workgroup with a different name):

Add-Computer -WorkgroupName WORKGROUP-A

These commands work fine in PowerShell 5, which is built in by default in all versions of Windows up to Windows 11 and all server versions up to Windows Server 2022.

See also: How to check PowerShell version in Windows 11

Error “Add-Computer: The term 'Add-Computer' is not recognized as a name of a cmdlet, function, script file, or executable program.”

But in PowerShell 7, this command is missing:

Add-Computer
Add-Computer: The term 'Add-Computer' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Suggestion [4,General]: The most similar commands are: Add-Computer, Stop-Computer, Get-ADComputer, New-ADComputer, Set-ADComputer, Add-Content, Rename-Computer, Add-Member.

You can verify that the command named Add-Computer is indeed present in PowerShell 5, where it is placed in the Microsoft.PowerShell.Management module:

powershell
Get-Command -Module Microsoft.PowerShell.Management -Name *Computer* | Select Name

But Add-Computer is missing from PowerShell 7:

pwsh
Get-Command -Module Microsoft.PowerShell.Management -Name *Computer* | Select Name

You can count exactly how many commands are removed from the Management module when moving from PowerShell 5 to PowerShell 7:

powershell
Get-Command -Module Microsoft.PowerShell.Management | Measure-Object | select Count

pwsh
Get-Command -Module Microsoft.PowerShell.Management | Measure-Object | select Count

There were 89 command, 61 commands remained.

How to replace Add-Computer in PowerShell 7

One of the suggested alternatives seems to be the New-ADComputer cmdlet, but the documentation explicitly says that “This cmdlet does not join a computer to a domain”.

There is no information about where the Add-Computer cmdlet or what its alternative is in PowerShell.

One working solution, if you've already installed PowerShell 7, is to run the join Domain or Workgroup command in PowerShell 5. To do this, run the following sequence of commands:

powershell
Add-Computer -DomainName Domain01 -LocalCredential Domain01\Administrator -Restart

See also: How to install the latest PowerShell on Windows 11

VirtualBox Error “NS_ERROR_FAILURE (0x80004005)” (SOLVED)

After updating VirtualBox, all virtual machines stopped working, regardless of the guest operating system and their settings.

The situation is complicated by the fact that instead of an exact indication of the problem, when trying to start the virtual machine, only a general message is displayed that the session was terminated, as well as an error number, which is common to a number of errors related to the inability to start the virtual machine session.

Full text of the error:

The VM session was aborted.

Result Code: 
NS_ERROR_FAILURE (0x80004005)
Component: 
SessionMachine
Interface: 
ISession {c0447716-ff5a-4795-b57a-ecd5fffa18a4}

One possible reason is a mismatch between the versions of the VirtualBox Extension Pack and the installed version of VirtualBox.

VirtualBox Extension Pack is an extension that adds features such as support for USB 2.0 and USB 3.0 devices, VirtualBox RDP, disk encryption, NVMe and PXE boot for Intel cards.

To make sure that the reason is in the VirtualBox Extension Pack, you can disable the functions that the extension pack provides in the virtual machine settings (for example, rollback to USB 1.1 version) – after that the virtual machine should work without errors. Or go straight to updating the extension pack, which will solve the indicated problem.

To fix this problem, just install the version of the VirtualBox Extension Pack that matches the version of your VirtualBox.

If you installed the extension pack manually, then go to the VirtualBox download page https://www.virtualbox.org/wiki/Downloads and find the VirtualBox Oracle VM VirtualBox Extension Pack there.

Download and run the file by double clicking.

During the installation of the new version, you will be prompted to uninstall the old version.

The Linux repositories also contain the VirtualBox Extension Pack.

On Debian and derivative distributions (Linux Mint, Ubuntu, Kali Linux and others), to install the VirtualBox Extension Pack from the repository, run:

sudo apt install virtualbox-ext-pack

On Arch Linux and derivative distributions (Manjaro, BlackArch and others), to install the VirtualBox Extension Pack from the repository, run:

pikaur -S virtualbox-ext-oracle

If you get a message that the pikaur command was not found, then see the article “Automatic installation and update of AUR packages”.

If you receive an error that the VirtualBox Extension Pack is already installed, for example:

VBoxManage: error: Extension pack 'Oracle VM VirtualBox Extension Pack' is already installed. In case of a reinstallation, please uninstall it first

Then you need to start by removing it manually. To do this, open VirtualBox, go to the menu File → Preferences → Extensions.

Uninstall VirtualBox Extension Pack.

After that, restart the installation of the VirtualBox Extension Pack from the repository.

After updating the VirtualBox Extension Pack, the “NS_ERROR_FAILURE (0x80004005)” error is gone.

Basics of launching and using command line utilities in Windows

Are the command line and command line utilities relevant today?

Windows users are accustomed to using programs (applications) with a graphical user interface, in which actions are performed using mouse clicks or keyboard input.

At the same time, even in Windows there are and can be installed many utilities, programs without a graphical interface, with very useful functionality. As a rule, programs without a graphical interface are designed to perform a highly specialized action or function and are designed for professionals.

Programs without a graphical interface are called “command line utilities”, “programs with a command line interface” (CLI).

There is no need to think that command line utilities are some kind of atavism and something outdated. This is very far from the truth! Entire layers of specialized programs in various fields are developed precisely as utilities with a command line interface.

The purpose of this note is to give a general idea to Windows users about how to deal with the command line. If you have downloaded the utility and cannot run it, then this note is for you!

When I click on the exe file, a black window flickers and then disappears

When you try to launch the command line utility by double-clicking, you will most likely encounter the console window flashing for a second, which immediately closes.

Programs with a command line interface are not designed to be launched by double-clicking. Instead, they need to be run, as you might have guessed, on the command line.

Windows has several environments for executing commands:

  • CMD
  • PowerShell (includes all the features of CMD and provides many cmdlets for administering Windows desktops and servers)

You can also remember Windows Terminal, but this is not a separate environment that has its own commands, but just an application for conveniently entering CMD and PowerShell commands.

To run the program, you need to open a Windows Terminal window (or PowerShell). To do this, press the key combination Win+x, and select “Windows Terminal” or “Windows Terminal (Admin)”:

What to choose: “Windows Terminal” or “Windows Terminal (Admin)”

Utilities can be run with normal user rights, or require running with Administrator rights.

With Administrator rights, for example, the following programs should be launched:

  • Programs that register and install themselves as system services
  • Programs that require low-level access to devices (for example, programs for partitioning or fixing disk errors)
  • Programs that change system settings that only an administrator can change.

An example of programs with a command line interface that require Administrator rights:

  • Apache (web server, it registers and starts itself as a system service)
  • MySQL (DBMS, it registers and starts itself as a system service)

An example of utilities that do not require elevated privileges:

How to run an executable on the command line

Consider running a program with a command line interface using the Apache web server (httpd) as an example.

The first option: you can simply drag and drop the executable file into the command line window. The Apache executable is httpd.exe.

The second option: on the command line, you can change the current working directory to the one where the Apache executable files are located. For example, my program is located in the C:\Apache24\bin\ folder, to change the current working folder, the “cd” command is used, after which the folder you want to go to is indicated, in my case the command looks like this:

cd C:\Apache24\bin\

As you can see from the screenshot, the C:\Users\MiAl folder has been changed to C:\Apache24\bin\.

Now, to run the program, it is enough to type the name of the executable file indicating the current folder. The current folder is indicated by a dot (.), then you need to put a backslash, it turns out like this:

.\httpd.exe

Apache is a network service, that is, a program that uses a computer network for its work. Specifically, Apache listens for incoming connections on port 80 (the service opens a port). For this reason, the Windows Firewall asks whether to allow the Apache HTTP Server program to communicate on the network, select “Allow access”.

Already at this stage, the web server is running, and you can open the address http://localhost/ in a web browser

To stop the service, press Ctrl+c.

How to get help using the utility

Typically, command-line utilities support various options that can be specified with a space after the executable file name.

Also, utilities usually have built-in help on available options, which can be displayed using the -h option or the --help option, which must be specified after the executable file name.

For example:

.\httpd.exe -h

In addition to command line options, many services are configured using configuration files, which are text files with a specific syntax. This is especially common for utilities that came to Windows from Linux, since in this operating system many programs are configured using text files.

In this case, quite often explanations of custom directives are contained in the configuration file itself in the form of notes, or in accompanying documentation.

README, ReadMe.txt, README.md files and software documentation

Utilities are usually accompanied by documentation. For example, this is an Apache archive:

As you can see, the ReadMe.txt file with documentation is attached to the archive – this is documentation from those who compiled Apache for Windows.

Inside the Apache24 folder there are even more files and folders with installation information and more.

This is a PHP archive – it also contains a README.md file that provides help information.

A MySQL archive containing a README file and a documentation folder or a link to the documentation.

Program in PATH environment variable

The above shows that in order to run the program, you need to go to the folder with this program.

Alternatively, you can specify the full path to the executable, for example:

C:\Server\bin\Apache24\bin\httpd.exe

It is this method that works when you drag and drop the utility into the console to run the utility – in this case, the full path to the file is inserted into the command line.

But some commands run from any folder, wherever you are on the command line. For example, try the following command:

find /?

The fact is that for operating systems there is such a thing as the PATH environment variable.

The essence of the PATH environment variable is as follows:

1. The PATH variable is assigned a value that consists of a list of folders, that is, paths in the system.

2. When you run a file on the command line, the operating system tries to find it both in the current folder (where you went with the “cd” command, or open by default), and in each folder specified in the PATH environment variable

3. If the file is found in the current folder, or in any PATH folder, then it is launched.

This is the reason the following command always works:

find /?

The reason is that it is placed in one of the folders listed in PATH (namely C:\Windows\System32\).

To view the current value of the PATH environment variable, run any of the following commands:

Get-ChildItem -Path Env:PATH

$env:PATH

Example PATH content in Windows 11:

C:\Program Files\PowerShell\7-preview;C:\Program Files\ImageMagick-7.1.0-Q16-HDRI;C:\Server\bin\PHP\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2022.1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\PowerShell\7-preview\preview;C:\Users\MiAl\AppData\Local\Microsoft\WindowsApps

You can place frequently used utilities in a folder included in PATH. Either you can add a new folder to PATH with the utilities you want to run without specifying the full paths to the executable files, or without having to change to the directory with these utilities.

You can set the value of PATH (and other environment variables) both in the GUI and on the command line.

See also:

Do I need to specify the extension of the executable file

When running executable files, it is not necessary to specify the extension, because the console will understand what you mean. For example, the following two commands are identical:

hashcat.exe

hashcat

Conclusion

This note is intended to give you a general idea of how to start and use the command line utilities. For basic information on using a particular utility, see the help displayed with the -h option or the program's documentation.

If you encounter an error when starting the utility, try running the program in an elevated command prompt (with admin rights).

If you get a message that “file not found”, go to the folder with the installed program using the “cd” command, or drag and drop the executable file to the command line.

If you received an error message inside the program when starting the program, then study the utility options and examples of its launch in more detail.

iThemes Security locked out a user – how to login to WordPress admin when user is banned (SOLVED)

iThemes Security is a plugin for WordPress that makes it difficult for hackers to attack the site and collect information.

Among other features, iThemes Security has protection against brute-form paths (search for “hidden” folders and files), as well as protection against hacking user credentials by brute force passwords.

Once set up, the iThemes Security plugin usually works fine and doesn't require much attention. But sometimes there may be a problem with blocking your user, because someone tried to guess the password to your account.

The situation may arise in the following scenario:

1. You have activated the function of protecting accounts from brute-force passwords

2. The attacker repeatedly tried to guess the password from your account

3. As a result, the account was blocked

4. When you try to enter your username and password from your account to get into the WordPress administration panel, you get a message that it is blocked (banned):

YOU HAVE BEEN LOCKED OUT.
You have been locked out

You don't have to wait until the account is unlocked.

If you have access to the file system, then you can immediately log into the WordPress admin panel.

I don't know how to bypass the iThemes Security lock, instead the plan of action is the following:

1. Disable iThemes Security

2. Login to the WordPress admin area

3. Enable iThemes Security

To disable any WordPress plugin, simply remove the plugin folder. And it is not necessary to delete it – just rename it.

Open the file manager of your sites and find the following path there: SITE/wp-content/plugins/

If you are using the command line, then the path to the plugin is: SITE/wp-content/plugins/better-wp-security

Find the better-wp-security folder and rename it to something like “-better-wp-security”.

Right after that, you can log into the WordPress admin panel.

Once you are logged into the WordPress admin panel, you can reactivate the iThemes Security plugin. To do this, rename the “-better-wp-security” folder to “better-wp-security”.

All is ready! No additional iThemes Security configuration is required.

Checking the logs showed that the attack (brute-force user credentials) was carried out through the xmlrpc.php file.

The xmlrpc.php file provides features that most webmasters don't use but are actively exploited by hackers. For this reason, you can safely block access to the xmlrpc.php file. If you do not know what this file is for, then most likely you do not use it, and you can block access to it without consequences for you.

You can disable XML-RPC with an .htaccess file or a plugin.

.htaccess is a configuration file that you can create and modify.

Just paste the following code into your .htaccess file at the root of your WordPress site (the solution uses mod_rewrite):

# Block requests for WordPress xmlrpc.php file
RewriteRule ^xmlrpc\.php - [NC,F]

Your server must support .htaccess and mod_rewrite files – most hosts can do this.

How to show all errors in PHP 8

How to display all errors in PHP 8

By default, PHP 8 disables showing errors, so if there is a problem while executing a PHP script, nothing will be displayed on the screen. If an error in the program occurred before the output of the HTML code, then you will see a white screen of the web browser.

Where is the error output configured in PHP

Error output is configured in:

  • script code
  • .htaccess file
  • in the PHP configuration file (for example, in php.ini)

The settings in the script code only affect the behavior of the program in which the settings are made.

The settings in the .htaccess file affect all scripts in that directory and subdirectories.

The settings in the php.ini configuration file affect all PHP scripts that are run unless their error output settings are overridden.

Remember that error reporting is very useful while writing and debugging code, but on production servers, error reporting should be turned off to prevent sensitive data from being leaked and making it harder for an attacker to hack the site.

Configuring error output in PHP script

To display all errors, add the following lines to the beginning of the script:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

These settings enable the output of all errors and warnings to the user's web browser.

Warnings about the use of deprecated constructs will be displayed.

Error output to the web server logs is configured separately.

Remember that if fatal errors occur, that is, when the script could not even run due to incorrect PHP syntax, then the rules specified in the php.ini or .htaccess file will be used to output errors. This is due to the fact that if the syntax is incorrect, the PHP interpreter does not understand the entire file, including the above directives. That is, if a semicolon or a curly brace is missing in the code, then errors will be displayed in accordance with the settings in the php.ini file.

Configuring PHP error output in .htaccess file

Enabling error output in the .htaccess file is done by the following directives:

php_flag display_startup_errors on
php_flag display_errors on

For them to work, the web server must have .htaccess files enabled.

Error output to the web server log is performed by the following directive:

php_value error_log logs/all_errors.log

Setting the output of all errors in the php.ini file

The php.ini file is the PHP configuration file.

PHP can use more than one configuration file during its operation.

Location of php.ini file:

  • In Debian and derivative distributions (Ubuntu, Linux Mint, Kali Linux and others), it depends on the PHP version, for example, for PHP 8.1 the path to the file is: /etc/php/8.1/apache2/php.ini
  • On Arch Linux and derivative distributions (Manjaro, BlackArch and others): /etc/php/php.ini

In the php.ini file you will find the following directives:

display_errors = Off
display_startup_errors = Off

To enable error reporting, replace them with:

display_errors = On
display_startup_errors = On

The default value of error_reporting is set to:

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

This means that all errors are printed except for deprecation warnings and warnings caused by strict code checking.

To display all errors and warnings, set the following value:

error_reporting = E_ALL

Common Values:

  • E_ALL (Show all errors, warnings and notices including coding standards.)
  • E_ALL & ~E_NOTICE (Show all errors, except for notices)
  • E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.)
  • E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)

See the link for details: https://www.php.net/manual/errorfunc.constants.php

In order for the changes made in the php.ini file to take effect, a restart of the web server is required.

  • In Debian and derivative distributions (Ubuntu, Linux Mint, Kali Linux and others), this is done with the command:
sudo systemctl restart apache2.service
  • In Arch Linux and derivative distributions (Manjaro, BlackArch and others), this is done with the command:
sudo systemctl restart httpd.service

To check that the php.ini file settings are actually applied, create a file, for example, named info.php and copy into it:

<?php
phpinfo();

If you created the file in the root folder of the web server, in a web browser open http://localhost/info.php.

The following screenshot shows that error output is disabled in the php.ini file:

This screenshot shows that error output is enabled in the php.ini file:

Outputting errors to the web server log

Error output to the web server log is configured in the php.ini file.

The following directive is used for this:

log_errors = On

The location of the error file is configured in the web server configuration.

The “error_reporting('all');» и ошибка «Uncaught TypeError: error_reporting()”

When trying to use the following construct:

error_reporting('all');

You will encounter the Uncaught TypeError: error_reporting() error.

Full error log:

[Wed Jul 06 07:29:19.410966 2022] [php:error] [pid 14101] [client 127.0.0.1:58402] PHP Fatal error: Uncaught TypeError: error_reporting(): Argument #1 ($error_level) must be of type ?int, string given in /srv/http/suip/index.php:3\nStack trace:\n#0 /srv/http/suip/index.php(3): error_reporting('all')\n#1 {main}\n thrown in /srv/http/suip/index.php on line 3, referer: http://localhost/suip/

Instead of 'all' you need to provide a constant expressing the level of the error message. Valid values are provided on this page: https://www.php.net/manual/errorfunc.constants.php

The following entry is correct for PHP 8 and means to show all errors, notes, and recommendations:

error_reporting(E_ALL);
Loading...
X