Skip to content

Instantly share code, notes, and snippets.

View achanda's full-sized avatar
🏠
Working from home

Abhishek Chanda achanda

🏠
Working from home
View GitHub Profile
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
name: mytestcluster-fio
namespace: cnpg-clusters
spec:
accessModes:
- ReadWriteOnce
resources:
@achanda
achanda / logs.txt
Last active July 24, 2023 16:06
cluster replica logs
╰─$ k logs -f mytestcluster-4 -n cnpg-clusters
Defaulted container "postgres" out of: postgres, bootstrap-controller (init)
{"level":"info","ts":"2023-07-24T15:48:05Z","logger":"setup","msg":"Starting CloudNativePG Instance Manager","logging_pod":"mytestcluster-4","version":"1.20.0","build":{"Version":"1.20.0","Commit":"008bb80b","Date":"2023-04-27"}}
{"level":"info","ts":"2023-07-24T15:48:06Z","msg":"Waited for 1.046558081s due to client-side throttling, not priority and fairness, request: GET:https://10.32.0.1:443/apis/certificates.k8s.io/v1?timeout=32s\n"}
{"level":"info","ts":"2023-07-24T15:48:10Z","logger":"setup","msg":"starting controller-runtime manager","logging_pod":"mytestcluster-4"}
{"level":"info","ts":"2023-07-24T15:48:10Z","msg":"Starting EventSource","controller":"cluster","controllerGroup":"postgresql.cnpg.io","controllerKind":"Cluster","source":"kind source: *v1.Cluster"}
{"level":"info","ts":"2023-07-24T15:48:10Z","msg":"Starting Controller","controller":"cluster","controllerGroup":"postgre
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/name: cloudnative-pg
name: cnpg-system
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
15:05 $ git show HEAD
commit 2aa736df1af922d6967069f824ffaebd165e5cff (HEAD -> refs/heads/aws-us-east-1-dev-ops-b6ms-18ff58b0)
Date: Thu Sep 12 15:05:31 2019 +0100
aws-us-east-1-dev-ops-b6ms: generator hash: 18ff58b0
diff --git a/apply/aws-us-east-1-dev-ops-b6ms/clusterrole.datadog-cluster-agent.yaml b/apply/aws-us-east-1-dev-ops-b6ms/clusterrole.datadog-cluster-agent.yaml
index a90304a..262eb17 100644
--- a/apply/aws-us-east-1-dev-ops-b6ms/clusterrole.datadog-cluster-agent.yaml
+++ b/apply/aws-us-east-1-dev-ops-b6ms/clusterrole.datadog-cluster-agent.yaml
//
// Small program to test the maximum amount of allocations in multiple blocks.
// This script searches for the largest allocation amount.
//
//
// Allocate a certain size to test if it can be done.
//
function alloc (size) {
const numbers = size / 8;
@achanda
achanda / dotexec.md
Last active March 8, 2018 03:52
Dot execing Rust
  • Wrapper script
root@dev:~# cat `which rustwrap`
#!/usr/bin/env bash

rustc "$1" -o foobar && shift && ./foobar "$@"
  • Mount binfmt_misc
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
@achanda
achanda / parser.rs
Created November 11, 2017 19:09
Rust IPv6 parser using nom
#[macro_use]
extern crate nom;
use std::net::Ipv6Addr;
use nom::IResult;
#[derive(Debug, PartialEq, Eq)]
pub struct IPv6Header {
version: u8,
error: cannot find macro `compiler_error!` in this scope
--> src/main.rs:56:1
|
56 | / named!(ipparse<&[u8], IPv4Header>,
57 | | do_parse!(verihl : two_nibbles ~
58 | | tos : be_u8 ~
59 | | length : u16!(true) ~
... |
79 | | dest_addr : dst_addr,
80 | | }}));
$USER="autodeploy"
kubectl create "$USER"
secret=$(kubectl get sa "$USER" -o json | jq -r .secrets[].name)
kubectl get secret $secret -o json | jq -r '.data["ca.crt"]' | base64 -D > ca.crt
user_token=$(kubectl get secret $secret -o json | jq -r '.data["token"]' | base64 -D)
kubectl config set-cluster mycluster \
--embed-certs=true \
--server="$ENDPOINT" \
@achanda
achanda / # python3 - 2017-01-17_15-25-24.txt
Created March 8, 2017 13:11
python3 on macOS 10.12.3 - Homebrew build logs
Homebrew build logs for python3 on macOS 10.12.3
Build date: 2017-01-17 15:25:24