Postgresql, count rows in all tables

For count rows in each PostgreSQL table, we need to create a function and run it for all schemas

create function
cnt_rows(schema text, tablename text) returns integer
as
$body$
declare
  result integer;
  query varchar;
begin
  query := 'SELECT count(1) FROM ' || schema || '.' || tablename;
  execute query into result;
  return result;
end;
$body$
language plpgsql;

Читати далі

i915 0000:00:02.0: Device initialization failed (-12)

After upgrading the kernel to a newer kernel, OS won’t boot with a stacked message

pci 0000 : 00 : 07.0 : DPC : RP PIO log size 0 is invalid
xhci_hcd 0000 : 00 : 0d.0 : can't setup : -12
xhci hcd 0000 : 00 : 0d.0 : init 0000 : 00 : 0d.0 fail , -12
thunderbolt 0000 : 00 : 0d.2 : failed to determine connection manager , aborting
xhci hcd 0000 : 00 : 14.0 : can't setup : -12
xhci_hcd 0000 : 00 : 14.0 : init 0000 : 00 : 14.0 fail , -12
1801_smbus . 0000 : 00 : 1f.4 : Transaction timeout
1801_smbus 0000 : 00 : 1f.4 : Failed terminating the transaction
1801_smbus 0000 : 00 : 1f.4 : SMBus is busy , can't use it !
i915 0000 : 00 : 02.0 : [ drm ] * ERROR * Scratch setup failed
i915 0000 : 00 : 02.0 : Device initialization failed ( -12 )

Читати далі

Mikrotik as OpenVPN server in 3 steps

Connect to Mikrotik via SSH and start writing text below Set global VARs Make server and client CRT Create pool, profile, interface, firewall Goto menu Files in Mikrotik admin panel and download ca.crt + client.crt + client.key Then make file SomeName.ovpn with content: Put your key and crt and change host:port vars and file auth.cfg … Читати далі

Java8 in Debian

For starting we need install add-apt-repository apt-get install software-properties-common python-software-properties Then install java8 sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer To automatically set up the Java 8 environment variables: sudo apt-get install oracle-java8-set-default or echo “deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main” | tee /etc/apt/sources.list.d/webupd8team-java.list echo “deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main” | tee -a /etc/apt/sources.list.d/webupd8team-java.list apt-key … Читати далі