Merge branch 'master' of https://github.com/fleetside72/notes
This commit is contained in:
commit
748f2302b1
43
postgres/aggregate.md
Normal file
43
postgres/aggregate.md
Normal file
@ -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='{}'
|
||||||
|
);
|
7
ubuntu/networking.md
Normal file
7
ubuntu/networking.md
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user