RSS

Posts in 2016

  • Clean old centos kernels

    Wednesday, February 03, 2016 in Miscellaneous

    There is a setting in /etc/yum.conf that does exactly that : installonly_limit=. The value of this setting is the number of older kernels that are kept when a new kernel is installed by yum. If the number of installed kernels becomes greater than …

    Read more

Posts in 2015

  • Investigate postgresql disk usage

    Tuesday, November 24, 2015 in Miscellaneous

    How to debug disk occupation in postgresql get a database oid number from ncdu in /var/lib/postgresql reconcile oid number and db name with : select oid,datname from pg_database where oid=18595; Then in database : select …

    Read more

  • Grant postgresql read only access

    Tuesday, November 24, 2015 in Miscellaneous

    GRANT CONNECT ON DATABASE "db" TO "user"; \c db GRANT USAGE ON SCHEMA public TO "user"; GRANT SELECT ON ALL TABLES IN SCHEMA public TO "user"; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO …

    Read more

  • Cannot login role into postgresql

    Tuesday, November 24, 2015 in Miscellaneous

    ALTER ROLE "user" LOGIN;

    Read more

Posts in 2014

  • Boot from initramfs shell

    Friday, January 24, 2014 in Miscellaneous

    I had to finish booting from an initramfs shell, here is how I used switch_root to do so : lvm vgscan lvm vgchange -ay vg mount -t ext4 /dev/mapper/vg-root /root exec switch_root -c /dev/console /root /sbin/init

    Read more

Posts in 2012

  • Change owner on a postgresql database and all tables

    Friday, April 20, 2012 in Miscellaneous

    ALTER DATABASE name OWNER TO new_owner for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" YOUR_DB` ; do psql -c "alter table $tblowner to NEW_OWNER" YOUR_DB ; done for tbl in `psql -qAt -c …

    Read more

Posts in 2011

  • Use spaces in fstab

    Thursday, September 29, 2011 in Miscellaneous

    Here is how to use spaces in a folder name in fstab : you put \040 where you want a space.

    Read more

Posts in 2009