Linux

View changelog for a package in Fedora/CentOS/Redhat

A really cool, and handy, feature of rpm is the ability to view the changelog for a package you’ve installed, or recently updated:

$ rpm -q --changelog gnome-shell | less

* Wed Apr 16 2014 Florian Müllner <fmuellner@redhat.com> - 3.8.4-32
- Improve vertical monitor layouts
  Resolves: rhbz#1096186

* Wed Mar 19 2014 Florian Müllner <fmuellner@redhat.com> - 3.8.4-31
- Fix some more background memory leaks
  Resolves: rhbz#1027192

* Wed Mar 12 2014 Ray Strode <rstrode@redhat.com> 3.8.4-30
- Fix automatic shield lifting when smartcard is inserted
  Resolves: #1063488

* Mon Mar 10 2014 Ray Strode <rstrode@redhat.com> 3.8.4-29
- Don't show user list if require smartcard is true
  Resolves: #1063390

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_brightnessto 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

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"

Ubuntu 13.10 console resolution

Switching to the binary Nvidia driver usually ‘break’ the nice boot splash and console resolution in Ubuntu. It has something to do with Linux being gpl licensed and the kernel code will be tainted if you integrate non-gpl code / or the kernel crew simply won’t integrate binary code, which I personally respect .

I’ve been using some VESA framebuffer since like for many years, and for the last 3-4 years I’ve been using the uvesafb module to get high resolution console and boot splash on my desktop.
I just noticed my ‘howto’ for getting this stuff setup in Ubuntu 13.10 no longer works, well it did actually work but I was put off when the ‘hwinfo’ package no longer was available.

I google’ed this for about 20 minutes, and tried a couple solutions that didn’t work, so I’m pasting my personal ‘howto’ on how I got this working on my 13.10.

# apt-get install v86d

Reboot, and in grub type ‘c’, then type ‘vbeinfo’ to list resolutions supported by your card.

Edit your /etc/default/grub file and make sure you use your desired resolution and bit depth listed from ‘vbeinfo’

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1280x800x32,mtrr=3,scroll=ywrap"

Now scroll down a bit in that file and edit this line also to match your previous change

GRUB_GFXMODE=1280x800

Now force the use of framebuffer

# echo FRAMEBUFFER=y | tee /etc/initramfs-tools/conf.d/splash

Now update grub and your initramfs image and you’re done!

# update-grub2 && update-initramfs -u

What I used to do was installing hwinfo which would show me supported console resolutions from terminal in my X session (Unity in my case), but since Ubuntu 13.10 has dropped support for HAL ( if I got it right) that package is no longer available.
I kind of solved it with vbeinfo from within grub, but that isn’t really optimal since vbeinfo listed a lot more resolutions than could fit within 1 page, and I couldn’t pipe that command to less. Luckily I saw one of the resolutions I wanted to use so that wasn’t really a problem after all.

Note that since I’m using the uvesafb, I don’t get like really hardware accelerated console, and that if I use 1920x1080x32 which my card supports as a maximum, stuff get imho a bit slow. That is, text rolling off screen is slow and a bit stuttering.
I’ve found that 1280×800 is a perfect compromise in my case.