Shell get lines interval from a text file

 

cat file | head -n 16482 | tail -n 258

using sed:

sed -n '16224,16482p' in.sql > out.sql

using awk:

awk 'NR>=16224&&NR<=16482' in.sql > out.sql

Ubuntu 20.04 multipath syslog errors

Edit  /etc/multipath.conf 

and blacklist sda. Files contents which also blacklists common other devices like CDRom drives etc. that should never be checked for multipath configurations:

Code:

defaults {
    user_friendly_names yes
}
blacklist {
    devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st|sda)[0-9]*"
}



How to convert an executable to a Windows service

Windows runs services before opening any session. If we want to run a program even if there is no open session, this can be a solution, although it does not always work.

To create a Windows service from an executable (.exe), you need to use the sc.exe program (already included in Windows):
sc.exe create <new_service_name> binPath= "<path_to_the_service_executable>"

You must put quotes “” at the beginning and end of the path and a space after binPath=.

Example:
sc create IperiusBackup start= auto binPath= "C:\Program Files (x86)\Iperius Backup\IperiusService.exe" DisplayName= IperiusBackup

This freeware can also be used: http://nssm.cc/

Install MSIX with powershell

 Add-AppxPackage -Path "C:\Users\MyUserName\Downloads\affinity-designer-2.0.0.msix" -DependencyPath " https://aka.ms/Microsof...

Mais vistos