Friday, March 23, 2007

restore mysql database table from Microsoft file

load data infile '/var/www/_system_/htdocs/sites.csv' into table sites fields terminated by ';' ENCLOSED by '"' LINES TERMINATED BY '\r\n' STARTING BY '';

Thursday, March 22, 2007

pg_autovacuum usage

this is how i use autovacuum.
pg_autovacuum -v 3 -V 0.001 -a 2 -A 0.01 -U user password -d 3 -s 100

usage: pg_autovacuum
[-D] Daemonize (Detach from tty and run in the background)
[-d] debug (debug level=0,1,2,3; default=0)
[-s] sleep base value (default=300)
[-S] sleep scaling factor (default=2.000000)
[-v] vacuum base threshold (default=1000)
[-V] vacuum scaling factor (default=2.000000)
[-a] analyze base threshold (default=500)
[-A] analyze scaling factor (default=1.000000)
[-L] logfile (default=none)
[-c] vacuum_cost_delay (default=none)
[-C] vacuum_cost_page_hit (default=none)
[-m] vacuum_cost_page_miss (default=none)
[-n] vacuum_cost_page_dirty (default=none)
[-l] vacuum_cost_limit (default=none)
[-U] username (libpq default)
[-P] password (libpq default)
[-H] host (libpq default)
[-p] port (libpq default)

Saturday, March 17, 2007

http(s) over ssh tunnelling

if machine A stands in DMZ(before the firewall) and B is part of the corporate network (behind the firewall),
on the machine A :
# ssh -gNL 33333:B:443 root@B
for example:
# ssh -gNL 33333:192.168.1.119:443 root@192.168.1.119
-g - Allows remote hosts to connect to local forwarded ports.
this will cause https://A:33333/ to work just like https://B:33333/ but from outside the network.