Adding startup service in Ubuntu

add service to
/etc/init.d/your_service

In Ubuntu or Debian like you can use, to add
update-rc.d your_service defaults

to remove
update-rc.d -f your_service remove

Advertisements

postgresql pgscript

DECLARE @I, @Ts, @node_id; — Variable names begin with a @
SET @node_id = 1;
SET @I = 0; — @I is an integer
WHILE @I < 10000
BEGIN
SET @Ts = 5 * @I;
INSERT INTO table1 values (NOW() – ‘@Ts minute’::INTERVAL, 1,11,0,10.331);
INSERT INTO table2 values (NOW() – ‘@Ts minute’::INTERVAL, 2,11,0,10.331);
SET @I = @I + 1;
END