KAFKA_HOSTNAME- Hostname with your kafka service;USERNAME- username;PASSWORD- password
| CREATE OR REPLACE PROCEDURE create_temp_user(user_id VARCHAR) | |
| LANGUAGE plpgsql | |
| AS $$ | |
| BEGIN | |
| IF NOT EXISTS (SELECT 1 FROM pg_user WHERE usename = user_id) THEN | |
| EXECUTE 'CREATE USER ' || user_id || ' WITH PASSWORD DISABLE'; | |
| EXECUTE 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO ' || user_id; | |
| EXECUTE 'GRANT USAGE ON SCHEMA public TO ' || user_id; | |
| EXECUTE 'ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO ' || user_id; | |
| END IF; |
| import { mqtt5, iot, iotidentity } from 'aws-iot-device-sdk-v2'; | |
| ///Ensure at least once delivery should be enough most of the time | |
| const QOS = mqtt5.QoS.AtLeastOnce; | |
| ///Environment config | |
| const CONFIG = { | |
| endpoint: process.env.IOT_CORE_ENDPOINT!, | |
| cert: process.env.IOT_CORE_CERTIFICATE!, | |
| priv_key: process.env.IOT_CORE_PKEY!, |
| [ | |
| { | |
| "type": "error", | |
| "code": "unknown", | |
| "details": "Error extracting glob pattern" | |
| }, | |
| { | |
| "type": "file", | |
| "size": 1501, | |
| "modified": "2023-08-16 10:35:36.158743465 +09:00" |
| # Mac OS settings with tmux | |
| [shell] | |
| program = "/opt/homebrew/bin/tmux" | |
| args = [ | |
| "new-session", | |
| "-A", | |
| "-D", | |
| "-s", | |
| "main" |
| use core::future::Future; | |
| use core::pin::Pin; | |
| use core::task; | |
| use std::io; | |
| ///Future that resolves when program is requested to terminate | |
| #[must_use = "Future does nothing without polling"] | |
| pub struct Termination { | |
| #[cfg(unix)] | |
| term: tokio::signal::unix::Signal, |
| # Make sure to create folder /www and grant write access to nginx and yourself | |
| $DOMAIN="your domain" | |
| # Create file structure to serve static file with challenge | |
| sudo mkdir /www | |
| sudo mkdir /www/.well-known/ | |
| sudo mkdir /www/.well-known/acme-challenge | |
| sudo chown nginx /www/.well-known/acme-challenge | |
| #As example grant group write permission (e.g. you want www to belong to nginx user and anyone in nginx group) do: |
| use core::{ptr, task, hint, mem}; | |
| use core::cell::UnsafeCell; | |
| use core::sync::atomic::{AtomicBool, AtomicU8, Ordering}; | |
| mod noop { | |
| use core::{ptr, task}; | |
| const VTABLE: task::RawWakerVTable = task::RawWakerVTable::new(clone, action, action, action); | |
| const WAKER: task::RawWaker = task::RawWaker::new(ptr::null(), &VTABLE); |
| # HELP kube_cronjob_annotations Kubernetes annotations converted to Prometheus labels. | |
| # TYPE kube_cronjob_annotations gauge | |
| # HELP kube_cronjob_labels [STABLE] Kubernetes labels converted to Prometheus labels. | |
| # TYPE kube_cronjob_labels gauge | |
| # HELP kube_cronjob_info [STABLE] Info about cronjob. | |
| # TYPE kube_cronjob_info gauge | |
| kube_cronjob_info{namespace="default",cronjob="demo",schedule="* * * * *",concurrency_policy="Forbid"} 1 | |
| # HELP kube_cronjob_created [STABLE] Unix creation timestamp | |
| # TYPE kube_cronjob_created gauge | |
| kube_cronjob_created{namespace="default",cronjob="demo"} 1.707200821e+09 |