This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SELECT dbo.AesEncrypt(''), dbo.AesDecrypt('615ca4a4b3e23e5b500ff7352a519e39') | |
-- SELECT dbo.DesEncrypt('test'), dbo.DesDecrypt('WNSw7KxMxW4=') | |
;WITH CTE_PlainText AS | |
( | |
SELECT i, REPLICATE('A', i) AS plainText FROM tfu_RPT_All_Interval(0, 99,1) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- openssl version | |
-- OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022) | |
-- openssl ciphers | |
-- TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:RSA-PSK-AES256-GCM-SHA384:DHE-PSK-AES256-GCM-SHA384:RSA-PSK-CHACHA20-POLY1305:DHE-PSK-CHACHA20-POLY1305:ECDHE-PSK-CHACHA20-POLY1305:AES256-GCM-SHA384:PSK-AES256-GCM-SHA384:PSK-CHACHA20-POLY1305:RSA-PSK-AES128-GCM-SHA256:DHE-PSK-AES128-GCM-SHA256:AES128-GCM-SHA256:PSK-AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:ECDHE- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://subscription.packtpub.com/book/big-data-and-business-intelligence/9781783980581/6/ch06lvl1sec57/preventing-schema-changes | |
-- https://www.enterprisedb.com/postgres-tutorials/how-use-event-triggers-postgresql | |
-- https://stackoverflow.com/questions/64505872/run-a-trigger-in-postgres-on-alter-event | |
-- https://www.postgresql.org/docs/current/event-trigger-matrix.html | |
-- https://www.postgresql.org/docs/current/sql-altereventtrigger.html | |
-- https://www.postgresqltutorial.com/postgresql-triggers/managing-postgresql-trigger/ | |
-- https://gist.github.com/Checksum/5942ad6a38e75d71e0a9c0912ac83601 | |
-- https://www.enterprisedb.com/postgres-tutorials/how-use-event-triggers-postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
-- https://www.hmailserver.com/documentation/latest/ | |
-- https://github.com/hmailserver/hmailserver | |
-- ALTER USER postgres PASSWORD 'TOP_SECRET'; | |
-- \q | |
SELECT | |
pg_encoding_to_char(pg_database.encoding) AS cluster_encoding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-describe-first-result-set-transact-sql?view=sql-server-ver16 | |
DECLARE @encounteredErrors table | |
( | |
routine_qualified_name nvarchar(512) | |
,errorProcedure national character varying(128) | |
,errorNumber int | |
,errorLine int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT S.* | |
FROM sys.dm_exec_requests AS R | |
INNER JOIN sys.dm_exec_sessions AS S ON S.session_id = R.blocking_session_id | |
-- KILL <session_id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Minimal data size | |
-- CSV wins with 87% of Newton Associative (619 kB) | |
-- JSON Associative: 116.3% CSV (720 kb) | |
-- JSON compact: 101.3% Newton Associative without NULL | |
-- JSON compact: 32.6% Newton Associative with NULL | |
-- XML: 516.5% JSON-Associative, 600.8% CSV | |
-- https://www.codeproject.com/Tips/823670/Csharp-Light-and-Fast-CSV-Parser | |
-- CsvImportExport\CsvImportExport\CsvParser.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.sticky { | |
position: relative; | |
} | |
.sticky.stuck { | |
position: fixed; | |
top: 0; | |
width: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem "C:\Users\username\Downloads" -Recurse | ForEach-Object { | |
if ($_.Attributes -band [System.IO.FileAttributes]::ReadOnly) { | |
Set-ItemProperty -Path $_.FullName -Name Attributes -Value ($_.Attributes -bxor [System.IO.FileAttributes]::ReadOnly) | |
} | |
} | |
# Unblock files after removing read-only | |
Get-ChildItem "C:\Users\username\Downloads" -Recurse | Unblock-File | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE ROLE hmail WITH SUPERUSER LOGIN PASSWORD 'TOP_SECRET'; | |
SELECT rolpassword FROM pg_authid WHERE rolname = 'hmail' | |
SELECT pg_reload_conf(); | |
-- /etc/postgresql/15/main/postgresql.conf | |
-- #password_encryption = scram-sha-256 # scram-sha-256 or md5 |