Friday, April 18, 2008

Recursively convert encoding

for i in `find . -type f -print`;
do
iconv -f CP1251 -t UTF-8 $i -o $i.new;
mv -f $i.new $i;
done

Wednesday, February 20, 2008

Robots/Bots by user agent

This summary is not available. Please click here to view the post.

Tuesday, February 5, 2008

Comma delimited results

In psql, you can do:

regression=# select * from tenk1 limit 2;
unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
8800 | 0 | 0 | 0 | 0 | 0 | 0 | 800 | 800 | 3800 | 8800 | 0 | 1 | MAAAAA | AAAAAA | AAAAxx
1891 | 1 | 1 | 3 | 1 | 11 | 91 | 891 | 1891 | 1891 | 1891 | 182 | 183 | TUAAAA | BAAAAA | HHHHxx
(2 rows)

regression=# \a
Output format is unaligned.
regression=# \f ,
Field separator is ','.
regression=# \t
Showing only tuples.
regression=# select * from tenk1 limit 2;
8800,0,0,0,0,0,0,800,800,3800,8800,0,1,MAAAAA,AAAAAA,AAAAxx
1891,1,1,3,1,11,91,891,1891,1891,1891,182,183,TUAAAA,BAAAAA,HHHHxx
regression=#

Wednesday, September 19, 2007

select only 2-level domains.

select url from d_directories_backlinks where directory_id in (select entry_id from d_directories where lang='ja') and length(split_part(replace(get_host(url),'www.',''),'.',3))=0;

Thursday, September 6, 2007

network monitoring tools

http://nethogs.sourceforge.net/

Just found these great tools. the nethogs allows to measure the b/w by process id that is really helpful.

Sunday, July 8, 2007

Tuesday, May 29, 2007

make fonts to be smooth in kubuntu linux

emacs /home/user/.fonts.conf


<?xml version="1.0″ ?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

<match target="font">

<edit name="autohint" mode="assign">

<bool>true</bool>

</edit>


</match>

</fontconfig>