Skip to content

Instantly share code, notes, and snippets.

View prakashsvmx's full-sized avatar

Prakash Senthil Vel prakashsvmx

View GitHub Profile
@Praveenrajmani
Praveenrajmani / backupandrestore.md
Last active November 9, 2023 07:06
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 February 23, 2024 06:52
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 April 13, 2023 21:34
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")));
*/
@karpolan
karpolan / withSuspense.js
Created August 10, 2019 10:46
withSuspense() HOC for React.lazy() + React.Suspense
import React from 'react';
import { CircularProgress, LinearProgress } from '@material-ui/core/';
/**
* Wraps the React Component with React.Suspense and FallbackComponent while loading.
* @param {React.Component} WrappedComponent - lazy loading component to wrap.
* @param {React.Component} FallbackComponent - component to show while the WrappedComponent is loading.
*/
export const withSuspense = (WrappedComponent, FallbackComponent = null) => {
return class extends React.Component {