Linux Fun

Today was honestly one of the most mentally exhausting days that I've had in a long time. Rewarding sure as I learned quite a bit, but damn taxing as well. Probably didn't help things that I stayed up until 6 a.m. yesterday working on my Mate project (Its about done though). Here's a bit of an overview of the good stuff I learned today, for personal documentation purposes if nothing else.

.tar.xz files

Never had seen these files until working on the Fedora Mate project; xz files are apparently files compressesed with a LZMA2 algorithm similar to 7-Zip. I had no idea how to deal with these until earlier today so here's the quick rundown.

To extract a .tar.xz run:

tar xJvf <.tar.xz file>

To create a .tar.xz run:

tar cJvf <.tar.xz to create> <files/directories>

Mailman Python Interface

Had no idea on this one until a client at work wanted to block some sort of reverse spammers (haha) from subscribing to one of his Mailman mailing lists using randomly generated mailinator.com addresses. I ended up adding a regex matching any mailinator.com address to the mailing list's ban_list by doing the following:

(All of the programs listed are in Mailman's bin directory)

Find your mailing list name with:

./list_lists -b

Connect to the Python Interface for the list by:

./withlist -il <list name from above>

When connected your prompt will turn to the standard Python Interpreter with the >>>. Run the following commands there:

List the current ban_list:

m.ban_list

will echo

[]

(the ban_list is empty)

Add your banned address or regex pattern with:

m.ban_list.append('^[A-Za-z0-9._]+@mailinator\.com')

Save your ban_list settings:

m.Save()

Unlock the list:

m.Unlock()

Now check to make sure it stuck:

m.ban_list

echoes

['^[A-Za-z0-9._]+@mailinator\\.com']

Once you've got your desired result use CTRL+D to exit back to your regular prompt.

If you want to remove a address/regex from your ban_list use

m.ban_list.remove(address/regex)

instead of

m.ban_list.append(address/regex)

Plesk Failure to Update Messages

If your Plesk Administrator Panel is bugging you about failing to apply updates when you know that's not true you can do the following to clear out the MySQL table it pulls from:

mysql -u admin -p$(cat /etc/psa/.psa.shadow)

Once in the mysql prompt run:

use psa;
truncate longtasks;
exit;

Once that's done no more annoying pink updates failed messages in the panel.

That's all for now folks

Edit (9/13/12): I did realize earlier today that I got the Plesk MySQL root username wrong (its "admin" instead of "root"); that section has been updated accordingly.