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 …
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 …
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 …
Tuesday, November 24, 2015 in Miscellaneous
ALTER ROLE "user" LOGIN;
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
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 …
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.
Monday, April 27, 2009 in Miscellaneous
find /var/spool/postfix/deferred/ -type f -exec grep -li 'XXX' '{}' \; | xargs -n1 basename | xargs -n1 postsuper -d