install MediaWiki and update with git pull


Install:

cd ~/public_html  
git clone https://gerrit.wikimedia.org/r/mediawiki/core.git .  
git clone https://gerrit.wikimedia.org/r/mediawiki/vendor.git  
cd ~/public_html/skins/  
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/CologneBlue  
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Modern  
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/MonoBook  
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/VectorV2  
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Vector  

Update:

for i in `find ~ -type d -name \.git`; do cd `dirname $i` ; git pull ; done  

Example:

-sh-4.2$ find . -type d -name \.git  
./public_html/skins/CologneBlue/.git  
./public_html/skins/Modern/.git  
./public_html/skins/VectorV2/.git  
./public_html/skins/Vector/.git  
./public_html/skins/MonoBook/.git  
./public_html/vendor/.git  
./public_html/.git  

Upgrade DB:
shell/opt/rh/rh-php72/root/usr/bin/php maintenance/update.php

test tst 22

…
Read more ⟶

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  
…
Read more ⟶

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  
…
Read more ⟶

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:

…
Read more ⟶