Skip to content

Instantly share code, notes, and snippets.

View prakashsvmx's full-sized avatar

Prakash Senthil Vel prakashsvmx

View GitHub Profile
@Mixerou
Mixerou / cloud_scratches.sh
Last active May 17, 2025 06:40
JetBrains Cloud Scratch Files Linker
#!/usr/bin/env bash
# Error Codes
# 1 — Platform is not supported
# 2 — No IDEs have been installed
# 3 — Location for cloud scratches does not exist
set -eu +x
PLATFORM=$(uname -s)
@Praveenrajmani
Praveenrajmani / backupandrestore.md
Last active September 9, 2024 21:41
Backup and restoring MinIO resources

STEP 1: Take backups

export NAMESPACE=<your-tenant-namespace>
kubectl get directpvvolumes -o yaml > directpvvolumes.yaml
kubectl get directpvdrives -o yaml > directpvdrives.yaml
kubectl get ns $NAMESPACE -o yaml > tenantns.yaml
kubectl get pv -o yaml > pvs.yaml           	 
kubectl get pvc -n $NAMESPACE -o yaml > pvcs.yaml
kubectl get tenants -n $NAMESPACE -o yaml > tenant.yaml
replicate:
apiVersion: v1
# source of the objects to be replicated
source:
type: minio # valid values are "minio"
bucket: old-minio-versioned-bucket
prefix: "" # 'PREFIX' is optional
# NOTE: if source is remote then target must be "local"
# Source is an old version of MinIO
endpoint: "http://localhost:15000"
@maliMirkec
maliMirkec / .bashrc
Created March 15, 2023 13:17
.bashrc
# reload source
alias brc="source ~/.config/fish/.bashrc"
# open explorer in current folder
alias e.="explorer ."
# git: log pretty
alias gl="git log --oneline --graph"
# git: status condensed
@balamurugana
balamurugana / Self-signed certificate setup for AssumeRoleWithCertificate.md
Last active September 15, 2023 20:16
Self-signed certificate setup for AssumeRoleWithCertificate

As MinIO needs the CN to have the policy name and original mkcert does not support this, download updated mkcert from https://github.com/kanagarajkm/mkcert/releases/download/v1.4.3-1/mkcert

Server certs

  1. Generate certificate files
mkcert localhost
  1. Copy generated localhost-key.pem and localhost.pem to certs directory of minio server.
cp -avi localhost-key.pem ~/.minio/certs/private.key
@kerneltime
kerneltime / minio.tls.md
Last active February 18, 2021 18:49
start minio for testing with TLS
curl -Ol https://golang.org/src/crypto/tls/generate_cert.go
go run generate_cert.go -ca --host "192.168.86.47"
cp cert.pem key.pem ~/.minio/certs
mv ~/.minio/certs/cert.pem ~/.minio/certs/public.crt
mv ~/.minio/certs/key.pem ~/.minio/certs/private.key
> cat start-https.sh 
export MINIO_ACCESS_KEY="minio"
export MINIO_SECRET_KEY="minio123"
export MINIO_PROMETHEUS_AUTH_TYPE="public"
@superseb
superseb / minio-nginx-selfsigned.sh
Last active July 3, 2025 07:31
Minio + NGINX in Docker using self signed certificates
#!/bin/bash
if [ "$#" -lt 0 ]; then
echo "Usage: $0"
exit 1
fi
echo "Generating nip.io based on found external IP"
FOUNDIP=$(docker run --rm --net=host appropriate/curl https://api.ipify.org)
APIFQDN="minio-api.${FOUNDIP}.nip.io"
FQDN="minio.${FOUNDIP}.nip.io"
@hyber1z0r
hyber1z0r / useWhenVisible.ts
Created August 4, 2020 09:47
useWhenVisible hook
import React, { useEffect } from 'react';
const useWhenVisible = (target: Element | undefined,
callback: () => void,
root: Element | undefined = document.body) => {
useEffect(() => {
if (!target || !root) {
return;
}
@emeraldsanto
emeraldsanto / withSuspense.tsx
Last active May 20, 2025 20:51
HOC to wrap a component in a `Suspense`, most likely a React Navigation screen. To be used with `React.lazy`.
/**
* Wraps the provide component in a `Suspense`, with the provided fallback.
* This should be used on components whose parent is not easy to control, such as
* React Navigation screens to be able to lazy load them using `React.lazy`.
* @param WrappedComponent The component to wrap.
* @param fallback The component to render while loading.
*
* @example
* const SomeScreen = withSuspense(React.lazy(() => import("path/to/some/screen")));
*/