Category Archives: Linux

How to fix postgres sequences that are causing integrity errors.

Save this to a sql file: SELECT ‘SELECT SETVAL(‘ ||quote_literal(quote_ident(S.relname))|| ‘, MAX(‘ ||quote_ident(C.attname)|| ‘)+1) FROM ‘ ||quote_ident(T.relname)|| ‘;’ FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C WHERE S.relkind = ‘S’ AND S.oid = D.objid AND … Continue reading

Posted in postgres | Comments Off on How to fix postgres sequences that are causing integrity errors.

How to see currently executing queries in postgres 9.2

SELECT query,xact_start,query_start FROM pg_stat_activity;

Posted in postgres | Comments Off on How to see currently executing queries in postgres 9.2

Force a URL to HTTPS using Kemp Loadmaster and Nginx

On the Kemp Loadmaster, do a request header modification, adding the HTTPS: on header. View/Modify Services Click the “Modify” button on  your port 443 service you have already set up Under Advanced Properties,  click Show Header Rules under HTTP Header … Continue reading

Posted in Kemp, Linux, nginx | Comments Off on Force a URL to HTTPS using Kemp Loadmaster and Nginx

git push error: RPC failed; result=22, HTTP code = 411

When doing a git push, I was getting the following error. error: RPC failed; result=22, HTTP code = 411 fatal: The remote end hung up unexpectedly This fixed it: git config http.postBuffer 524288000

Posted in git, Linux | Comments Off on git push error: RPC failed; result=22, HTTP code = 411

Create superuser(root) in postgres database

I always forget the exact syntax for this so I am posting it here. It’s easy when you know how: CREATE USER root WITH PASSWORD ‘My.g00d.Pa55word’; ALTER USER root WITH SUPERUSER; Also make sure that your ip is allowed in … Continue reading

Posted in postgres | Comments Off on Create superuser(root) in postgres database