<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/1.5.1.3" -->
<rss version="0.92">
<channel>
	<title>Anton Titov's blog</title>
	<link>http://www.titov.net</link>
	<description>Programming / server administration / databases</description>
	<lastBuildDate>Mon, 22 Jan 2007 16:13:13 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>

	<item>
		<title>Date and time addition and substraction</title>
		<description><![CDATA[	Real life example:
SELECT username FROM users WHERE (ADDDATE( last_in_chat,  INTERVAL 2 MINUTE) > NOW()) ORDER BY username LIMIT 30
	NEVER do that. The user in question runs this query on table with 3000+ rows, which means, that SQL server (MySQL in
this case) is doing 3000+ date/time additions and will never use any index. If you [...]]]></description>
		<link>http://www.titov.net/2005/09/15/date-and-time-addition-and-substraction/</link>
	</item>
	<item>
		<title>Front page extensions without mod_frontpage</title>
		<description><![CDATA[	If you have apache server on linux and want to be able to activate front page extensions for virtual hosts but do not want to install mod_frontpage, than you can download this file
	http://www.titov.net/downloads/frontpage.tar.gz
	extract it to /usr/local with
tar -xzf frontpage.tar.gz -C /usr/local
	and than you can install front page extensions like (on a single line):
	/usr/local/frontpage/install /www/titov.net www.titov.net [...]]]></description>
		<link>http://www.titov.net/2005/09/15/front-page-extensions-without-mod_frontpage/</link>
	</item>
	<item>
		<title>&#8220;Do not use ORDER BY RAND()&#8221; or &#8220;How to get random rows from table?&#8221;</title>
		<description><![CDATA[	Quite often people use queries like:
	SELECT quote FROM quotes ORDER BY RAND() LIMIT 1
	to get a random row (rows) from a table. That&#8217;s quite bad idea. For big tables, if your table have just
50-100 rows, use whatever you want. 
	What happens when you run such a query? Let&#8217;s say you run this query on a [...]]]></description>
		<link>http://www.titov.net/2005/09/21/do-not-use-order-by-rand-or-how-to-get-random-rows-from-table/</link>
	</item>
	<item>
		<title>How to check if a hostname is a valid registered nameserver</title>
		<description><![CDATA[	If you need to check for instance if &#8220;ns1.titov.net&#8221; is a registered nameserver and can be filled as nameserver for a domain you can do it this way:
	ask which nameservers are authoritative for zone &#8220;net&#8221; with:
	dig ns net
	in the answer section you will have:
	net.            [...]]]></description>
		<link>http://www.titov.net/2005/10/31/how-to-check-if-a-hostname-is-a-valid-registered-nameserver/</link>
	</item>
	<item>
		<title>PHP forms spam</title>
		<description><![CDATA[	There are many forms on the web, that use PHP mail() function to send mail, most of the time to the site owner. The problem with this is that many of them do not verify submitted data and can be used to trick the script to send mail to any recipient with changed body of [...]]]></description>
		<link>http://www.titov.net/2005/12/01/php-forms-spam/</link>
	</item>
	<item>
		<title>How to restore reiserfs partition from crashed disk</title>
		<description><![CDATA[	Few days ago, a server of mine had all of it&#8217;s 4 disk crashed. The problem was that one of the disks was overheating and that seemed to help other harddrives to crash (don&#8217;t buy Maxtor). 
	So, if you have a case like mine - some partitions with reiserfs on hard drive with bad blocks [...]]]></description>
		<link>http://www.titov.net/2005/12/31/how-to-restore-reiserfs-partition-from-crashed-disk/</link>
	</item>
	<item>
		<title>Using O_LARGEFILE or O_DIRECT on Linux</title>
		<description><![CDATA[	Today after some backups, generated from my C program generated few files exactly 2Gb in size I&#8217;ve remembered that there was some parameter to open for working with large files. I&#8217;ve opened man page for open and read that the option is O_LARGEFILE. I also liked the idea of using O_DIRECT. But when I tried [...]]]></description>
		<link>http://www.titov.net/2006/01/02/using-o_largefile-or-o_direct-on-linux/</link>
	</item>
	<item>
		<title>How to make site screenshots with linux server</title>
		<description><![CDATA[	Ever wanted to be able to create site screenshots, just like alexa? Want to do it on your server with a script? Than read this article.
	The idea is simple: install xvnc on your server, so you&#8217;ll have a virtual X display, than install Opera browser (Firefox does not support -geometry parameter) and finally install ImageMagick [...]]]></description>
		<link>http://www.titov.net/2006/03/19/how-to-make-site-screenshots-with-linux-server/</link>
	</item>
	<item>
		<title>How to force setuid program to make core dump</title>
		<description><![CDATA[	If you want to debug why your C/C++ application segfaults once in a while (daemon that segfaults once in few days) under Linux the obvious way is to tell your program to create core dump files on segfault. It took me few hours to make my program coredump - by default under Linux setuid programs [...]]]></description>
		<link>http://www.titov.net/2006/03/22/how-to-force-setuid-program-to-make-core-dump/</link>
	</item>
	<item>
		<title>How to change maximum sync speed of linux software raid</title>
		<description><![CDATA[	After few unsuccesfull google searches about changing linux software raid sync speed (while waiting for idle CentOS to sync 3&#215;200Gb SATA raid1) I decided to run:
	
ffind /proc/ -name \*raid\*

	which lead me to files /proc/sys/dev/raid/speed_limit_max an /proc/sys/dev/raid/speed_limit_min, which are quite self-explanatory and now I&#8217;m happily syncing with 40Mb/s.

]]></description>
		<link>http://www.titov.net/2006/04/06/how-to-change-maximum-sync-speed-of-linux-software-raid/</link>
	</item>
</channel>
</rss>
