From fa62dd51af3bf9f0c515571577c03df3eee0e790 Mon Sep 17 00:00:00 2001 From: Trowbridge Date: Mon, 6 Jan 2020 13:55:56 -0500 Subject: [PATCH 1/2] how to create and aggregate --- postgres/aggregate.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 postgres/aggregate.md diff --git a/postgres/aggregate.md b/postgres/aggregate.md new file mode 100644 index 0000000..9febe2e --- /dev/null +++ b/postgres/aggregate.md @@ -0,0 +1,43 @@ +CREATE OR REPLACE FUNCTION public.jsonb_concat( + state jsonb, + concat jsonb) + RETURNS jsonb AS +$BODY$ +BEGIN + --RAISE notice 'state is %', state; + --RAISE notice 'concat is %', concat; + RETURN state || concat; +END; +$BODY$ + LANGUAGE plpgsql VOLATILE + COST 100; + + +CREATE OR REPLACE FUNCTION public.jsonb_concat_distinct_arr( + state jsonb, + concat jsonb) + RETURNS jsonb AS +$BODY$ +BEGIN + --RAISE notice 'state is %', state; + --RAISE notice 'concat is %', concat; + RETURN SELECT jsonb_agg(state || concat; +END; +$BODY$ + LANGUAGE plpgsql VOLATILE + COST 100; + + +DROP AGGREGATE IF EXISTS public.jsonb_arr_aggc(jsonb); +CREATE AGGREGATE public.jsonb_arr_aggc(jsonb) ( + SFUNC=public.jsonb_concat, + STYPE=jsonb, + INITCOND='[]' +); + +DROP AGGREGATE IF EXISTS public.jsonb_obj_aggc(jsonb); +CREATE AGGREGATE public.jsonb_obj_aggc(jsonb) ( + SFUNC=public.jsonb_concat, + STYPE=jsonb, + INITCOND='{}' +); \ No newline at end of file From 3729131510b8125679b38157bb7283462fc1b2b8 Mon Sep 17 00:00:00 2001 From: pt Date: Tue, 7 Jan 2020 23:59:13 -0500 Subject: [PATCH 2/2] networking --- ubuntu/networking.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ubuntu/networking.md diff --git a/ubuntu/networking.md b/ubuntu/networking.md new file mode 100644 index 0000000..79bbdc8 --- /dev/null +++ b/ubuntu/networking.md @@ -0,0 +1,7 @@ +scanning services that are running: + +sudo nmap -T Aggressive -A -v 127.0.0.1 -p 1-10000 + +sudo netstat --tcp --udp --listening --program + +sudo lsof +M -i4 -i6 \ No newline at end of file