What’s wrong with the Internet – SMTP

SMTP is a text based protocol. I already mentioned that text protocols are evil. It was phrased more nicely in previous posts. Well it can no more be phrased nice. This is stupid! In SMTP it means that binary attachments are encoded using base64 which is part of MIME. Any binary attachment (image, presentation, document, …) you’ve ever sent takes more space in the email. That means it’s slower to send, slower to receive, and wastes more space on the server. The space some people still pay for. I have to remind the reader that such encoding requires additional CPU cycles to handle which in turn increases electricity bills’ totals.

And the additional bonus: ever heard “I have 10M email box but I can’t get an email with 8M attachment from my friend. What’s the problem?”. The correct answer would be the stupidity. Wasted tech support time. They have to explain that 8M attachment can not fit in 10M email box. Try sometime to explain this to someone. Have fun. Extra bonus: Someone pays for this tech support wasted time. Exercise for the reader: figure out who’s paying.

What’s wrong with the Internet – FTP

If I had the powers, I would make it unlawful to use FTP. One of the troublesome protocols. Let alone it’s text based, the semantics are totally screwed. Active and passive mode. Yeah, that totally solves all the problems, right. Especially the 2 sockets (network connections) for file transfer. Is it intentionally so f*cked up to make firewall software much harder to get right? In short, it’s broken. Don’t use it. Let it die slowly.

Use SFTP wherever you can. If you are a system administrator, make the world a favour: never enable FTP on your servers.

What’s wrong with the Internet – HTTP

Why in the world would one want to use text-based protocol? Really. WTF Dudes?
Yes, you can telnet a server on port 80 and debug… maybe. That’s about it.
Wikipedia says: “Binary protocols have the advantage of terseness, which translates into speed of transmission and interpretation”.
Lower costs would be caused by: less electricity used, cheaper hardware at the ends and along the way, less bandwidth.

I would also expect programs to be written in better ways just because of handling a binary protocol. A special library would always be used (I hope). There would probably be less stupid Perl scripts each implementing their own parsing of the query string, HTTP headers, and MIME POST body instead of using existing libraries. It would be much harder. There wouldn’t be less stupid people though… I mean that the same people that wrote those scripts would write some other stupid scripts.

HTTP does not support two-way communication in the way required for current internet applications. Wake up! Internet is mostly about applications these days and much less about documents.

Unfortunately I guess we are stuck because of the costs of upgrading to something better. I predict that we will continue to see increasing number of clever hacks to overcome the limitations of this pre-historic protocol.

What’s wrong with UNIX – configuration

All the programs use their own configuration files. The bad part is that the files have different syntax. This is stupid. Let’s assume one favored multiple files, one or several per application. I’m neutral about this. This could be OK if only they had the same syntax. I would expect one library to be used across all applications to read and write the configurations.

If I understand correctly, Gnome is trying to solve this by using a library. But looking at ~/.gconf/apps I saw big FAIL: it’s XML based.
One could argue about the XML but I’m all anti-XML. You could search the internet for “XML sucks” about that. Maybe I’ll post about that later.
Anyhow the fact that Gnome is doing it differently and not “The UNIX way” just highlights the problem.

Looking at the one-big-stupid-file-to-rule-them-all solution also known as Registry makes it clear that this implementation is plain and simple a failure. So it’s probably not it. Not the way it was implemented anyway.

Just to make clear, I’m not sure what the correct solution is. I just know the solutions I’m aware of suck.

ADSL on Debian

Hi.

Tired of lengthy manuals about ADSL setup, here is a copy+paste (with a bit of editing) from an email I’ve sent once (year 2005).

apt-get install ppp pppoe

### summary of changes ###
file /etc/ppp/options:
    change "auth" to "noauth"
    add "plugin /usr/lib/pppd/2.4.3/rp-pppoe.so"
file /etc/ppp/pap-secrets:
    "MYUSER@MYPROVIDER" * "MYPASSWORD" *
file /etc/ppp/peers/dsl-provider:
    "user" -> "MYUSER@MYPROVIDER"
    on line with "pty" - change eth0 to correct interface
        (eth1 in my case, but should usually be eth0)

manual start:
    pppd call dsl-provider
auto start:
    file /etc/network/interfaces:
        ###
        auto ppp0
        iface ppp0 inet ppp
            provider dsl-provider
        ###
### end of changes ###

Use at your own risk.
Hope that helps.

WordPress SSL small and easy hack

Hi people.
Just installed WordPress (version 2.0.10-1etch3). After the regular installation procedure, the first thing I was trying to do is to configure the SSL.
Being naive, just added Apache alias on another virtual host (which has SSL) to point to the same directory as the original installation.
Oops, that does not work. Googled. Came up with:
http://codex.wordpress.org/Administration_Over_SSL
That page just scared me. It looks too complicated for whatever it does. Spent few additional minutes of search. No satisfying answer.

Here is my small hack which works for me and which should work fine for any installations as long as URI beginnings are the same on both virtual hosts (read same Apache alias, that’s roughly the same thing)
In wp-config.php I’ve added at the end, just before ?> :

wp_cache_add('home_before_ilya', get_option('home'), 'options');
add_filter('option_siteurl', 'ilyas_siteurl');
add_filter('option_home', 'ilyas_siteurl');

function ilyas_siteurl($v) {
    if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
        $s = 's';
    } else {
        $s = '';
    }
    $v = "http$s://{$_SERVER['HTTP_HOST']}/blog";
    return $v;
}

In wp-includes/functions.php in function weblog_ping :
Replace

$home = trailingslashit( get_option('home') );

with

$home = trailingslashit( get_option('home_before_ilya') );

Note that the code was not really tested. All I know is it worked for me. Use at your own risk!
Hope that helps.