Thursday, October 11, 2012

Wordpress Image Scaling Incorrect

I just noticed that Wordpress is not resizing images correctly: It would appear correct in the blog itself, but the IMG SRC tag would link to the original, unscaled image: This meant that the image was downloaded at the maximum size and scaled on the client side. I never really noticed this because modern PC's - even my outdated one - have enough processing power to just do it on the fly and browsers use quality scaling filters that smooth out the pictures.

Still, it makes the site unnecessarily slow. After some investigation, I found out that it looks like Wordpress uses 32MB of memory by default - and that's really not much.

Editing your wp-config.php file, you can add the line:

define('WP_MEMORY_LIMIT', '96M');

to increase the limit. I decided on 96MB for a start, but maybe 64MB will be enough for you - I'll leave that to you.

Anyway, now Wordpress scales images I upload correctly. It won't fix older images, but I can live with the big pictures in my archives.

Monday, August 20, 2012

NFS: "bad superblock"

If you're getting a "bad superblock" error message when attempting to mount an NFS volume, make sure that you have portmapper installed and running.

Wednesday, March 7, 2012

Using Excel (and OpenOffice) to Create Timelines

Looking for a way to easily and automatically create timelines, I came across an awesome post by Jon Witwer: How to Create a Timeline in Excel.

It's not exactly the same in OpenOffice, but it works too (I tested it with LibreOffice, actually).

Sunday, March 4, 2012

Postfix error - fatal: parameter "smtpd_recipient_restrictions"

I encountered this error when I added a check_sender_access clause to my smtpd_recipient_restrictions in postfixes "main.cf":
fatal: parameter “smtpd_recipient_restrictions”: specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit.

I haven't really checked, but I am guessing this is because smtpd_recipient_restrictions as the last clause isn't specifically rejecting all mails that aren't wanted, and so you risk turning your system into an open relay. I did as the error advised, adding reject_unauth_destination to my restrictions, and all was well.

Wednesday, January 18, 2012

Excel Formula to get Number of Days in a Month

It seems Excel still can't tell me the days in a particular month.

The following formula works, though:

=DAY(DATE(YEAR(A1),MONTH(A1)+1,1)-1)

Obviously, A1 has to have a date in it.

Works like a charm:




 Update, much, much later: Looks like LibreOffice has a DAYSINMONTH function.