global distribution system (CDS)

October 1, 2009 by paragasu

many website like tripadvisor.com or lastminutes.com pull the information from CDS. One free provider is Kayak.com but usage is restricted to 1000 queries/day.

kayak.com
airline reservation system
Hotel booking system

jquery open new window on external links

September 30, 2009 by paragasu

$("a:not([href^='http://www.exampleuri.com']): not([href^='#']):not([href^='/'])").attr("target","_blank");

ncftp – upload recrusive files

September 25, 2009 by paragasu

to upload the whole directory and subdirectory


$ncftpput -u <username> -p <password> -R <host> <remotedir> <localdir>

Bucardo – Asynchronous PostgreSQL Replication System

September 25, 2009 by paragasu

Bucardo is an asynchronous PostgreSQL replication system, allowing for both multi-master and multi-slave operations. It was developed at Backcountry.com by Jon Jensen and Greg Sabino Mullane of End Point Corporation, and is now in use at many other organizations.


bucardo

postgresql version of mysql UNIX_TIMESTAMP()

September 24, 2009 by paragasu

MySQL

mysql> SELECT UNIX_TIMESTAMP();
mysql> SELECT UNIX_TIMESTAMP('1973-11-29 21:33:09');

PostgreSQL

postgres=> SELECT EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0));
postgres=> SELECT EXTRACT(EPOCH FROM TIMESTAMP '1973-11-29 21:33:09');

MySQL from_unixtime and unix_timestamp

E319: Sorry, the command is not available in this version: syntax on

September 7, 2009 by paragasu

if you get this error when trying to enable syntax highlighting in vim,


#apt-get install vim

css rounded corner

September 3, 2009 by paragasu


.roundcorner{
border-radius:6px; /*css3 - but not supported yet*/
-webkit-border-radius: 6px; /*mozila - firefox, iceweasel */
-moz-border-radius: 6px; /*webkit - google crome, midori, safari */
}

and more

-moz-border-radius-topleft / -webkit-border-top-left-radius

postgresql add on delete cascade to foreign key

September 2, 2009 by paragasu


ERROR: update or delete on table "page" violates foreign key constraint "info_page_id_fkey" on table "info" DETAIL: Key (page_id)=(106) is still referenced from table "info"

you have to drop cascade and recreating the new one.

psql> \d info


psql> alter table info drop constraint info_page_id_fkey;
psql> alter table info add constraint "info_page_id_fkey" foreign key(page_id) references page on delete cascade;

chess in debian

August 9, 2009 by paragasu

Crafty, developed by Robert Hyatt, is a descendant of the Cray Blitz chess engine that was the World Computer Chess Champion from 1983 to 1989.

to install

#apt-get install crafty xboard

start the game with

$xboard -fcb 'crafty' -fd crafty_directory

book off — This options disables the use of opening book for crafty.
ponder off – Crafty can’t think while you are playing your move.
st 1 — Make the maximum thinking time for Crafty just one second.
sd n — Crafty won’t think more than n moves ahead.
If you are able to beat crafty too often, you can also make it more stronger with these options:
hash nK — Makes the hash table bigger
hashp n — Makes the hash table for pawns as large as possible

it hard to bet.


more info