Thursday, February 16, 2023

How to Send an email using Telnet in CentOS

sudo apt install telnet

sudo yum install telnet


telnet targetserver.tld 25


HELO sourceserver.tld 

MAIL FROM: username@sourcedomain.tld

RCPT TO: username@example.com

DATA 
Subject: Sending an email using  SMTP through telnet 
Hi, 
This is just a Test Email ? You may disregard this? 

regards;
Mr. Y

.

Note: We can start writing some subject and body. To do that we need to use the DATA command. First type DATA followed by Subject: and the body. Once done, enter " . "  (without quote)to send the email to be queued.

Wednesday, February 15, 2023

Stop and Disable Firewalld on CentOS 7

sudo firewall-cmd --state

sudo systemctl stop firewalld

sudo systemctl disable firewalld

sudo systemctl mask --now firewalld

Monday, February 13, 2023

Create and Install Self-Signed SSL Certificate on CentOS

yum install openssl

mkdir /etc/[webserver]/ssl

openssl genrsa -out “/etc/[webserver]/ssl/example.key” 2048

openssl req -new -key “/etc/[webserver]/ssl/example.key” \ -out “/etc/[webserver]/ssl/example.csr”


Country Name (2 letter code) [AU]:xx

State or Province Name (full name) [Some-State]:xx xx

Locality Name (eg, city) []:xx

Organization Name (eg, company) [Internet Widgits Pty Ltd]:xx

Organizational Unit Name (eg, section) []:xx

Common Name (e.g. server FQDN or YOUR name) []:example.com

Email Address []:xxx@gmail.com

openssl x509 -req -days 365 -in “/etc/[webserver]/ssl/example.csr” \ -signkey “/etc/[webserver]/ssl/example.key” \ -out “/etc/[webserver]/ssl/example.crt”


Saturday, February 11, 2023

Add Domain specific DKIM in PMTA config

#MTAs

<virtual-mta ip1>

    smtp-source-host 192.198.0.1 host.domain.tld

    <domain *>

        max-msg-rate 400/h

    </domain>

</virtual-mta>

#DKIM Keys

domain-key key1,domain1.tld,/etc/pmta/keys/key1.domain.tld

domain-key key2,domain2.tld,/etc/pmta/keys/key2.domain.tld

domain-key key3,domain3.tld,/etc/pmta/keys/key3.domain.tld

#Specify the DKIM for specific Domain using Directive

<domain domain1.tld>

    dkim-sign yes

    smtp-hosts [127.0.0.1]:587

    dkim-identity @domain1.tld

</domain>

<domain domain2.tld>

    dkim-sign yes

    smtp-hosts [127.0.0.1]:587

    dkim-identity @domain2.tld

</domain>

<domain domain3.tld>

    dkim-sign yes

    smtp-hosts [127.0.0.1]:587

    dkim-identity @domain3.tld

</domain>

#CALL PMTA POOL for Rotation

<virtual-mta-pool pmta-pool>

    virtual-mta ip1

</virtual-mta-pool>


Extract the First Word Using Text Formulas

 =IFERROR(LEFT(A2,FIND(" ",A2)-1),A2)



Sunday, January 29, 2023

Remove both duplicate and original value from Excel or Google sheet

=if(countif(A:A,A1)=1,0,1)


There is a zero or a one in Columns C for each value in Columns A. A zero means that a value from Columns A is not repeating in the data range and should be kept. A one means that there are duplicate values and that row should be deleted. Then filter the rows having One in column C, Select and Delete.

Saturday, January 21, 2023

How to Extend Swap Space using Swap file in Linux

dd if=/dev/zero of=/swap_file bs=1G count=1

sudo fallocate -l 1G /swap_file

chmod 600 /swap_file

mkswap /swap_file

echo "swap_file swap swap defaults 0 0" >> /etc/fstab 
or 
vi /etc/fstab/swap_file swap swap defaults 0 0

swapon /swap_file

Office 2021 Activation using command

  @echo off title Activate Microsoft Office 2021 (ALL versions) for FREE - office.com&cls&echo =====================================...