You are not logged in [login] | [register]

you are here: home » blogs (technical) » languages & databases

SEARCH FOR A FEED

Google
Web RSSMad.com

Searching 190508 articles in 8938 feeds.

RSS CATEGORIES

TELL A FRIEND

Do you like RSS MAD? Why not spread the news and tell a friend about it - it's as easy as filling out this form!

Anton Titov's blog

added: Thu, 23rd March 2006 | 752 views | 0x in favourites
feed url: http://www.titov.net/feed/

Programming articles, system administration and performance tunning tips.

Latest feed entries:

Date and time addition and substraction

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 [...]

Front page extensions without mod_frontpage

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 [...]

“Do not use ORDER BY RAND()” or “How to get random rows from table?”

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’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’s say you run this query on a [...]

How to check if a hostname is a valid registered nameserver

If you need to check for instance if “ns1.titov.net” 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 “net” with: dig ns net in the answer section you will have: net. [...]

PHP forms spam

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 [...]

How to restore reiserfs partition from crashed disk

Few days ago, a server of mine had all of it’s 4 disk crashed. The problem was that one of the disks was overheating and that seemed to help other harddrives to crash (don’t buy Maxtor). So, if you have a case like mine - some partitions with reiserfs on hard drive with bad blocks [...]

Using O_LARGEFILE or O_DIRECT on Linux

Today after some backups, generated from my C program generated few files exactly 2Gb in size I’ve remembered that there was some parameter to open for working with large files. I’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 [...]

How to make site screenshots with linux server

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’ll have a virtual X display, than install Opera browser (Firefox does not support -geometry parameter) and finally install ImageMagick [...]

How to force setuid program to make core dump

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 [...]

ADD A FEED

Is RSS MAD missing something? Tell us about new feeds here.