Tuesday, February 21, 2023

Add disk image to Windows OS on Proxmox

 


1) Enter into the Proxmox console

2) Select the VM -> Hardware -> Add -> Hard Disk:



3) Configure the new disk image:

1. Select the type of disk, usually, it is the same type of existing disk by VM (Virtual Machine)

2. Select the storage where the disk image should be placed

3. Define the size of the disk

4. Add the disk image

4) Stop (Shutdown) and Start the VM to apply changes


5) The disk should be exposed in the Windows Computer management


There it can be made Online, Added with labels and letters, and formatted 


Saturday, February 4, 2023

Set a range of ports in iptables

 how to list a range of ports in iptables config file you can read there?

it is pretty easy to get how to:

was a simple task to a forward range of ports for the File Zilla FTP Server on a virtual server that is running in Proxmox

to avoid crucial listing of full ports volume like this:

-A INPUT -p tcp -m tcp — dport 20 -j ACCEPT-A INPUT -p tcp -m tcp — dport 21 -j ACCEPT-A FORWARD -d 192.168.1.101/32 -i enp4s0 -p tcp -m tcp — dport 20 -j ACCEPT-A FORWARD -d 192.168.1.101/32 -i enp4s0 -p tcp -m tcp — dport 21 -j ACCEPT-A PREROUTING -i enp4s0 -p tcp -m tcp — dport 20:21 -j DNAT — to-destination 192.168.1.101:20-A PREROUTING -i enp4s0 -p tcp -m tcp — dport 20:21 -j DNAT — to-destination 192.168.1.101:21

we can use listing in the range:

-A INPUT -p tcp -m tcp — dport 20:21 -j ACCEPT-A INPUT -p tcp -m tcp — dport 45000:46000 -j ACCEPT-A FORWARD -d 192.168.1.101/32 -i enp4s0 -p tcp -m tcp — dport 20:21 -j ACCEPT-A FORWARD -d 192.168.1.101/32 -i enp4s0 -p tcp -m tcp — dport 45000:46000 -j ACCEPT-A PREROUTING -i enp4s0 -p tcp -m tcp — dport 20:21 -j DNAT — to-destination 192.168.1.101:20–21-A PREROUTING -i enp4s0 -p tcp -m tcp — dport 45000:46000 -j DNAT — to-destination 192.168.1.101:45000–46000

then it could be applied and saved as rules:

~ # iptables-restore < iptables_rules_20200710_ftp_filezilla~ # iptables-save > iptables_rules_20200710_ftp_filezilla

exactly for File Zilla FTP Server, it should be set the same range of ports for passive mode

Sunday, December 11, 2022

Saturday, October 22, 2022

NAS connection

 To Map the network drive device:



Select options:
The suffix in the path (Folder:) should be as a login 

\\uXXXXXX.your-storagebox.de\uXXXXXX-sub1


1 – Select disk (Drive)
2 – Enter the path to the NAS destination
3 – Reconnect if it needs to be accessible automatically
4 – Create and save credentials to avoid entering them again


Enter Login and Password



Tuesday, September 20, 2022

Create media with Windows 10

 How to create Windows 10 boot USB flash drive

Insert a flash drive of at least 8 GB or large to avoid this warning during the installation drive preparation:

Launch the MediaCreationTool21H2.exe


Accept all warnings till getting a new window:




Accept it either:



Select "Create installation media" and Next:


Unpickup "Use the recommended options for this PC" to be able to select need options:

Choose the media driver:




Select the available USB flash drive:


The next button will start the Windows 10 image writing on flash media:


Finish:

Insert the ready-to-install USB flash drive and boot from it



Sunday, September 4, 2022

WordPress Contact Form 7 to Telegram bot

1. create a telegram bot https://core.telegram.org/bots#3-how-do-i-create-a-bot

2. install the Contact Form 7 plugin 

3. install Contact Form 7 + Telegram plugin 

4. configure Contact Form 7 + Telegram plugin
https://wordpress.org/plugins/cf7-telegram/
https://www.pluginforthat.com/plugin/cf7-telegram/ 

5. activate the telegram bot 

6. test messages delivery

Wednesday, August 17, 2022

biggest file in linux command

here are a few Linux console commands (bash commands) to help you to find some biggest files:

use the "find"

find . -type f -size +50M

find – is the command obviously ðŸ™‚
. – where to start the search
-type – a type of what to check
-size – Select files with a size below or an equal size



use the "du" and "sort"

du -h --max-depth=1 | sort -hr



links:
https://www.devopsroles.com/find-large-files-linux/
https://www.tomshardware.com/how-to/find-large-files-linux
https://www.cyberciti.biz/faq/linux-find-largest-file-in-directory-recursively-using-find-du/

Monday, August 15, 2022

pCloud

 I’d like to invite you to join the cloud storage https://u.pcloud.com/#page=register&invite=MtES7Zq0kBq7

Seems like, it’s a quite useful service with is able to cover your needs to share files, media, and backups between pCloud accounts and external access.

The main reason why I’ve chosen this service is its ability to store what I need there in unlimited time.

And the ability to sync your data from a smartphone or desktop is the perfect tool to keep your data backed up





Monday, August 8, 2022

install Zabbix agent on Centos 8

 get one of the Zabbix agent version

~]# wget https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm

add Zabbix repository to be able to install

~]# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm

Retrieving https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
warning: /var/tmp/rpm-tmp.Ankajf: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:zabbix-release-5.0-1.el8         ################################# [ 50%]
Cleaning up / removing...
   2:zabbix-release-5.0-1.el5         ################################# [100%]

~]# dnf clean all

install the Zabbix agent package

~]# dnf install zabbix-agent

start the Zabbix agent service and start it in boot

~]# systemctl enable --now zabbix-agent

Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service → /usr/lib/systemd/system/zabbix-agent.service.
[root@cabinet ~]# systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2022-07-24 10:54:58 EEST; 19s ago
  Process: 2920207 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
 Main PID: 2920209 (zabbix_agentd)
    Tasks: 6 (limit: 49468)
   Memory: 3.8M

install net-tool to run the netstat

~]# yum install net-tools

check listening ports

~]# netstat -nlptu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
...
tcp        0      0 10.10.10.102:1500       0.0.0.0:*               LISTEN      ...

check firewall state:

~]# firewall-cmd --state
not running

if it’s running then stop and disable the firewall
! this option makes sense due to using the target host behind the other firewall or gateway, otherwise to tune the firewall in the proper way

~]# systemctl stop firewalld
~]# systemctl disable firewalld


if it’s not running then check access to port 10050 from another host:

~ # telnet 10.10.10.102 10050
Trying 10.10.10.102...
telnet: Unable to connect to remote host: No route to host

if it’s blocked then check iptables on the target host:

~]# iptables -S
...
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
...

add the open 10050 port rule to the iptables by command

 ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 10050 -j ACCEPT

check the rule again

~]# iptables -S | grep 10050
-A INPUT -p tcp -m tcp --dport 10050 -j ACCEPT

and check the access from another host by telnet

~ # telnet 10.10.10.102 10050
Trying 10.10.10.102...
Connected to 10.10.10.102.
Escape character is '^]'.
Connection closed by foreign host.

return to the target host and save current iptables settings to backup iptables file and to the actual iptables config file (/etc/sysconfig/iptables)

# save actual working settings to backup file
~]# iptables-save > iptables_rules_20220724

# replace the actual iptables config file with actual working settings
~]# cp iptables_rules_20220724 /etc/sysconfig/iptables

# check expected record
~]# cat /etc/sysconfig/iptables | grep 10050
-A INPUT -p tcp -m tcp --dport 10050 -j ACCEPT

# or the rule could be added inside the /etc/sysconfig/iptables
# -A INPUT -p tcp -m tcp --dport 10050 -j ACCEPT

References links:
https://serverspace.io/support/help/install-configure-zabbix-agent-centos-8/
https://linuxize.com/post/how-to-configure-and-manage-firewall-on-centos-8/
https://linuxhint.com/disable-firewall-centos-8/
https://forums.centos.org/viewtopic.php?t=9059
https://upcloud.com/resources/tutorials/configure-iptables-centos

Friday, July 22, 2022

Fix a “WARNING/ERROR in budgets, maximum exceeded for initial” in Angular

The warning or an error can appear and be related to the maximum budgets parameter:

Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 22.68 kB with a total of 1.02 MB.

Should be tuned budgets module in the angular.json file of the Angular project

"budgets": [
                 {
                   "type": "initial",
                   "maximumWarning": "500kb",
                   "maximumError": "1mb"
                 },
                 {
                   "type": "anyComponentStyle",
                   "maximumWarning": "6kb",
                   "maximumError": "10kb"
                 }
               ]

"budgets": [
                 {
                   "type": "initial",
                   "maximumWarning": "2mb",
                   "maximumError": "5mb"
                 },
                 {
                   "type": "anyComponentStyle",
                   "maximumWarning": "6kb",
                   "maximumError": "10kb"
                 }
               ]

Monday, June 13, 2022

Update Bitrix24 on the Remote Desktop

 Check the running Bitrix24 on the tray

Click the right mouse button on the running Bitrix24 icon in the tray:

Open tree dots and click on “About” and Check for Updates:

if the installed version is the latest then the program exposes this:

in otherwise case, it proposes to download the new version.

Before installation log off all users on the server and Exit in the Bitrix24 of your running session on the server

After installation recheck the current version within “About”

Wednesday, May 18, 2022

Last users’ login data with PowerShell


Get-ADUser -Identity username -Properties "LastLogonDate"

output:

DistinguishedName : CN=SomeName,CN=SomeGroup,DC=DomainName,DC=local
Enabled           : True
GivenName         : AccountName
LastLogonDate     : 7/18/2022 7:48:24 PM
Name              : AccountName
ObjectClass       : user
ObjectGUID        : 2d348557-ff9b-4452-8f3b-96e820df570s
SamAccountName    : AccountName
SID               : S-1-5-21-453637392-373859473-1311905769-2573
Surname           :
UserPrincipalName : AccountName@DomainName.local

or it is the PowerShell command with filter:

Get-ADUser -Identity username -Properties LastLogon | Select Name, @{Name='LastLogon';Expression={[DateTime]::FromFileTime($_.LastLogon)}}

output:

Name  LastLogon
----  ---------
AccountName 7/18/2022 8:51:00 PM

Thursday, April 28, 2022

To check a Linux kernel

 Quick tutor on how to get data about Linux kernel

# uname -r
3.10.0–1062.el7.x86_64

# cat /proc/version
Linux version 3.10.0–1062.el7.x86_64 (mockbuild@x86–040.build.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5–39) (GCC) ) #1 SMP Thu Jul 18 20:25:13 UTC 2019

# hostnamectl | grep Kernel
Kernel: Linux 3.10.0–1062.el7.x86_64

Tuesday, April 12, 2022

screen Linux command

 This command is useful in cases where you need to leave some command in the running state, our command history is significantly important

Check if a system already running screens

screen -ls

Create/run a new screen console:

screen -S <screen-in-name>

Re-attach the screen:

screen -r <screen-in-name>

Kill screen session

screen -XS <screen-in-name> quit

useful links:
https://quickref.me/screen

Friday, March 25, 2022

Monday, December 13, 2021

add a user to the Docker group

 if you got an error like this:

$ docker run hello-world
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/create: dial unix /var/run/docker.sock: connect: permission denied.

add a user to the Docker group then

$ sudo usermod -a -G docker $USER
$ mkdir “$HOME”/.docker
$ sudo chmod g+rwx “$HOME/.docker” -R
$ sudo chmod 666 /var/run/docker.sock

Monday, August 9, 2021

check threads or core in Linux

 HW details on Linux (kernel):

echo "Threads/core: $(nproc --all)"            


lscpu | grep CPU


Add disk image to Windows OS on Proxmox

  1) Enter into the Proxmox console 2) Select the VM -> Hardware -> Add -> Hard Disk: 3) Configure the new disk image: 1. Select th...