Skip to content

Instantly share code, notes, and snippets.

View otheus's full-sized avatar

Otheus otheus

  • UIBK
  • Innsbruck, Austria
View GitHub Profile
#!/bin/awk -f
## Awk script to compare to SQL (postgres) dumps for which each line of input is a row
## and has been preprocessed by
## paste -d $'\a' file1 file2
## The BEL symbol is used by this program to quickly split the input
##
## Sometimes, numbers differ by some kind of rounding error / floating-point implementation
## Ignore that error by subtracting the two values and seeing if they are < maxdiff,
## maxdiff = 1 / (10 ^ (length-after-decimal-point(shortest-value))
## Consider:
## Provide Puppet Certificate of a given Node
##
## Otheus - 2022-07-21
##
## Notes to webmaster:
## * Modify this include file and stick it in `/etc/httpd/conf.d`. Alternatively, create a soft-link to
## this file in its repository-clone on that server (ensure directory permissions are kosher and
## readable by Apache).
##
@otheus
otheus / extensions.sql
Created September 25, 2017 18:51
Materialized view of RHN's Satellite rhnchecksum
-- See http://tech.jonathangardner.net/wiki/PostgreSQL/Materialized_Views
drop function if exists rhncs_mv_refresh();
create function rhncs_mv_refresh() returns void
security definer language 'plpgsql' as $BODY$
begin
truncate rhnchecksumview;
insert into rhnchecksumview select c.id,ct.label as checksum_type,c.checksum from rhnchecksum c left join rhnchecksumtype ct on (c.checksum_type_id = ct.id);
return;
end
$BODY$;