čtvrtek 15. prosince 2022

texmaker compilation (CentOS Stream release 8)

 After system update, the old compiled texmaker refuses start: 

texmaker: /lib64/libQt5Core.so.5: version `Qt_5.15.2_PRIVATE_API' not found (required by texmaker)

Compiled Fedora rpm versions (35, 36) do not work as well.

Simple recompilation of texmaker-5.0.4 fails due to old qt5 version (QT>=5.7 is necessary).

Thus:


dnf install qt6-qtbase-devel
dnf install qt6-qt5compat-devel
error: Unknown module(s) in QT: qml

https://stackoverflow.com/questions/39390824/error-unknown-modules-in-qt-qml-quick-qt-creator

dnf install qt6-qtbase-private-devel

(still errors: missing  qabstractitemmodel_p.h , see )

dnf install qt6-qtdeclarative-devel




wget https://www.xm1math.net/texmaker/texmaker-5.1.3.tar.bz2
tar xjf texmaker-5.1.3.tar.bz2 && cd texmaker-5.1.3

qmake6
make -j 6

make install

úterý 4. října 2022

Dochazka3000 pod wine + mysql

Dochazka 3000 pod wine

1. kopie beziciho stromu (c:\apache) do .wine/drive_c/
2. editace https.conf:
ServerRoot "c:/apache"
Listen 8000
Port 8000
DocumentRoot "c:/apache/htdocs"
 

#Action application/x-httpd-php /php/php.exe
# ScriptAlias /cgi-bin/ "c:/apache/cgi-bin/"
# ScriptAlias /php/ "php/"
LoadModule php5_module "c:/apache/php/php5apache.dll"
AddModule mod_php5.c
#Action application/x-httpd-php /php/php.exe


3. edit apache/php/php.ini
extension_dir = "c:/apache/php/ext/"
 

4. link /apache/php/php.ini -> c:/windows/php.ini
(php.ini je hledano tam)

5. link dll knihoven
/apache/php/*dll ->/windows/
(nechtelo to najit libmysql.dll)

6. Konfigurace databazoveho systemu:
CREATE DATABASE `db003444` DEFAULT CHARACTER SET latin1 COLLATE latin1_bin;
grant all on * to 'rrrt'@'localhost' ;
grant usage on * to 'rrrt'@'localhost' ;
 

import zalohy databaze.

time mysql -u rrrt db003444 < data-20140531.sql

zmenit v access.php  user root na rrrt

úterý 2. února 2021

iscsi target/initiator centos8/fedora33

 target (server): centos 8


dnf install targetcli

targetcli

/backstores/block create isdd /dev/sdd
cd /iscsi
create iqn.2001-04.com.linux:issd:lc-node1

cd iqn.2001-04.com.linux:issd:lc-node1/tpg1/luns
create /backstores/block/isdd

cd ../acls
create iqn.2001-04.com.linux:issd:lc-node1

cd ../portals  # pokud je potreba - lepe omezit firewallem
 delete 0.0.0.0 3260
 create 172.25.... 3260  #(lokalni IP - "listen to")

exit

firewall-cmd --zone=dmz --permanent --add-port=3260/tcp
firewall-cmd --reload

systemctl restart target
#systemctl restart iscsid #tohle asi neni potreba
#systemctl restart iscsi. # tohle asi neni potreba

#test
ss -napt |grep 3260

initiator: fedora33
----------
klient:
vim /etc/iscsi/iscsid.conf #zde nastavit prihlsovani pres CHAP, jmeno a heslo (neni nutne, neni nstaveno na serveru)
vim /etc/iscsi/initiatorname.iscsi #zde nastavit InitiatorName:
    InitiatorName=iqn.2001-04.com.linux:issd:lc-node1

systemctl restart iscsi
systemctl restart iscsid

iscsiadm -m discovery -t sendtargets -p 192.168.206.34
iscsiadm --mode node --targetname iqn.2001-04.com.linux:issd:lc-node1  --login

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

zdroje:

https://www.root.cz/clanky/cluster-na-linuxu-sdilene-uloziste-pomoci-iscsi-a-multipathingu/

 https://www.thegeekdiary.com/how-to-configure-iscsi-target-and-initiator-using-targetcli-in-centos-rhel-7/

 

(stary pristup pomoci tgt-admin: http://linux-training.be/storage/ch13.html )



úterý 19. listopadu 2019

SMTP server - send email via telnet

To send e-mail via telnet (and test the smtp server setup):

telnet smtp.example.com 25 

helo smtp.example.com
mail from:<user@example.com>
rcpt to:<user2@customer.com>
data
From: test@mydomain.com
Subject: test mail from command line

this is test number 1
sent from linux box
.
quit

For starttls:

 ehlo smtp.example.com

středa 24. července 2019

flooded /var/log/messages by "slice" messages


flooded /var/log/messages by "slice" messages

Thanks to: https://www.golinuxhub.com/2017/12/how-to-redirect-specific-log-messages.html

Create separate configuration file inside /etc/rsyslog.d
 # touch /etc/rsyslog.d/rsyslog_loginauth.conf

# vim /etc/rsyslog.d/rsyslog_loginauth.conf
if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-") then /var/log/login_auth
& stop

Next restart the rsyslog service
# systemctl restart rsyslog
The log messages will be redirected to /var/log/login_auth .

For rotation of the new log file: add to the top of  /etc/logrortate.d/syslog
# vim /etc/logrotate.d/syslog

/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
/var/log/login_auth
{ ...

úterý 18. června 2019

auditing for samba

Auditing for samba -  the procedure follows guide available here: http://a32.me/2009/10/samba-audit-trail/

Adapt the /etc/samba/smb.conf :

[global]
# Audit settings
        full_audit:prefix = %u|%I|%S
        full_audit:failure = connect
        full_audit:success = connect disconnect opendir mkdir rmdir closedir open close read pread write pwrite sendfile rename unlink chmod fchmod chown fchown chdir ftruncate lock symlink readlink link mknod realpath
        full_audit:facility = local5
        full_audit:priority = notice

then for each share:

[samba]
        ...
        vfs objects = full_audit

and restart the samba daemon

systemctl restart smb

The logged information is going to be stored using syslog. For Centos this regards rsyslog, /etc/rsyslog.d/smb-audit.conf :

local5.notice /var/log/samba/audit.log 
& ~

or, for newer rsyslog installations

local5.notice /var/log/samba/audit.log 
& stop

and restart rsyslog daemon

systemctl restart rsyslog

Finally, the logfile rotation in /etc/logrotate.d/samba is already active for all files in /var/log/samba/*

/var/log/samba/* {
    notifempty
    olddir /var/log/samba/old
    missingok
    sharedscripts
    copytruncate
    compress
}

Logrotate is run automatically by cron, no restart is necessary.

čtvrtek 13. prosince 2018

failed array in LVM

unmount fs:
]# umount /data

check size of the failed array
]# cat /proc/mdstat
md127 : active raid1 sdi1[3]
      3906886464 blocks super 1.2 [2/1] [_U]
      bitmap: 30/30 pages [120KB], 65536KB chunk

size in gigabytes:
 $((3906886464/1024/1024)) = 3725(G)

check filesystem and reduce the LV
]# e2fsck -f /dev/mapper/titdata1-data1
]# lvreduce --resizefs -L -3800G /dev/mapper/titdata1-data1

reduce CG :
]#  vgreduce titdata1 /dev/md127
   --- failed, because the array was originally /dev/md1 (this is also specified in /etc/mdadm.conf)

]# ln /dev/md127 /dev/md1

free /dev/md1 in VG
]# pvmove /dev/md1
]# vgreduce titdata1 /dev/md1
]# lvextend -l +100%FREE /dev/mapper/titdata1-data1
]# resize2fs /dev/mapper/titdata1-data1
]# e2fsck -f /dev/mapper/titdata1-data1