Skip to content

Instantly share code, notes, and snippets.

--------------------------- MODULE BlockchainTransactions ---------------------------
EXTENDS Integers, Sequences, TLC
(*-- Constants used in the specification --*)
CONSTANT Clients, KafkaNodes, SmartContracts, StorageNodes, CacheNodes, LokkaServices
(*-- The set of all possible transactions --*)
VARIABLE transactions, messageBroker, blockchainStorage, distributedCache, blocks
(* -- Define the initial state of the blockchain system --*)
{
"token_id": "pbom123",
"timestamp": "2023-11-01T12:30:00Z",
"package": {
"package_id": "pkg789",
"package_name": "example_app"
},
"pull_requests": [
{
"id": "pr456",
{
"token_id": "string",
"timestamp": "string",
"package": {
"package_id": "string",
"package_name": "string"
},
"pull_requests": [
{
"id": "string",
@erangaeb
erangaeb / nft.json
Created August 13, 2023 18:37
nft json
[
{
"Title": "Do Not Allow SSH Environment Options",
"Rule": "xccdf_org.ssgproject.content_rule_sshd_do_not_permit_user_env",
"Result": "pass"
},
{
"Title": "Enable PAM",
"Rule": "xccdf_org.ssgproject.content_rule_sshd_enable_pam",
"Result": "pass"
@erangaeb
erangaeb / i-528
Created August 13, 2023 18:35
nft schema
{
"title": "NFT Token Schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"Title": {
"type": "string",
"description": "Title of the vulnerability scan result"
},
@erangaeb
erangaeb / podman
Created April 25, 2023 03:34
install podman
# install podman
❯❯ brew install podman
# initializes a new Linux runtime envirounment which known as podman machine
# podman behind the scene uses quem emulator to provide linux runtem envirounment
# --cpus 4 (specify cpus)
# --memory=6144 (specify memory)
❯❯ podman machine init --cpus 4 --memory=6144
# list podman machines
@erangaeb
erangaeb / emass.md
Last active April 4, 2023 07:36
emass api requests

emass endpoints

run mock api with prism

docker run --rm \
    -v /private/var/services/prism:/root/apis \
    -p 4010:4010 \
    -t stoplight/prism \
    mock -h 0.0.0.0 /root/apis/emass.yaml
@erangaeb
erangaeb / endpoints
Created December 3, 2022 21:44
k8s endpoints
# create endpoints
kubectl apply -f endpoint1.yaml
kubectl apply -f endpoint2.yaml
# create two services
❯❯ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
bassa ClusterIP None <none> 5432/TCP 10m
rahasak ClusterIP None <none> 5432/TCP 12m
@erangaeb
erangaeb / service-monitor.yaml
Last active December 3, 2022 21:46
service monitor to probe k8s endpoints via blackbox exporter
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: blackbox-exporter
spec:
endpoints:
- interval: 1m
path: /probe
scrapeTimeout: 10s
params:
@erangaeb
erangaeb / endpoint2.yaml
Created December 3, 2022 21:38
kubernets endpoint
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: bassa
app.kubernetes.io/component: blackbox
name: bassa
spec:
clusterIP: None
ports: