RSS

Posts in 2016

  • Building rpm packages

    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 …

    Read more

  • 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

  • Fix the no public key available error

    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

    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

  • Error occured during the signature verification

    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

    Read more

  • Force package removal

    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 …

    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