SSDs and the RAID resync problem

By now, most people know that SSDs have a problem with long term use;their write speed degrades (sometimes dramatically) once enough datain total has been written to the SSD, even if the filesystem has lotsof free space left (because you've written files and then deletedthem). The way around this is for OSes to use the TRIM command to tell SSDs whichparts of the device aren't used by the filesystem.

It recently struck me that this has interesting implications for partof the


Sorting out what 'passive ftp' is

(Because I keep forgetting this and having to straighten it out again inmy own head, it's time to write down the difference between regular ftpand passive ftp).

Ftp has to transport two different things: commands (and statusresponses to them), and the actual ftp data. In a modern protocol, thesetwo things would be multiplexed together over the same TCP connection,but ftp dates from when the Internet was both a much simpler environmentand a much more limited one, so it uses separate


Undo is sometimes not good enough

There is a tendency in programming to consider any spiffy new generalfeature, such as a good infinite undo system, as the way to deal withmany of your program's problems. This is often a mistake, and undo makesa good illustration of why.

(It's easy to see how this happens; you have this powerful system thatyou've invested a lot of effort into, so it's natural to apply it on asmuch as possible. And programmers really like general solutions, because


One thing your mail-sending system should do

If you are for some reason absolutely forced to have a system that willsend email to user-entered addresses (given the principles of modernemail this is not a good idea ,but let's imagine that your management forces you), one of the thingsthat you should absolutely do is make your system so that it won't sendmail to certain user names. Spamming people is one thing; spamming abuse , postmaster , noc , security , and any number of otheradministrative user names is just carelessness.


The somewhat apocryphal history of comments in the Bourne shell

(This is the story as I heard it and learned it in the past. It may ormay not be actually accurate, but then a lot of Unix history is passedaround as folklore, and in some ways the folklore is more important andmore influential than the truth.)

In the beginning, in V7, the Bourne shell didn't actually havecomments. Instead, all it had was : , which is not quite a comment (you can see this for yourself in the V7 shmanpage


The difference in the Bourne shell between : and #

I don't know how people learn the Bourne shell these days, but when Ilearned it, I first encountered ' : ' as a vaguely peculiar second wayof writing comments, one used by some old shell scripts that hung aroundour systems. This is true as far as it goes, which is not necessarilyvery far.

The difference between # and : is that # starts a real commentthat runs to the end of the line, while : is a real command thatjust does nothing (this is


Building true ssh opportunistic connection sharing

OpenSSH has decent basic support for opportunistic connection sharing , but most of this is that ssh will look for anexisting master connection before making a new one. It could do betterand enable a true opportunistic connection sharing mode.

There's two problems with ssh's current support for this, one big andone small. First, being the master connection can keep your ssh running when it would otherwise exit. Second, the master connectionexits immediately when there's no active sessions running over it;there'


How I use ssh's connection sharing feature

Following on the basic overview , here's how Iuse OpenSSH's connection sharing feature.

First, since I hate programs that don't exit when I want them to, Idon't let ssh automatically create connection masters. Instead Ialways explicitly create them myself, so that I can do so in a way thatharmlessly parks them in the background. So while I set a ControlPath (to a value mentioned in the previous entry ),I leave ControlMaster set to no , the default.

When


The basics of ssh's connection sharing feature

Vaguely recent versions of OpenSSH have a feature where you can havemultiple independent sessions running over what is actually oneconnection, even though you ran several separate ssh commands. Theprimary advantage this offers is that new ssh sessions startsignificantly faster, since they don't have to go through all of thecryptography and authentication of a full ssh connection. (As a sidebenefit, there's fewer processes running on either side, since you nolonger need a ssh and an sshd for each active session.)

When


A rule for Internet software

Here is one of the general rules for Internet software:

You cannot count on other people not screwing up.

(You can barely count on you not screwing up.)

Any time you talk to the Internet, you have to assume that someday,the other end will do something that it isn't supposed to by thespecification. People are endlessly creative, which means that sooneror later someone will get pretty much anything wrong that it's possibleto get wrong; for example, they will use permanent HTTP