mediawiki 1.27 – no edit buttons after upgrade

Update from mediawiki 1.16.2 to 1.27

edit bar was present,no images
clicking the empty spaces did work

inspect element -> the background-image css attribute was not showing

Common.css is not present in mediawiki 1.27

ended up with this working solution for all themes:

goto:
http://yourwiki/index.php/MediaWiki:Common.css -> edit

/* CSS placed here will be applied to all skins */

 #mw-editbutton-bold {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_bold.png);
}

  #mw-editbutton-italic {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_italic.png);
}

  #mw-editbutton-link {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_link.png);
}

  #mw-editbutton-extlink {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_extlink.png);
}

  #mw-editbutton-headline {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_headline.png);
}

  #mw-editbutton-image {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_image.png);
}

  #mw-editbutton-media {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_media.png);
}

  #mw-editbutton-nowiki {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_nowiki.png);
}

  #mw-editbutton-signature {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_signature.png);
}

  #mw-editbutton-hr {
        background-image: url(/resources/src/mediawiki.toolbar/images/en/button_hr.png);
}

save, reload page

this css code will be loaded every time on every page, not optimal of course

let me know if there is a better solution for this problem

AIX process coredumps, useful commands

trigger coredump, this kills the process obviously

kill -ABRT <PID>

change coredump directory

syscorepath -p /path

this change is persistent

enable full coredump

chdev -l sys0 -a fullcore=true 

file can be as big as the process in memory
rss colum in

ps waux

but not bigger than the coredump ulimit

to check:

ulimit -c

to change coredump ulimit permanently, change /etc/security/limits

user:
       core = -1

for unlimited

brute force protection, fail2ban owncloud integration

the whole integration is very version dependent

release data:

  • OS: CentOS release 6.7
  • fail2ban: 0.9.3-1.el6.1 from the epel repository
  • owncloud 8.2.0.12
  • owncloud 8.1.0.8

fail2ban-0.8.7.1-1.el6.rf.noarch from official repo had issues with multi ip ban

I don’t recommend a direct fail2ban upgrade, delete the official rpm, move the whole /etc/fail2ban folder to a backup location, and then reinstall the new rpm
iptables-multiport did not work for me after an inplace upgrade

 

 

owncloud configuration

 

/docroot/config/config.php:

add the lines

  'loglevel' => 1,
  'log_type' => 'syslog' ,
  'log_authfailip' => true,

default syslog file is /var/log/messages

 

 

fail2ban configuration

 

/etc/fail2ban/filter.d/owncloud.conf:
[Definition]
failregex= .*ownCloud.*Remote IP: \'<HOST>[')]
ignoreregex =

this is the most important config file, it defines the filter rule, HOST + brackets represent the IP address used later on for the iptables ban
you need to check your rules after every owncloud upgrade and maybe adapt the regex

 

 

here are two sample lines:

owncloud 8.1.0.8:

Dec 15 07:54:20 host ownCloud[5920]: {core} Login failed: 'user' (Remote IP: 'xxx.xxx.xxx.xxx)

owncloud 8.2.0.12:

Dec 14 21:56:25 host ownCloud[10739]: {core} Login failed: 'user' (Remote IP: 'xxx.xxx.xxx.xxx')

as you can see this most likely was a bug in owncloud 8.1.0.8, the regex [‘)] at the end matches ‘ and ) to work with both versions

 

 

/etc/fail2ban/jail.local:

 

[owncloud]
enabled = true
filter  = owncloud
maxretry = 5
bantime  = 7200
logpath = /var/log/messages
action   = iptables-multiport[name=owncloud, port="443,80", protocol=tcp]
sendmail-whois[name=owncloud, dest=recipient@domain.top, sender=sender@domain.top]

so after 5 failed login attempts, the ports 80 and 443 are blocked for the given ip
use the action iptables-allports if you want to block all ports

 

some nice commands to work with I came across:

 

unban IP from fail2ban:

fail2ban-client set owncloud unbanip xxx.xxx.xxx.xxx

this does not work in older versions of fail2ban

 

check regex from fail2ban filter files:

fail2ban-regex /var/log/messages /etc/fail2ban/filter.d/owncloud.conf

 

 

 

credits to this website, it’s for older versions of fail2ban and owncloud, but at least some things worked for me

https://got-tty.org/owncloud-6-sicherheit-durch-fail2ban

Update issues fedora 21 to fedora 22 with fedup

fedup --network 22

you need to specify a proxy server in /etc/dnf/dnf.conf since fedora 22 completely switched to dnf

error message occured:

Using metadata from Mon Nov 30 09:43:54 2015 (0:03:14 hours old)
Error: cannot install both mozjs17-17.0.0-12.fc22.x86_64 and mozjs17-17.0.0-12.fc21.x86_64

 

only way to ged rid of it was

rpm -e --nodeps mozjs17-17.0.0-12.fc21.x86_64

the updater installs mozjs17-17.0.0-12.fc22.x86_64 anyways

 

after the reboot the update went fine, but I was not able to use the mouse cursor or keyboard in gdm

the problem seems to come from the nouveu drivers, so I decided to install the proprietary nvidia driver from their website

you need to disable nouveau module load:

 

vi /etc/modprobe.d/blacklist.conf

blacklist nouveau

 

the nvidia installer asks to create a file himself to prevent the module from loading, but not sure why but it didn’t work, that’s the file:

# cat /etc/modprobe.d/nvidia-installer-disable-nouveau.conf
# generated by nvidia-installer
blacklist nouveau
options nouveau modeset=0

 

then install the NVIDIA drivers, switch to runlevel 3 before you do it

 

./NVIDIA-Linux-x86_64-340.96.run

 

and follow the instructions

convert DVD with all subtitles and audio tracks to mkv on fedora 21

first install handbrake

for compilation from source see my tutorial http://tech.gate.io/install-handbrake-from-source-on-fedora-21/

run ghb, /usr/local/bin is the default binary folder

klick “Source”, select the DVD drive/Video TS or a local Folder

for Subtitles, select “Subtitle” tab, and press “Add All”, or “Add” and choose your subtitle
for Audio tracks select “Audio List”, press “Add All”, or “Add” and choose the audio tracks you want

then select between mkv and mpg4, press “Start”

that’s it

default output folder is your home directory

if your dvd is write protected you need to install libdvdcss, can be downloaded from

http://rpmfind.net/linux/rpm2html/search.php?query=libdvdcss

install handbrake from source on fedora 21

found no repository for fedora 21, so I compiled it from source

download the source code from https://handbrake.fr/downloads.php
after I figured out every dependency, and it has a lot of them, I found a nice site that has listed all of them
https://trac.handbrake.fr/wiki/CompileOnLinux

sudo yum install yasm zlib-devel bzip2-devel libogg-devel libtheora-devel \
libvorbis-devel libsamplerate-devel libxml2-devel fribidi-devel \
freetype-devel fontconfig-devel libass-devel dbus-glib-devel \
libgudev1-devel webkitgtk-devel libnotify-devel \
gstreamer-devel gstreamer-plugins-base-devel

for handbrake gui support

sudo yum groupinstall "Development Tools" "Development Libraries" \
"X Software Development" "GNOME Software Development"
tar -xvzf HandBrake-0.10.2.tar.bz2
cd HandBrake-0.10.2
./configure
cd build
make
make install

it should install to /usr/local/bin per default

Command line client:
/usr/local/bin/HandBrakeCLI

Gui:
/usr/local/bin/ghb

Connectivity check for uri ‘https://fedoraproject.org/static/hotspot.txt’ failed with ‘Could not connect: Network is unreachable’.

Fedora 21 NetworkManager-0.9.10.2-5.fc21.x86_64

Network manager checks for a working internet connection and tries to get https://fedoraproject.org/static/hotspot.txt
behind a proxy, this check does not work, so it needs to be disabled in order to get rid of the syslog error messages

from the man page of NetworkManager.conf

CONNECTIVITY SECTION
This section controls NetworkManager’s optional connectivity checking functionality. This allows NetworkManager to detect whether or not the system can actually access the internet or whether it
is behind a captive portal.

uri
The URI of a web page to periodically request when connectivity is being checked. This page should return the header “X-NetworkManager-Status” with a value of “online”. Alternatively, it’s
body content should be set to “NetworkManager is online”. The body content check can be controlled by the response option. If this option is blank or missing, connectivity checking is
disabled.

interval
Specified in seconds; controls how often connectivity is checked when a network connection exists. If set to 0 connectivity checking is disabled. If missing, the default is 300 seconds.

response
If set controls what body content NetworkManager checks for when requesting the URI for connectivity checking. If missing, defaults to “NetworkManager is online”

does not look like it is possible to specify a proxy server, so the interval needs to be set to 0

/etc/NetworkManager/conf.d/20-connectivity-fedora.conf
[connectivity]
uri=https://fedoraproject.org/static/hotspot.txt
response=OK
interval=0
systemctl restart NetworkManager.service

afterwards

RedHat 6.3 yum update php-mbstring error

--> Finished Dependency Resolution
Error: Package: php-mbstring-5.3.3-14.el6_3.x86_64 (@rhel-6-server-optional-rpms)
           Requires: php-common = 5.3.3-14.el6_3
           Removing: php-common-5.3.3-14.el6_3.x86_64 (@rhel-6-server-rpms)
               php-common = 5.3.3-14.el6_3
           Updated By: php-common-5.3.3-46.el6_6.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-46.el6_6
           Available: php-common-5.3.2-6.el6.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.2-6.el6
           Available: php-common-5.3.2-6.el6_0.1.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.2-6.el6_0.1
           Available: php-common-5.3.3-3.el6.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-3.el6
           Available: php-common-5.3.3-3.el6_1.3.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-3.el6_1.3
           Available: php-common-5.3.3-3.el6_2.5.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-3.el6_2.5
           Available: php-common-5.3.3-3.el6_2.6.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-3.el6_2.6
           Available: php-common-5.3.3-3.el6_2.8.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-3.el6_2.8
           Available: php-common-5.3.3-22.el6.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-22.el6
           Available: php-common-5.3.3-23.el6_4.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-23.el6_4
           Available: php-common-5.3.3-26.el6.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-26.el6
           Available: php-common-5.3.3-27.el6_5.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-27.el6_5
           Available: php-common-5.3.3-27.el6_5.1.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-27.el6_5.1
           Available: php-common-5.3.3-27.el6_5.2.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-27.el6_5.2
           Available: php-common-5.3.3-38.el6.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-38.el6
           Available: php-common-5.3.3-40.el6_6.x86_64 (rhel-6-server-rpms)
               php-common = 5.3.3-40.el6_6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

turned out that the rhel-6-server-optional-rpms repo was not enabled by default, so

yum –enablerepo=rhel-6-server-optional-rpms update did the trick

upgrade owncloud 7.0.4 to 8.1 on centos 6.6

 

first you need to upgrade to php 5.4 at least, which is not part of the standard centos repository at this time
therefore you need to enable the webtatic repository

here I updated directly to php 5.5

install php 5.5 on centos 6.6:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

 

then install yum-plugin-replace

yum install yum-plugin-replace

 

yum replace php-common --replace-with=php55w-common

now download the new owncloud package

 wget https://download.owncloud.org/community/owncloud-8.1.0.tar.bz2

 

extract it, move your old owncloud folder to owncloud_backup

then copy your owncloud_backup/data and owncloud_backup/config/config.php to the new installation:

cp -rp owncloud_backup/data owncloud
cp -rp owncloud_backup/config/config.php owncloud/config

 

memcache is disabled by default in owncloud 8.1, to enable it, install these packages:

yum install php55w-opcache.x86_64
yum install php55w-pecl-apcu.x86_64

 

then edit config.php, add:

  'memcache.local' => '\OC\Memcache\APCu',

 

 

backup your database, in my case mysql:

mysqldump --user=root --password=PWPW --database owncloud > /data/backup/mysql/dump_owncloud_$(date +%Y%m%d%H%M).sql

upgrade the installation, the upgrade on the webpage did not work in my case, got

 

App does not provide an info.xml file

so I did:

cd owncloud
sudo -u apache php occ upgrade

 

worked perfectly

now everything should be up and running

mysqldump fails with Error 2013: Lost connection

the error could have many reasons, but in my case the error just appeared when dumping on a nfs-Share, local disks worked just fine
so I expected no database corruption

the solution was

login to the database as root user

mysql -u root -p
set global net_write_timeout=600;

unfortunately you can’t see the change with the

show variables

command

to make the change persistent,

add

global net_write_timeout=600

to

/etc/my.cnf

location and name depends on the used distribution

OS: CentOS 5.8
mysql: mysql-5.0.95-1.el5_7.1