Enable touchpad in gdm3 login prompt (Fedora 20)

Enabling tapping support in Gnome 3, I still don’t have support for that at the gdm 3 login prompt .

In /etc/X11/xorg.conf.d/50-synaptics.conf I got tapping support for my mousepad at the gdm3 login prompt by adding

Section "InputClass"
Identifier "touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "TapButton3" "3"
EndSection

The file wasn’t there, so I created it.

Thnx jaisejames.wordpress.com

Fedora (20) enable tuned, save power

I noticed by switching to Fedora, from Ubuntu, my battery time got lower.
I suspect Fedora isn’t as laptop friendly out of the box as Ubuntu is .

Installing Tuned helped a lot on power consumption for my laptop:

$ sudo yum install tuned
$ sudo systemctl enable tuned.service
$ sudo systemctl start tuned.service
$ sudo tuned-adm active

There seem to be a debate whether powersave og balanced is the best option .

Nvidia brightness control fix

If you, like me, got an Nvidia graphics card in your laptop you may have problems with brightness control with recent Nvidia (proprietary) drivers .
First time I came over this is more than a year ago, back then I lost brightness control after upgrading from Nvidia 304.x to anything newer.
Since the working 304.x driver was available then, in my Ubuntu 13.04 (and later 13.10) I never sat down figuring it out.

I recently switched back to Fedora, and they’ve got the same problem.
In Fedora I was also unable to control brightness with the 304 driver as well, I suspect recent versions of the 304.[something above 100] also brake, or there is some combination of Linux kernel version, Nvidia driver version and mabye something else .

There are loads of posts regarding brightness control that brakes, and as far as I can see there are more than one type of problem, f.example I see a lot of fixes that seem to be related to Nvidia Optimus but those solutions doesn’t work for my Quadro 1000m .

Here’s what fixed it for me.

Download nvidiabl from https://github.com/guillaumezin/nvidiabl

$ unzip nvidiabl-master
$ cd nvidiabl-master
$ sudo yum install dkms
$ cd install/tarball/
$ sudo dkms ldtarball --archive=nvidiabl-0.87-source-only.dkms.tar.gz build install
$ sudo echo nvidiabl > /etc/modules-load.d/nvidiabl.conf

That last line will ensure the nvidiabl module is loaded upon booting Fedora .

Now you got a module that you can use a script to echo brightness values into some file in /sys, but you can take this a step further:

(open /etc/default/grub in your favorite editor and append to the GRUB_CMDLINE_LINUX line)
GRUB_CMDLINE_LINUX="[...] acpi_backlight=vendor [...]
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

the acpi_backlight=vendor tells Linux to skip using acpi for brightness and that put nvidiabl in ‘charge’ as the only brightness control module under /sys/class/backlight/ , and in my Fedora 20 running Gnome 3 that magically made brightness control work as it’s supposed to again .

Note that I’ve also got this /etc/X11/xorg.conf

# RPM Fusion - nvidia-xorg.conf
#
Section "Device"
        Identifier  "Videocard0"
        Driver      "nvidia"
        Option "RegistryDwords" "EnableBrightnessControl=1"
        Option          "NoLogo"
EndSection

In my setup with the current nvidiabl module it kind of brakes after suspend / resume, some suspend / resume script fail to set /sys/class/backlight/nvidia_backlight/actual_brightness

I worked around that by telling systemd/system-sleep to unload / load the nvidiabl driver:
/lib/systemd/system-sleep/nvidiabl.sh

#!/bin/sh
case $1 in
    pre)
        /usr/sbin/modprobe -r nvidiabl
        ;;
    post)
        /usr/sbin/modprobe nvidiabl
;;
    *)  echo "ERROR: used incorrectly."
        ;;
esac

Thnx to archlinux.org where I found out about acpi_backlight=vendor .

And I'll paste some of the links I've been at regarding this problem, but there are numerous others that I don't recall at the moment:

https://lists.fedoraproject.org/pipermail/power-management/2013-March/000092.html
https://devtalk.nvidia.com/default/topic/539462/-nvidia-319-12-brightness-controls-not-working-on-laptop-ubuntu-13-03-/?offset=23
https://forums.opensuse.org/showthread.php/494532-Brightness-doesn-t-change-on-openSUSE-13-1-Nvidia-quadro/page2

proftpd: PAM unable to dlopen(/lib64/security/pam_stack.so) in CentOS 6.5

After updating packages in CentOS 6.5 proftpd started logging

proftpd: PAM unable to dlopen(/lib64/security/pam_stack.so)

It seems the proftp pam module is wrong.
The non working /etc/pam.d/proftpd config look like this:

#%PAM-1.0
auth       required     pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth       required     pam_stack.so service=system-auth
auth       required     pam_shells.so
account    required     pam_stack.so service=system-auth
session    required     pam_stack.so service=system-auth

When I instead use the following config, which I found on the internet, I got it working again:

#%PAM-1.0M-1.0
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth required pam_shells.so
auth include system-auth
account include system-auth
session required pam_loginuid.so

sources:
syamkumar-linux.blogspot.no
blog.justla.me

php debug from a sysadmin’s perspective’ish

As I’m helping a dev figuring out a broken wp theme, I came over this, imho, super-tip on howto print contents of a variable to the httpd log file.

In this particular case I’ve narrowed it down to a variable that seem to behave different between a 2 minor wordpress versions.

file_put_contents('php://stderr', print_r($foo, TRUE))

Will print the content of variable $foo to the httpd log, in my case I put that into places in the code to track content for a couple variables in the code, I added a ‘mark’ as well to easily grep it from the weblog

file_put_contents('php://stderr', print_r('Here man: $foo', TRUE));

I found this over at stackoverflow.com

Stuff todo in Ubuntu 14.04 after install

The atareao-team ppa ( Install on your own risk ) got some neat indicators for Ubuntu:

# add-apt-repository ppa:atareao/atareao
# apt-get update
# apt-get install calendar-indicator
# apt-get install my-weather-indicator

The FFmpeg plugin for GStreamer 0.10 is not available in the official Ubuntu 14.04 repositories (because FFMpeg is not available either – libav is used instead) and because of this, Firefox doesn’t support the H.264 codec.
The mc3man trusty-media ppa fix this for you ( Install on your own risk ) .

# add-apt-repository ppa:mc3man/trusty-media
# apt-get update
# apt-get install gstreamer0.10-ffmpeg

You can check you H.264 support at http://www.youtube.com.html5

If you use skype (which is 32bit) and are on 64bit, install these packages to enable support for your default desktop theme as well as enable the skype tray icon

# apt-get install gtk2-engines-murrine:i386 sudo apt-get install gtk2-engines-pixbuf:i386 sni-qt:i386

Latest chromium-browser have removed flash support, the pepper-flash-plugin enable flash :

# pepperflashplugin-nonfree

I mostly ripped off these customizations from webupd8.org .

CentOS 6.x, fail2ban and proftpd

fail2ban in CentOS 6.x can sometimes be a bit troublesome, at least compared to the Debian/Ubuntu implementation (imho) .
I suspect I’ve solved the CentOS 6.x, fail2ban and proftpd integration different every time I’ve set it up so this tim ‘Ill write it down.
With this configuration I got fail2ban to ban failed proftpd ftp login’s with ‘default’ fail2ban config apart from enabling the proftpd-iptables ‘jail’ in /etc/fail2ban/jail.conf

[proftpd-iptables]

enabled  = true
filter   = proftpd
action   = iptables[name=ProFTPD, port=ftp, protocol=tcp]
           sendmail-whois[name=ProFTPD, dest=root@localhost]
logpath  = /var/log/secure
maxretry = 4

What did the trick was to have proftpd to log AUTH to /var/log/secure, in the right format.
In /etc/proftpd.conf comment out the default LogFormat auth directive and add your own:

#LogFormat                      auth    "%v [%P] %h %t \"%r\" %s"
ExtendedLog /var/log/secure AUTH auth
LogFormat auth "%v %t "%r" [%h] %s"

Partition alignment

I’ve known for a while the importance of partition alignment both for raid and for the (not so)new 4k harddrives.
Thinking about sector size of 512 bytes VS. 4k for newer drives, I’ve been a bit puzzled by the fact that 512 bytes x 4 = 4k .
I’ve read articles explaining the size of mbr causing unalignment, but I’ve yet to find an article explaining this issue more clear than http://www.thomas-krenn.com/en/wiki/Partition_Alignment .