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
@GrabConfig(systemClassLoader=true) | |
@Grapes( | |
@Grab(group="com.h2database", module="h2", version="1.4.200") | |
) | |
import org.h2.api.DatabaseEventListener | |
import java.sql.SQLException | |
import java.sql.DriverManager | |
public class ExampleDatabaseEventListener implements DatabaseEventListener { |
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
@Grapes( | |
@Grab(group='com.impossibl.pgjdbc-ng', module='pgjdbc-ng', version='0.8.4') | |
) | |
import com.impossibl.postgres.api.jdbc.PGConnection | |
import com.impossibl.postgres.api.jdbc.PGNotificationListener | |
import com.impossibl.postgres.jdbc.PGDataSource | |
PGDataSource dataSource = new PGDataSource(); | |
dataSource.setHost("0.0.0.0") | |
dataSource.setPort(5432) |
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 OR REPLACE FUNCTION notify_change() RETURNS TRIGGER AS $$ | |
BEGIN | |
-- | |
-- WARNING: Case is VERY IMPORTANT here! If we use 'exampleChannel' PG converts this to | |
-- examplechannel and no events will be received!! | |
-- | |
-- UPDATE: [to be confirmed] Case can be handled in PostgreSQL by using double quotes. | |
-- | |
-- In theory, if you had the following line as the listener, it would work in camelCase. | |
-- |
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
@GrabConfig(systemClassLoader=true) | |
// | |
// https://docs.oracle.com/cd/E11882_01/appdev.112/e13995/index.html?oracle/jdbc/dcn/DatabaseChangeRegistration.html | |
// | |
// https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc6 | |
@Grapes( | |
@Grab(group='com.oracle.database.jdbc', module='ojdbc6', version='11.2.0.4') | |
) | |
import oracle.jdbc.dcn.DatabaseChangeListener |
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
-- | |
-- This is required otherwise notifications won't be sent to the JDBC driver. | |
-- | |
grant change notification to system; | |
commit; | |
CREATE TABLE example( | |
example_id NUMBER(10) PRIMARY KEY, | |
phrase VARCHAR2(120) NOT NULL |
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
# | |
# In this example Docker is running on another machine so assume that I've ssh'd into that box and | |
# am running the following on the remote machine. | |
# | |
docker run -d -p 1521:1521 oracleinanutshell/oracle-xe-11g | |
docker exec -it [container id] /bin/sh | |
su | |
# | |
# Username: system, password: oracle | |
# |
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
const fs = require('fs'); | |
const AWS = require('aws-sdk'); | |
const zlib = require('zlib'); | |
const stream = require('stream'); | |
AWS.config["credentials"] = new AWS.SharedIniFileCredentials({profile: 'some-test-profile'}); | |
AWS.config["logger"] = console; | |
const s3Obj = new AWS.S3(); |
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
/** | |
* Precondition: | |
* | |
* - npm install aws-sdk | |
*/ | |
const AWS = require('aws-sdk'); | |
AWS.config["credentials"] = new AWS.SharedIniFileCredentials({profile: 'thospfuller-aws-cli'}); |
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
# | |
# Test with: | |
# | |
# https://www.immuniweb.com/ssl/ | |
# | |
# Change applied to: | |
# | |
# /etc/letsencrypt/options-ssl-apache.conf | |
# | |
SSLProtocol +TLSv1.3 |
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
# See question 1.1 from the article entitled "Practice Exam for Certified Kubernetes Application Developer (CKAD) Certification". | |
# | |
# https://matthewpalmer.net/kubernetes-app-developer/articles/ckad-practice-exam.html | |
# | |
# Answered in the article entitled "Answers to Five Kubernetes CKAD Questions (2020)" here: | |
# | |
# https://thospfuller.com/2020/11/09/answers_to_five_kubernetes_ckad_questions_2020/ | |
# | |
apiVersion: v1 | |
kind: Pod |
OlderNewer