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

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...