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

Error binding socket to :::25, status = EADDRINUSE (Solved)

Centos 
$ yum install net-tools 

Fedora: 
$ sudo dnf install net-tools 

Debian, Ubuntu: 
$ sudo apt install net-tools

netstat -tulpn

netstat -tulpn | grep -w 2500

Result: tcp     0         0 0.0.0.0:2500             0.0.0.0:*

kill 942

Friday, January 20, 2023

Install PMTA Management Console

yum install ntp (if not installed)
=======================
Install PMTAMC
=======================

Upload pmconsole1.5r19 to path /root/PMTA/ and run below commands

cd /root/PMTA/pmconsole1.5r19

rpm -ivh PowerMTA-MC-infrastructure-1.5r19-201906071449.x86_64.rpm

rpm -ivh PowerMTA-MC-1.5r19-201906071449.x86_64.rpm

service pmtamc stop

rm -rf /opt/pmtamc/glassfish/glassfish/domains/domain1/applications/pmtamc/WEB-INF/classes/com/port25/webui/security/Lak.class

cd /root/PMTA/pmconsole1.5r19/opt/pmtamc/glassfish/domains/domain1/applications/j2ee-modules/pmtamc/WEB-INF/classes/com/port25/webui/security

cp Lak.class /opt/pmtamc/glassfish/glassfish/domains/domain1/applications/pmtamc/WEB-INF/classes/com/port25/webui/security

rm -rf /opt/pmtamc/glassfish/glassfish/wars/pmtamc.war

cd /root/PMTA/pmconsole1.5r19/opt/pmtamc/glassfish/wars

cp pmtamc.war /opt/pmtamc/glassfish/glassfish/wars

cd /root/PMTA/pmconsole1.5r19

cp license /etc/pmtamc

service pmtamc start

open ports  (8181 8282 4848 3700 7676 8686)

++++++++++++++++++++++++++++

Register PMTA in PMTAMC

++++++++++++++++++++++++++++

http://examplepmtamc.com:{PORT}/pmtamc/nodemanagement/

PowerMTA Node Registration: Accept new PowerMTAs

pmta register --label={Name} --pmtamc-port={PORT} {HOST}

example

pmta register --label=softo --webmon-port=19000 --pmtamc-port=8181 157.245.221.117

----------------------------------------------------------------------------------------


 

Join Multiple table with subquery

SELECT DISTINCT

    e.card_id,

    e.photo_link,

    c.full_name,

    c.mobile_no,

    c.email,

    c.image_path,

    s.institute_name,

    p.profession_name,

    p.institute_name AS company, 

    i.village_road_present,

    i.post_office_present,

    i.thana_upazila_present,

    i.district_present,

    i.blood_group

FROM EVENT

    e

JOIN(

    SELECT DISTINCT

        id,

        full_name,

        mobile_no,

        email,

        image_path

    FROM

        cualumni

    WHERE

        softdeleted = 'No'

) AS c

ON

    c.id = e.user_id

JOIN(

    SELECT DISTINCT

        user_id,

        institute_name

    FROM

        education

    WHERE

        user_id IS NOT NULL

) AS s

ON

    s.user_id = e.user_id

JOIN(

    SELECT DISTINCT

        user_id,

        profession_name,

        institute_name

    FROM

        profession

    WHERE

        user_id IS NOT NULL

) AS P

ON

    P.user_id = e.user_id

JOIN(

    SELECT DISTINCT

        *

    FROM

        personal_info

    WHERE

        user_id IS NOT NULL

) AS i

ON

    i.user_id = e.user_id

Tuesday, January 3, 2023

Get file path and set hyperlink funtion in Excel

 =CONCATENATE("file://",LEFT(CELL("filename",F2),FIND("[",CELL("filename",F2))-1),F2)

=HYPERLINK($G$2,F2)

Upload file to server using Power Shell Command

 scp file_name.zip username@server_ip/server_address:/directory_path