Tiplet: PuTTY disconnecting when checking Exim via telnet? (554 SMTP Synchronization Error messages of doom!)

I've been checking the configuration of an Exim mailserver recently; from another server I could connect to the mailserver on port 25 and manually verify addresses. However, using PuTTY on a Windows boxen resulted in immediate "554 SMTP Synchronization Error" messages being shown in PuTTY before the connection was closed. (Protip: set your PuTTY windows to never close on session end; as PuTTY defaults to this, the error message was eluding me for a few minutes).

Checking exim's rejectlog showed this for all the PuTTY connections:

2012-06-08 11:27:12 SMTP protocol synchronization error (input sent without waiting for greeting): rejected connection from H=mypc.rdns.tld [1.2.3.4]:58772 I=[remote.mail.server.ip]:25 input="ÿû\037ÿû ÿû\030ÿû'ÿý\001ÿû\003ÿý\003"

Evidently PuTTY, even in Telnet mode, is sending raw control characters to the server which Exim's balking at. So, if you're using PuTTY, enable Raw mode when connecting on Port 25 (and/or 587, depending on your MTA config). And, in your defaults, in the Session section choose "Close window on exit: Never" then save the settings in the Default Settings preset. Happiness will ensue.

Tiplet: one-click Lock Screen for OS X

It must be in the name... Chris Cook devised an excellent little (Automator-based) scriptlet, self-contained as an .app Obviously (obviously, natch) if you hit Command-Option-Q for Quick User Switch - which is one HELL of a difficult keyboard combo if you can't get your thumb to do the double keypress - plus it will close all open apps and processes and physically end your login session.

Chris Cook's Lock Screen app works great - and still works with 10.5.8 on the MBP1,1 I use at work. Give it a try if you dislike leaving your Mac unlocked whilst you go do other srs bsns.

(I'm also aware that there's umpteen other ways to both lock a workstation and accomplish Fast User Switching without mousing to the option; look here (StackExchange), here (MacWorld) and here (MacWorld again) for starters.

Tiplet: disabling TinyMCE's mangling of YouTube embed code

I've been hacking an install of phpns to make it work a little more neatly with my company's web site (which is a real Frankensite and in BAD need of a rip-and-replace).

Anyway, if you use phpns - or any CMS which uses TinyMCE for WYSIWYG text entry / editing - you'll find that if you embed code like YouTube links in code view, switch back to WYSIWYG view, then switch back to code view again... All your lovely embed codes are gone!

This was really annoying me, so I decided to have a hunt about for a quick 'n dirty solution. After lots of forum reading, a few things were clear:

  • TinyMCE won't let you easily disable its code cleaning / HTML verification, which sucks
  • Even the TinyMCE devs aren't quite sure how to efficiently stop this from happening
  • Trying to fully disable its HTML verification / cleanup routines is nigh-on impossible, the codebase is a spider's web of PHP
  • and by default, it hates all <object> and <embed> tags, even if you have the TinyMCE Flash plugin installed.

This can royally screw with your meticulously-entered YouTube embeds. However, on his blog, Akbar neatly demonstrates a simple but effective method to stop TinyMCE eating your embed code - and all you need to do is add the object and embed tags and possible variables... There's a full demo, with borrowable code, on his web site.

Tiplet: Recovering a 'ghost' domain in DirectAdmin

I added a domain name to an account on one of my DirectAdmin-managed servers yesterday, and when I came to tweak some of its settings a few hours later it had mysteriously disappeared from the domains list in the control panel! (I think this was due to a dirty restart of the core DirectAdmin program, but I'm still not 100% sure). What was strange was that all the files (private and public_html) were still there if I FTPed in, the domain still resolved and loaded if I typed in its URL into a browser - but I couldn't access the control panel settings for it (so no email, no MySQL management etc). A crippled domain.

Even more frustratingly, attempting to rename/delete the domain's folder via FTP or SSH didn't work, and I couldn't re-add the domain to the account as DirectAdmin could (bizarrely) still see that it was already hosting it! Moving/deleting the domain's DNS zone file didn't work, and neither did a DirectAdmin restart. So, Catch 22... What to do? Continue reading "Tiplet: Recovering a 'ghost' domain in DirectAdmin"

I