Monday, February 22, 2016 in Miscellaneous
Here is how to build locally an rpm package. Tested at the time on a centos 7. Setup your environment First of all, you have to use a non-root account. Create the necessary directories : mkdir -p ~/rpmbuild/{BUILD,RPMS,S{OURCE,PEC,RPM}S} Tell …
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 …
Wednesday, January 27, 2016 in Debian
Here is how to fix the no public key available error : apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYID
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, February 27, 2015 in Debian
Here is how to fix the apt-get “Error occured during the signature verification” : cd /var/lib/apt mv lists lists.old mkdir -p lists/partial aptitude update
Tuesday, January 27, 2015 in Debian
Here is how to force package removal when post-uninstall script fails : dpkg --purge --force-all <package> There is another option if you need to be smarter or if it is a pre-uninstall script that fails. Look at …
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 …