This article is pretty good for the basics of optimizing php and mysql. Also, i’m testing out posting to the blog directly from Digg.
Category: General
Illegal XML Characters
When you’re working with XML, there are certain characters that are considered “illegal” The following is a potentially incomplete list of characters — I’m not an expert on text, unicode, utf-8, or the like. All i know is that I have to filter these characters out of any string that i send in a SOAP call in Java.
These are the java character codes, provided, for convenience, in a Java array.
private static final char[] XML_ILLEGALS = new char[] { 0x00, //0
0x01, //1
0x02, //2
0x03, //3
0x04, //4
0x05, //5
0x06, //6
0x07, //7
0x08, //8
0x0B, //11
0x0C, //12
0x0E, //14
0x0F, //15
0x10, //16
0x11, //17
0x12, //18
0x13, //19
0x14, //20
0x15, //21
0x16, //22
0x17, //23
0x18, //24
0x19, //25
0x1A, //26
0x1B, //27
0x1C, //28
0x1D, //29
0x1E, //30
0x1F //31
};
Note that when doing RSS, there are other illegal characters, like ampersand, which need to be escaped through encoding, but not all encoding is supported everywhere.
For example, “Oslash” referenced by the w3c here has an acceptable encoding. However, when in an rss xml feed parsed by firefox, it’s “not ok”
Resolution to follow.
Tips for Debian
Here are two things that I think are important, or at least they became important for me, with configuring a debian server.
First off, the debian box I’m configuring is behind a linksys NAT firewall/router.
Secondly, the users of the system are not on the same network (they are one ip address off in the ‘private’ network, separate from the ‘public’ network)
Ok, now for the problems: logging in w/ ssh is SLOW and sending mail out is SLOW.
The solutions:
1) add “UseDNS no” to your /etc/ssh/sshd_config file. Then, restart ssh. This causes sshd to not perform reverse dns lookups on each host that logs in. The “slowness” is that there is no dns entry, and the lookup has to time out before it will let users log in. If the problem is still not fixed, try upgrading to a new version of your software — I’ve heard problems with PAM authentication mucking with things (and this has been fixed).
2) in /etc/exim4/exim4.conf.template, comment out the line that says “host_lookup = *” Then run update-exim4.conf and restart exim. This does the same thing as the sshd trick. You can also try changing “rfc1413_query_timeout” to “0s”
Hope this helps someone!
Yahoo Music Engine says something appropriate
I just thought it was funny to see this song, and have the Y!ME tell me, “there are no similar songs”
I’m used to seeing this message for some of the genre songs i’m looking through, but I got to this, and I had to say, “you know, you’re right. there is nothing like this.”
Google News to RSS Feed Converter
This afternoon, I was really frustrated. I found an article I liked while looking through some financial sites, and I realized, “hey, i want to SUBSCRIBE to this article”
Well, i went to google news, thinking, “of course, they probably already have rss feeds of news searches, just like technorati lets you have of blog space.” Well, I couldn’t find it, so I looked around and found a couple tools, including RSSgenr8 by XMLHub.com. Then, in an hour or so I cooked together a little tool for me to use to track some news stories via my bloglines account.
Anyway, if it’s useful to me, it’s probably useful to someone else. If others find it useful, I may make the code look nice and release it as GPL.
For now, you can try it out: rss-a-tron-o-matic
Edit: Removed Link, google news supports RSS now.