Friday, August 5, 2011

How to disable ehcache

-Dnet.sf.ehcache.disabled=true

Friday, June 17, 2011

How to SVN merge from command line

svn merge -r52164:52167 svn+ssh://www.example.com/test

Tuesday, May 10, 2011

How to make redirect for some URL with parameters to other URL with different parameters

if ($args = "id=115&typeId=14") {
rewrite ^ http://www.example.com/main/newsfeed/xml?hash=gdsgsdgf permanent;
}

Wednesday, March 23, 2011

How to export to CSV in PostgreSQL with psql in cmd

psql -U postgres -c "COPY (select 'a', ',b') TO STDOUT WITH CSV HEADER" database

Thursday, February 17, 2011

How to sort similar string with words in mixed up order

select distinct on (
array_to_string(
(select array_agg(xx) from (
select lower(x) from unnest(string_to_array(lower(value), ' ')) x order by x
) xx), ' ')
) value
from dup;

table:

create table dup (
value text
);

How to sort similar string with words in mixed up order

select distinct on (array_to_string((select array_agg(xx) from (select lower(x) from
unnest(string_to_array(lower(value), ' ')) x order by x) xx), ' ')) value from dup;

Wednesday, January 19, 2011

How to convert series of jpg to pdf in bash

convert -define pdf:use-trimbox=true *.jpg new_pdf.pdf

How to convert series of jpg to pdf in bash

convert -define pdf:use-trimbox=true *.jpg new_pdf.pdf