Skip to content

Instantly share code, notes, and snippets.

@ajayk
ajayk / verify.sh
Created April 2, 2024 20:15
verify.sh
#!/bin/bash
# Loop through each file in the directory
for file in *.apk
do
# Run the apk verify command for the current file
apk verify "$file"
done
@ajayk
ajayk / glibc-dev.txt
Created January 19, 2024 22:33
glibc-dev
glibc-dev-2.38-r9 contains:
usr/include/a.out.h
usr/include/aio.h
usr/include/aliases.h
usr/include/alloca.h
usr/include/ar.h
usr/include/argp.h
usr/include/argz.h
usr/include/assert.h
usr/include/byteswap.h
/work/work # /usr/lib/kafka/bin/zookeeper-server-start.sh
USAGE: /usr/lib/kafka/bin/zookeeper-server-start.sh [-daemon] zookeeper.properties
/work/work # /usr/lib/kafka/bin/zookeeper-server-start.sh /usr/lib/kafka/config/zookeeper.properties
[2023-10-19 18:18:49,887] INFO Reading configuration from: /usr/lib/kafka/config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2023-10-19 18:18:49,891] INFO clientPortAddress is 0.0.0.0:2181 (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2023-10-19 18:18:49,892] INFO secureClientPort is not set (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2023-10-19 18:18:49,892] INFO observerMasterPort is not set (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2023-10-19 18:18:49,892] INFO metricsProvider.className is org.apache.zookeeper.metrics.impl.DefaultMetricsProvider (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2023-10-19 18:18:49,893] INFO autopurge.snapRetainCount set to 3 (org.apache.zookeeper.server.DatadirCle
{"level":"warn","ts":1690576442.7054904,"logger":"fallback","caller":"handler/handler.go:112","msg":"Received push event for non-attestation tag: sha256-639c3f734de0a2ab7d188cf2740a84fadd98f72b4c2a751dda2b1fb48ce92b7f.att"}
{"level":"warn","ts":1690576443.0899212,"logger":"fallback","caller":"handler/handler.go:112","msg":"Received push event for non-attestation tag: sha256-311724554765dfa07320f5e591f60b25adf3613e43edaa314d7b345970476300.att"}
{"level":"info","ts":1690576446.8896928,"logger":"fallback","caller":"handler/handler.go:154","msg":"Unparsed Json {\"schemaVersion\":2,\"mediaType\":\"application/vnd.oci.image.manifest.v1+json\",\"config\":{\"mediaType\":\"application/vnd.oci.image.config.v1+json\",\"size\":570,\"digest\":\"sha256:a87bb91bcc7a112e1a5e6ce36ba4f822f094b8fbfa69a68a0fedbcbff2b1210b\"},\"layers\":[{\"mediaType\":\"application/vnd.dev.cosign.simplesigning.v1+json\",\"size\":239,\"digest\":\"sha256:48cfdb3ac79faee83cf39791ca8e39c6dbb9c98529ad3fb36d82667eef9fcf98\",\"annotations\":{\"dev.cosi
@ajayk
ajayk / builds.txt
Created July 5, 2023 16:27
builds.
This file has been truncated, but you can view the full file.
/work # make BUILDWORLD=no SOURCE_DATE_EPOCH=0 packages/libjpeg-turbo
.packagerules:5689: warning: overriding recipe for target 'packages/x86_64/meson-1.1.1-r0.apk'
.packagerules:894: warning: ignoring old recipe for target 'packages/x86_64/meson-1.1.1-r0.apk'
SDE=0; [ -z "$SDE" ] && SDE=`git log -1 --pretty=%ct --follow libjpeg-turbo.yaml`; SOURCE_DATE_EPOCH=$SDE /usr/bin/melange build libjpeg-turbo.yaml --repository-append /work/packages --keyring-append local-melange.rsa.pub --signing-key local-melange.rsa --arch x86_64 --env-file build-x86_64.env --namespace wolfi --generate-index false --cache-source gs://wolfi-sources/ -k https://packages.wolfi.dev/os/wolfi-signing.rsa.pub -r https://packages.wolfi.dev/os --source-dir ./libjpeg-turbo/ --log-policy builtin:stderr,packages/x86_64/buildlogs/libjpeg-turbo-2.1.91-r4.log
ℹ️ x86_64 | detected git commit for build configuration: 73ba26c80887d49eaf441abe31f065c58a7c6706
ℹ️ x86_64 | melange is building:
ℹ️ x86_64 | configuration file: libjpeg-turbo
ℹ️ x86_64 | detected git commit for build configuration: 82dc35e6ffe01d8589022f103cd427a9719c8ed6
ℹ️ x86_64 | melange is building:
ℹ️ x86_64 | configuration file: libapr.yml
ℹ️ x86_64 | workspace dir: /tmp/melange-workspace-1829409006
ℹ️ x86_64 | evaluating pipelines for package requirements
ℹ️ x86_64 | adding package "git" for pipeline "Check out sources from git"
ℹ️ x86_64 | adding package "make" for pipeline "Run autoconf make"
ℹ️ x86_64 | adding package "make" for pipeline "Run autoconf make install"
ℹ️ x86_64 | adding package "binutils" for pipeline "Strip binaries"
ℹ️ x86_64 | adding package "scanelf" for pipeline "Strip binaries"
diff --git a/cmd/operator/deploy/crds/monitoring.googleapis.com_clusterpodmonitorings.yaml b/cmd/operator/deploy/crds/monitoring.googleapis.com_clusterpodmonitorings.yaml
index e4fbdeb55..879eda625 100644
--- a/cmd/operator/deploy/crds/monitoring.googleapis.com_clusterpodmonitorings.yaml
+++ b/cmd/operator/deploy/crds/monitoring.googleapis.com_clusterpodmonitorings.yaml
@@ -1,16 +1,4 @@
-# Copyright 2022 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
@ajayk
ajayk / kms_example.sh
Created September 21, 2018 02:12 — forked from maxmanders/kms_example.sh
KMS Envelope Encryption Using OpenSSL And AWS CLI
$ echo "secret" > secret.txt
$ key_material=$(aws kms generate-data-key --key-id <CMK_key_id> --key-spec AES_256)
$ echo ${key_material} | jq ".CiphertextBlob" | sed 's/"//g' | base64 -d > key.enc
$ export key=$(echo ${key_material} | jq ".Plaintext" | sed 's/"//g' | base64 -d)
$ openssl enc -aes-256-cbc -pass env:key -in secret.txt -out secret.txt.enc
$ rm secret.txt
$ ls
key.enc secret.txt.enc
$ key=$(aws-fd-full kms decrypt --ciphertext-blob fileb://key.enc --output text --query Plaintext | base64 -d)
$ openssl enc -d -aes-256-cbc -pass env:key -in secret.txt.enc -out secret.txt
@ajayk
ajayk / README.md
Created September 28, 2018 18:20 — forked from rhamedy/README.md
Configure HikariCP with Spring Boot JPA Hibernate and PostgreSQL as a database

I came across HikariCP and I was amazed by the benchmarks and I wanted to try it instead of my default choice C3P0 and to my surprise I struggled to get the configurations right probably because the configurations differ based on what combination of tech stack you are using.

I have setup Spring Boot project with JPA, Web, Security starters (Using [Spring Initializer][1]) to use PostgreSQL as a database with HikariCP as connection pooling.
I have used Gradle as build tool and I would like to share what worked for me for the following assumptions:

  1. Spring Boot Starter JPA (Web & Security - optional)
  2. Gradle build tool
  3. PostgreSQL running and setup with a database (i.e. schema, user, db)

This gist is related to SO post https://stackoverflow.com/questions/26490967/how-do-i-configure-hikaricp-in-my-spring-boot-app-in-my-application-properties-f

@ajayk
ajayk / dump-restore
Created October 25, 2019 17:18 — forked from ricjcosme/dump-restore
DUMP / RESTORE PostgreSQL Kubernetes
DUMP
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql
RESTORE
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database