Skip to content

Instantly share code, notes, and snippets.

View murtaza-u's full-sized avatar
Sailing

Murtaza Udaipurwala murtaza-u

Sailing
View GitHub Profile
apiVersion: psmdb.percona.com/v1
kind: PerconaServerMongoDB
metadata:
name: accuknox-mongodb
namespace: {{ include "namespace" . }}
finalizers:
- percona.com/delete-psmdb-pods-in-order
# - percona.com/delete-psmdb-pvc
# - percona.com/delete-pitr-chunks
spec:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: longhorn-role
labels: {{- include "longhorn.labels" . | nindent 4 }}
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
@murtaza-u
murtaza-u / prompt
Created December 18, 2022 19:33
Custom bash prompt with Git information
#!/bin/bash
# Add everything below to your .bashrc
multiline_prompt=0
hostinfo=0
__ps1() {
# colors
local red='\[\e[1;31m\]'
@murtaza-u
murtaza-u / pre-commit
Last active December 18, 2023 06:27
Pre-commit Git hook to prevent accidentally committing `go.mod` with replace directive in it.
#!/bin/bash
root="$(git rev-parse --show-toplevel)"
cd "$root" || exit 1
if [[ ! -r go.mod ]]; then
exit 0
fi
mod="$(grep -E "^replace\s+.+\s{1}=>\s{1}.+$" go.mod 2>/dev/null)"
@murtaza-u
murtaza-u / main.c
Created March 10, 2022 19:18
using arrays in a special way
#include <stdio.h>
void add(int a, int b) {
printf("%d\n", a + b);
}
void sub(int a, int b) {
printf("%d\n", a - b);
}