2014/03/12

Death To Proprietary Drivers

I was working on a CentOS 6 install for work and figured "hey, I should upgrade Mustang to the latest version." Normally this means

yum upgrade
shutdown -r now

Of course that didn't work; Mustang has an APU and uses a proprietary driver from AMD for X.org. I pretty much never use Mustang's console so I didn't notice this for 2 days, when my wife complained about not being able to watch Lost.

After much futzing, I find the error message: symbol lookup error: /usr/lib64/xorg/modules/drivers/fglrx_drv.so: undefined symbol: GlxInitVisuals2D. This means AMD's driver is doing something stupid. I of course can't compile it nor fix it. I tried to download the latest driver, but that refused to install. Curse swear, google google and then I found it.

rpm -ivh http://elrepo.org/linux/elrepo/el6/x86_64/RPMS/elrepo-release-6-6.el6.elrepo.noarch.rpm
rpm -e fglrx64_p_i_c-12.104-1 --nodeps
yum -y install fglrx-x11-drv-32bit fglrx-x11-drv kmod-fglrx
aticonfig --initial

First line installs ELRepo, which you might already have. Second line removes the previous drivers, which conflict with the new ones. The --nodeps is because Adobe really wants OpenGL installed. Third line is the important one, it installs the new drivers and does all the magic to get them working. Yes, the X.org driver needs to install a kernel module. Last line just makes sure that Xorg.conf is set up properly. I'd been playing around in it to try to get it to work.

So Death to Proprietary Drivers! And long live the guys at ELRepo!

2014/01/24

Postfix mail relaying

RHEL 6 (and CentOS) have moved from sendmail to postfix. This is for the most part a Good Thing; sendmail was a mess. However it means I have to learn some new stuff. Specifically, how to convince postfix to relay email through my ISP's SMTP server.

First, I have a VM that does relaying for all my other computers. On this VM, I set up postfix to relay all mail :

# /etc/postfix/main.cf
myorigin = awale.qc.ca
relayhost = smtp.cgocable.ca
inet_interfaces = all
mynetworks = 10.0.0.0/24, 127.0.0.0/8

myorigin means user@localhost becomes user@awale.qc.ca.

relayhost is where email is relayed to.

inet_interfaces means postfix will listen for SMTP on all the VMs networks (default is only localhost).

mynetworks means postfix will trust any email coming from a host on my LAN. Yes, this is not very secure. But I trust my LAN explicitly. I have Wifi on a separate subnet, so anything on my LAN will have to be physically connected to my LAN.

On other computers/VMs, I just need myorigin and relayhost. This last points to the postfix VM, not COGECO.

2013/12/16

Non-exhaustive checklist of signs you have failed your Christmas decorations

If you meet any of the following conditions, you have failed:

Your lights are all one colour

You might think that uniform colours look really IN and DESIGN. I think uniformity is contemptable and that designers need to relearn their colour charts. Seriously, guys, there are more colours out there then white, grey and black.

You have blue lights

The blue lights that came out a few years ago are the colour of death. Where Christmas lights are normally gay fun things, the blue lights suck fun out of your hearts, leaving only sorrow and loneliness.

You only have blue lights

What are you, a 16 year old goth girl who thinks all life is suffering and misery? Did you hire a Dementor to do your decorations?

Your lights are flashing

I could go with an epilepsy joke here but it isn't fit. What I hate about flashing lights is that they aren't random. They have a steady duty cycle, but each controler has a different duty cycle. This means every once 4-5 minutes or so they all sync up and this distracts me to no end.

Your lights imitate icicles

Not only because they are probably all white, but also because real icicles are an annoying sign your roof insulation needs to be fixed.

You don't have enough lights

A half-assed effort looks half-assed. Is half a Christmas going to be fun? Half a Christmas tree? Half of the plum pudding? Half the bottle of rum? OK, so that last one would be fun. At least until the next morning.

You have far to many lights

Even if having your front lawn as bright lit as a prison yard pleases you, please think of our telescopes, vital to the national interest and how light pollution is rendering them useless.

2013/12/13

Fun with perl

Want to help me out? Run the following code:
#!/usr/bin/perl

use strict;
use warnings;

use Data::Dump qw( ddx );
BEGIN { ddx "DIE=", $SIG{__DIE__}; };
use Test::More tests => 1;
BEGIN { ddx "DIE=", $SIG{__DIE__}; };

diag "Perl: ", sprintf "%vd", $^V;
diag "Test::More: $Test::More::VERSION";
pass "one test";

What do you expect $SIG{__DIE__} to contain? Acceptable answers are undef, "" and "DEFAULT". And the answer varies according to what version of perl and what version of Test::More you are running.

Example output:

# DIE=""
1..1
# DIE=sub { "???" }
# Perl: 5.004_05
# Test::More: 0.47
ok 1 - one test
# die:7: ("DIE=", undef)
1..1
# die:9: ("DIE=", "")
# Perl: 5.8.8
# Test::More: 1.001002
ok 1 - one test
# die:7: ("DIE=", undef)
1..1
# die:9: ("DIE=", undef)
# Perl: 5.10.1
# Test::More: 1.001002
ok 1 - one test
1..1
# -:9: ("DIE=", undef)
# Perl: 5.16.2
# Test::More: 1.001002
ok 1 - one test

And yes, I know 5.004 dates from the previous century.

No fun

Trying to get Percona Server 5.6 to work with SphinxSE 2.1.2 was no fun. First off, it used to be that SphinxSE would create a load of .so .la, .a files. Now it just needs ha_sphinx.so. Second off, you have to execute INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so'; This requires grant tables to be on (I generally have them off because it's less trouble and I have networking turned off in MySQL anyway, unless I have replication going). At least this is saved into mysql.plugin so I don't have to do it each time I restart mysqld.

And then, when I get it all set up, I get the following error

ERROR 1429 (HY000): Unable to connect to foreign data source: failed to resolve searchd host (name=localhost)

I'm WTFing just about as hard as I can right now. localhost is in /etc/hosts. It is also in my DNS server. Has MySQL gone insane? Percona? I'll blame Oracle, because they are just mean.

The solution, of course, is ALTER TABLE sphinx CONNECTION='sphinx://127.0.0.1:9312/YCUR';.

2013/10/03

This is what the big boys call uptime.

~ (fil@billy:)$ uptime
 16:07:57 up 1064 days, 16:08,  1 user,  load average: 0.02, 0.06, 0.08
Close to 3 years !

2013/09/19

Taxes and programming.

Just a short and silly note to point out that Canada no longer has piggy-backed sales taxes. PEI and Québec used to calculate provincial sales taxes on the sub-total of sale + the GST (hence the term piggy-back). This led to annoying special code. Well, annoying to programmers at least.

But Québec moved to PST+GST on the January 1st 2013, and PEI moved to HST on April 1st, 2013.