Aici veti gasi detalii tehnice despre cum se pot realiza configurari software+ hardware.
Here you can find tehnical details about software/hardware configuration.

duminică, 11 februarie 2024

Opennms Error "Caused by: org.opennms.core.schema.MigrationException: an error occurred getting the version from the database"

 This error is beacause installer (/opt/opennms/bin/install -dis) can't connect to postgresql server with standard user.

In many cases to fix this error we need to create a postgresl user and database.


systemctl start postgresql
su - postgres -c "createuser -P opennms"
su - postgres -c "createdb -O opennms opennms"
su - postgres -c "psql -U postgres"
 
After that we need to edit the following config file to modify username/password 
 vi /etc/opennms/opennms-datasources.xml    or
vi /opt/opennms/etc/opennms-datasources.xml 
 
In many cases we need to edit the posegresql config file
 /var/lib/pgsql/data/pg_hba.conf with:
 
##local   all             all                                     peer
local all all trust
 
##host    all             all             127.0.0.1/32            ident
host all all 127.0.0.1/32 trust
 
 
You need to add port 8980 in firewall
root@localhost:~# firewall-cmd --permanent --add-port=8980/tcp
success
root@localhost:~# systemctl restart firewalld 

vineri, 2 februarie 2024

Integrate spamassasin into postfix mail server

 

bash script to rewrite spam method

This is a simple method to integrate SpamAssassin. All spam e-mail will still come through to your address(es), but it will be clearly marked as spam.

1) Create a bash script to receive e-mail from Postfix and pipe it to SpamAssassin for rewriting. Then forward the rewritten version to Postfix's sendmail implementation:

{{{#!highlight bash
#!/bin/bash
#
# spamfilter.sh
#
# Simple filter to plug SpamAssassin into the Postfix MTA
#
# Modified by Jeremy Morton
#
# This script should probably live at /usr/bin/spamfilter.sh
# ... and have 'chown root:root' and 'chmod 755' applied to it.
#
# For use with:
# Postfix 20010228 or later
# SpamAssassin 2.42 or later

# Note: Modify the file locations to suit your particular
# server and installation of SpamAssassin.
# File locations:
# (CHANGE AS REQUIRED TO SUIT YOUR SERVER) SENDMAIL=/usr/sbin/sendmail SPAMASSASSIN=/usr/bin/spamc

logger <<<"Spam filter piping to SpamAssassin, then to: $SENDMAIL $@"
${SPAMASSASSIN} | ${SENDMAIL} "$@"

exit $?
}}}
This, of course, assumes you're using the spamd/spamc implementation of SpamAssassin to improve performance - spamc is the command you'll want to invoke to check an e-mail (by setting SPAMASSASSIN to its location).

2) Ensure the newly-created /usr/bin/spamfilter.sh has correct permissions (0755), and is owned by root:root.

3) Modify the /etc/postfix/master.cf file; first, change the first 'smtp' line of the file to:

smtp      inet  n       -       -       -       -       smtpd -o content_filter=spamfilter

Then, add the following (a call to our newly-created spamfilter script) at the end:

spamfilter
          unix  -       n       n       -       -       pipe
   flags=Rq user=spamd argv=/usr/bin/spamfilter.sh -oi -f ${sender} ${recipient}

This setup assumes you have a 'spamd' user for the script to be run as. If you wish to run it as a different user, modify the 'user' argument above.

4) Restart the Postfix service.

Now, Postfix should be sending every incoming e-mail through the spamfilter.sh script (which means it's going through SpamAssassin), with the e-mail headers (and maybe the rest of the e-mail, if it's spam) being rewritten before being delivered to the target mailbox. Optionally, you may wish to tweak SpamAssassin's configuration to cause it to rewrite the e-mails in a more useful way (only rewrite spam mail subject but not whole e-mail, add a 'ham' header to give detailed info on even non-spam, etc.)

5) (optional) Tweak SpamAssasin's configuration. Ensure that the below is in /etc/mail/spamassassin/local.cf and then restart SpamAssassin:

# Rewrite the subject of suspected spam e-mails
#rewrite_header Subject *****SPAM*****
rewrite_header Subject *****SPAM***** (_SCORE_)
# Just add an X-Spam-Report header to suspected spam, rather than rewriting the content of the e-mail
report_safe 0
# Also we want to add a detailed ham report header to even e-mail that ISN'T suspected to be spam
add_header ham HAM-Report _REPORT_
# Set the threshold at which a message is considered spam (3 is usually sufficient)
required_score 3.0
 
Source 

sâmbătă, 13 ianuarie 2024

Convert vmdk disk to vhd

 To convert vmdk to vhd you can use hyper-v tool but in many cases not work.

Another way to convert the disk is with VBoxManage.exe

When I export VM disk from ESXi, the OS give me two files.

In my case Win10.vmdk is with descriptors and Win10-flat.vmdk is the image of virtual machine

=========================================================

f:\VM>dir

 Volume in drive F has no label.

 Volume Serial Number is 5640-B933


 Directory of f:\VM


01/13/2024  05:14 PM    <DIR>          .

01/13/2024  05:14 PM    <DIR>          ..

01/13/2024  03:49 PM    85,899,345,920 Win10-flat.vmdk

01/13/2024  03:36 PM               501 Win10.vmdk

               2 File(s) 85,899,346,421 bytes

               2 Dir(s)  815,193,800,704 bytes free

======================================================

In this moment I try to convert image to vhd format with following command:


c:\Program Files\Oracle\VirtualBox>VBoxManage.exe clonehd --format vhd f:\WM\Win10.vmdk f:\VM\win10.vhd

0%...10%...20%...30%...

Map


Visitor Map