Recently in Movable Type Category

Banning the spammers

| | Comments (0)

I am getting really tired of the trackback spam. I was looking around in my MySQL administrator and found the tables that Movable Type uses to track tentative trackbacks (mt_tbping) and banned IP addresses (mt_ipbanlist). I wrote up a little SQL to copy IP addresses from unapproved trackback locations to the banned list:

INSERT INTO mt_ipbanlist
(ipbanlist_blog_id, ipbanlist_ip)
SELECT MY_BLOG_ID, tbping_ip
FROM mt_tbping
WHERE tbping_ip <> 'MY_HOST_IP_ADDRESS'
AND tbping_ip NOT IN (
	SELECT ipbanlist_ip 
	FROM mt_ipbanlist
	WHERE ipbanlist_blog_id = MY_BLOG_ID)

Of course, I'll have to check that all unapproved trackbacks are spam first, but I am hoping that the volume drops in time.




2008-08-13: added my list of banned IP addresses, trackback spammers one and all.

Pretty code

| | Comments (0) | TrackBacks (0)

Thanks to several google-translated Japanese Movable Type blog entries [makotokw, kazuno, and tadateto], I've finally figured out how to hack MT to get python code pretty-printed. (To read these Japanese articles, I recommend searching using google and then pressing Translate this page.) The code is downloaded from google and the original idea was from Thomas Guest.

To get this to work, you have to do four things:

  1. Add google's prettify.css stylesheet to your header page template
    <link rel="stylesheet" href="/mt-static/css/prettify.css" type="text/css" />
  2. Add google's prettify.js JavaScript to you header page template
    <script type="text/javascript" src="/mt-static/js/prettify.js"> </script>
  3. Get your body.onload to call prettyPrint()
    <body class="mt-main-index layout-wtt" onload="prettyPrint();">
  4. Mark the sections that you want pretty-printed
    <pre class="prettyprint">

The third step is the most involved. You have to change three templates:

  1. Page
    <MTSetVar name="body_onload" value="prettyPrint();">
    <MTIfCommentsAccepted>
        <$MTSetVar name="body_onload" value="prettyPrint();individualArchivesOnLoad(commenter_name)"$>
    </MTIfCommentsAccepted>
  2. Entry
    <MTSetVar name="body_onload" value="prettyPrint();">
    <MTIfCommentsAccepted><
        $MTSetVar name="body_onload" value="prettyPrint();individualArchivesOnLoad(commenter_name)"$>
    </MTIfCommentsAccepted>
    
  3. Comment Preview
    <MTSetVar name="body_onload" value="prettyPrint();individualArchivesOnLoad(commenter_name)">
    



2008-06-27: Did I say three templates? I meant five. Here are two more templates to change:

  1. Search results
    <MTSetVar name="body_onload" value="prettyPrint();">
    
  2. Archive index
    <MTSetVar name="body_onload" value="prettyPrint();">
    

Movable Type and Webhosting4life.com

| | Comments (0) | TrackBacks (0)

If you are using Movable Type and using WebHosting4Life.com as your ISP, you will not be able to get comments and trackbacks to work until you turn off the WebHosting4Life setting, Security Guard. If, whenever you post a comment on your blog, you get this error message:

Webhost4life Application Firewall Alert

Your request triggered an alert! If you feel that you have received this page in error, please contact the administrator of this web site.

Then you need to do this:

  1. Login to WebHosting4Life.com
  2. Go to Security
  3. Select Security Guard
  4. Set to OFF

It took me three weeks of googling this before I put in the system request and got this fixed. I hope you find this posting sooner.

Comments and tracebacks

| | Comments (0) | TrackBacks (0)
I'm sure this will be hard to understand, but I am still working on getting comments and tracebacks working. I wrestled with getting Image::Magick installed; no luck. Then I worked on getting reCaptcha installed just so I could have some captcha provider in my list. That was impeded by my FTP client hanging up, but once I restarted that, it was fine. So now I don't know what the problem is:
  • reCaptcha is listed as a plugin
  • reCaptcha is selected as my CAPTCHA provider
  • Comments are set to Immediate approve comments from: Anyone
  • Registration is set to Anonymous comments with Require E-mail Address for Anonymous Comments set
  • Web Services setting has a Type Key value obtained from SixApart
  • Entire website has been rebuilt
  • I've followed all the instructions on Adding reCAPTCHA to Movable Type
You'd think it would be fine. So I'll be waiting here for someone to post a comment on how to fix this -- no wait.

MT snafu

| | Comments (0) | TrackBacks (0)

For the past 36 hours, my blog has allowed me to create new content and to preview it, but not to actually be able to see it generated in static HTML files. I finally discovered today that I brought this on myself when I inadvertently set Movable Type to use background publishing.

See the bit where it says that a cron job is needed to do the actual publishing? So if you don't actually have such a cron job, you'll get the result I did: no material published.

But I really think that, notwithstanding that I don't actually read and write Perl, I should have been able to figure this out. The leading clue was that the system log started to report that source code was missing for using TheSchwartz.pm, which even I could see was some sort of multithreaded load-balancer thingee.

Internal callback died with: Can't locate List/Util.pm in @INC (@INC contains: [...].) at [...]\mt\extlib/TheSchwartz.pm line 13.
BEGIN failed--compilation aborted at [...]\mt\extlib/TheSchwartz.pm line 13.
Compilation failed in require at (eval 43) line 3.
...propagated at C:/Perl/lib/base.pm line 62.
BEGIN failed--compilation aborted at lib/MT/TheSchwartz.pm line 10.
Compilation failed in require at lib/MT/WeblogPublisher.pm line 2164.

About this Archive

This page is a archive of recent entries in the Movable Type category.

humor is the previous category.

photos is the next category.

Find recent content on the main index or look in the archives to find all content.