How to enable the FTP server (ftpd) in Lion: PLEASE DON’T

TUAW has a HOWTO on enabling the FTP server in Mac OS X Lion.

Please don’t.

FTP is insecure. Your password can be the single-most unbreakable string in the universe, but it doesn’t matter: it’s sent out over plain text. Moreover, anyone who’s been in the sysadmin game for more than 12 minutes has seen just about every FTP server get cornholed, literally cornholed, multiple times by securtity flaws.

The best thing the “technology community” can do is to actively discourage its use.

FTP over SSL is a better interim solution, if keeping “pure” the FTP protocol is required.

And enough about the damn “extra overhead” of SSH or SSL. We’re talking about a few bytes here, esp. when you’re on a LAN.

The sooner FTP dies, the closer we are to a world of endpoint secure protocols.

TextMate to BBEdit switcher’s guide: BBEdit has command-t now! (well, sorta)

For the full details, see here:  https://groups.google.com/d/topic/bbedit/J5YUlmHsVvM/discussion

Now, this feature is wonderful if you’re a long-time BBEdit user. It’s pretty extra awesome if like me you can only run PeepOpen on some of your Macs. And, for switchers looking for a native way to replicate their beloved cmd-t, it’s not bad.

That said I can totally understand why switchers would say “Not the same, not what I want/need”. My dream was to see them re-use the same dialog as the “Insert Clipping” window, which is just like (or damn near, in any event) TextMate’s window. PeepOpen includes extra functionality like showing SCM status.

Still, you can bind it to cmd-t and it’ll work close enough that your muscle memory might not get too confused. And be sure to check out the even more recent betas; they’ve been doing some big performance improvements (one of the reasons I have always kept BBEdit in my Applications folder, even when I’m trying out another editor or using an IDE for stuff like Java).

Safari 5.1 and “random reload”

So by now, you probably have an iPad. Right? There’s like, eleventy-billion of them sold so far, or something.

At some point you’ve probably been browsing around on the web, and then decided to play some Angry Birds, then back to web browsing. You open up Safari, and there’s the page you were reading; or at least there will be in a moment, because it just reloaded. Some times you can have a couple of “tabs” open, and visiting each in turn forces a page reload.

It’s incredibly annoying, but it makes sense: there’s precious little memory – real and virtual – and so some algorithm decides if a page should be kept in cache or flushed.

Well, Apple decided this was SO. INCREDIBLY. FUCKING. AWESOME. they decided to include it in Safari 5.1 for OS X. If I was using Lion to type this, I’d include the little shit icon/emoji.

Presumably this is some way to stop shitty JavaScripts from leaking and beachballing the entire OS. Or maybe they just thought it “just worked”.

Suffice it to say, many people aren’t happy. It’s finally gotten to me, having had a page reload in front of me while I was using it, with no other tabs open. That’s right: Safari had exactly 1 window with additional tabs and I got a page reload whilst flipping between my editor and the page o’ documentation.

Scuttlebutt is that disabling Java fixes it. I don’t know; in any event I have mission-critical services for work that require both Flash and Java, so I guess I am sort of screwed.

This brings up my eternal gripes with Firefox and Chrome: they annoy me to NO. END. As an example, I can’t get Chrome to set the icon in the Downloads folder, so whatever I last downloaded – disk image, picture, document, whatever – is the default white rectangle in my Dock. Always. That sort of makes the Downloads folder pointless (as a Dock item, anyway, in my humble but correct opinion). I tend to use it rather a lot, so having it not work is a giant poke in the eye.

There’s about 20 other things about Chrome I can’t seem to find an extension to correct. I honestly don’t see how people use it, on Mac OS X anyway, because it’s just covered in sharp edges. Is there anything more popular and yet, more warty and unpleasant?

Oh, right. Firefox. Don’t get me started: every time I open it, some extension is disabled for some reason or another. Now they’ve unveiled a plan to make that worse which is pretty great. I’ve only just figured out how to convince Firefox to stop grabbing the default client preference on my Mac – years after I’d decided Transmit was the best ever.

Anyway.

The point of this rant is that I’m pretty unhappy now with every browser out there. If I can’t find the switch for Safari’s “use the ungodly amounts of RAM I can buy cheaply” setting, what the hell do I do?

Some BBEdit goings on

Some cool stuff in BBEdit-land:

  • BLATANT SELF-PROMOTION: my own BBPackage (AFAIK the only on on the internets!) for better Zend Framework hacking. Now includes completion data and other stuff.
  • Clippings clippings! No longer must you look at page 259 of the manual! Also on Github.

I’ve got a few applescripts in progress, like one to emulate the Surround.vim plugin. I have a few big projects to wrap up at work, hopefully I can find the time to finish them.

TextMate to BBEdit switcher’s guide: Bundles and scripts

The power of TextMate, and the reason many people continue to use it today, are the bundles.

BBEdit 10 supports ‘packages’, although this feature is very new and as far as I know, virtually no one is using it.

That said the feature itself is simply a replication of TM’s bundles concept, but the actual features themselves are available already.

Main Points:

Clippings in BBEdit are Snippets in TM.

Syntaxes are handled by Codeless Language Modules. The biggest different here is that BBEdit syntaxes are not “language aware”. The main point of CLMs are to do syntax highlighting and delimit folds, along with setting the clipping set. There are no “tab triggers” related to the syntax of the current language. You can do a LOT with Clippings to emulate this feature, though, but it’s not as pretty as tab triggers (IMHO).

Commands are a combination of Text Filters and Scripts. The manual covers these in great detail, but the short story is filters accept the selection or document on STDIN, and whatever the script returns replaces the selection or document on STDOUT; scripts simply run a command and the output goes to the special script output window.

There is another big takeaway here, which is BBEdit is incredibly scriptable in AppleScript. The only way to interact with BBEdit-the-application is AppleScript. So, things like “select the word at the insertion point” are only possible via AppleScript, whereas in TextMate you may have alternate methods via bundle scripting. (At least, as I recall, anyway, I haven’t done serious bundle devel on TM in some time)

You can have Clippings call AppleScripts which themselves call shell scripts; and you can use AppleScript to drive just about anything on your Mac. AppleScripts obtuseness and awkward syntax (for many programmers anyway) makes it somewhat unpleasant to work with, but there’s an immense amount of power.

Lastly, be sure to check out the sections on the manual about using AppleScript to override menu items. I mentioned this earlier and it’s another somewhat hidden gem in BBEdit.

 

TextMate to BBEdit switcher’s guide: Command T

What about “Command T”?

In TextMate, cmd-t opens a ‘find file’ dialog, letting users type a few characters of the name of a file in the project and it’ll “drill down”. This is extremely nice for opening files quickly without using the mouse.

Option 1: PeepOpen (most users)

If you have a reasonably modern Mac, you’ll want PeepOpen: https://peepcode.com/products/peepopen. Go buy it right now.

Option 2: The poor sad unfortunates with 32-bit Macs

If like me you use a 32-bit (original) Intel Mac (non-Core 2 Duo), you’re hosed: PeepOpen relies on MacRuby which relies on 64-bit. You might be able to get a version of MacRuby compiled to work under 32-bit (opinions differ as to whether or not it’ll work), but the short answer is “lovers of adventure only”.

So, you can use cmd-d to open files by name; be sure to check “Find all Matches” and, optionally, “Match Wildcards”. This isn’t exact TM cmd-t behavior, but it’s close when you can’t use PeepOpen.

 

Simple BBEdit Menu Scripts

BBEdit allows users to override menu actions with a small bit of AppleScript.

Here’s something really dopey I whipped up to favor Transmit over the built-in FTP/SFTP:

on menuselect()
tell application "Transmit"
activate
end tell
set troof to true
return troof
end menuselect

(Returning true means, override the menu item entirely; returning false fires the menus action after the applescript as run. I don’t think it’s possible to do ‘return true’ in AppleScript.)

Pretty neat. This is an unexplored region of BBEdit with a lot of potential.