fedora: make gnome title bar smaller
This is a quick tip to make the title bar of gnome a bit smaller. http://blog.samalik.com/make-your-gnome-title-bar-smaller-fedora-24-update/
echo '
window.ssd headerbar.titlebar {
padding-top: 4px;
padding-bottom: 4px;
min-height: 0;
}
window.ssd headerbar.titlebar button.titlebutton {
padding: 0px;
min-height: 0;
min-width: 0;
}
' > ~/.config/gtk-3.0/gtk.css
virtualmin: sieve
yum install dovecot-pigeonhole -y
cp -a /etc/procmailrc{,.orig}
echo '
DELIVER=/usr/libexec/dovecot/deliver
LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
EXITCODE=$?
:0
* ?/bin/test "$EXITCODE" = "73"
/dev/null
EXITCODE=0
:0
* ?/bin/test "$VIRTUALMIN" != ""
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
DEFAULT=$HOME/Maildir/
ORGMAIL=$HOME/Maildir/
DROPPRIVS=yes
:0w
| $DELIVER
:0
$DEFAULT
' > /etc/procmailrc
sed -i "s|protocol lda {|protocol lda {\n mail\_plugins = \$mail\_plugins sieve|" /etc/dovecot/conf.d/15-lda.conf
sed -i "s|^protocols =.*$|protocols = imap sieve|" /etc/dovecot/dovecot.conf
echo '
service managesieve-login {
inet_listener sieve {
port = 4190
}
} ' >> /etc/dovecot/conf.d/20-managesieve.conf
service dovecot restart
virsh: port forwarding
Source:
https://www.redhat.com/archives/libvirt-users/2015-June/msg00033.html
https://www.libvirt.org/hooks.html
mkdir /etc/libvirt/hooks
touch /etc/libvirt/hooks/qemu
chmod 700 /etc/libvirt/hooks/qemu
edit /etc/libvirt/hooks/qemu:
#!/bin/bash
# used some from advanced script to have multiple ports: use an equal number of guest and host ports
# Update the following variables to fit your setup
Guest_name=node001
Guest_ipaddr=192.168.122.181
Host_ipaddr=<external_ip>
Host_port=( '63636' '5555' '5556' '5557' '5558' '5559' '5560' )
Guest_port=( '63636' '5555' '5556' '5557' '5558' '5559' '5560' )
length=$(( ${#Host_port[@]} -- 1 ))
if [ "${1}" = "${Guest_name}" ]; then
if [ "${2}" = "stopped" ] || [ "${2}" = "reconnect" ]; then
for i in `seq 0 $length`; do
iptables -t nat -D PREROUTING -d ${Host\_ipaddr} -p tcp --dport ${Host\_port[$i]} -j DNAT --to ${Guest\_ipaddr}:${Guest\_port[$i]}
iptables -D FORWARD -d ${Guest\_ipaddr}/32 -p tcp -m state --state NEW -m tcp --dport ${Guest\_port[$i]} -j ACCEPT
done
fi
if [ "${2}" = "start" ] || [ "${2}" = "reconnect" ]; then
for i in `seq 0 $length`; do
iptables -t nat -A PREROUTING -d ${Host\_ipaddr} -p tcp --dport ${Host\_port[$i]} -j DNAT --to ${Guest\_ipaddr}:${Guest\_port[$i]}
iptables -I FORWARD -d ${Guest\_ipaddr}/32 -p tcp -m state --state NEW -m tcp --dport ${Guest\_port[$i]} -j ACCEPT
done
fi
fi
Alternative variant:
…PHP: antivirus website check
Автоматизированное сканирование:
Базовая установка:
yum install clamav -y
cd /root/install
rm -rf maldetect-*
wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar xfz maldetect-current.tar.gz
cd maldetect-*
./install.sh
cd ~ && rm -rf /root/install/maldetect-* && rm -rf /etc/cron.daily/maldet
echo ".avi
.jpg
.flv
.png " > /usr/local/maldetect/ignore\_file\_ext
Сканирование:
freshclam ; maldet -u ; maldet -d ;
maldet --scan-all /home/
Ручная проверка на предмет подозрительных файлов:
Подозриельность определяеся наличием следующих комбинаций, которые находятся в одной строке файла:
eval.*str_rot13
eval.*base64_decode
eval.*gzinflate
file\_put\_contents.*base64_decode
base64_encode.*eval
eval.\*(.\*GLOBAL.*(
isset.\*(.\*eval.*(
Однострочники такие:
…