Skip to content

Instantly share code, notes, and snippets.

View prakashsvmx's full-sized avatar

Prakash Senthil Vel prakashsvmx

View GitHub Profile
#!/bin/bash
for i in {1..3}; do
mc cp 1.txt local22/test-bucket/$i.txt
for j in {1..3}; do
mc cp 1.txt local22/test-bucket/${i}.txt
done
done
@prakashsvmx
prakashsvmx / examples-server-info.go
Created November 29, 2023 07:04
mtLS - Admin Client madmin-go
//go:build ignore
// +build ignore
// Copyright (c) 2015-2022 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
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"
@prakashsvmx
prakashsvmx / MinIO_S3_Policy_Actions.txt
Created November 24, 2021 04:59
MinIO_S3_Policy_Actions
"s3:CreateBucket",
"s3:DeleteBucket",
"s3:ForceDeleteBucket",
"s3:GetBucketLocation",
"s3:ListAllMyBuckets",
"s3:DeleteObject",
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject",
"s3:PutObjectTagging",
@prakashsvmx
prakashsvmx / MinIO_Admin_Policy_Actions.txt
Created November 24, 2021 04:58
MinIO_Admin_Policy_Actions
"admin:*",
"admin:Heal",
"admin:StorageInfo",
"admin:DataUsageInfo",
"admin:TopLocksInfo",
"admin:Profiling",
"admin:ServerTrace",
"admin:ConsoleLog",
"admin:KMSCreateKey",
"admin:KMSKeyStatus",
function getResponseSize(url) {
return fetch(url).then(response => {
const reader = response.body.getReader();
let total = 0;
return reader.read().then(function processResult(result) {
if (result.done) return total;
const value = result.value;
total += value.length;
async function logInOrder(urls) {
// fetch all the URLs in parallel
const textPromises = urls.map(async url => {
const response = await fetch(url);
return response.text();
});
// log them in sequence
for (const textPromise of textPromises) {
console.log(await textPromise);
//copy the $file to $dir2
var copyFile = (file, dir2, fileName)=>{
//include the fs, path modules
var fs = require('fs');
var path = require('path');
//gets file name and adds it to dir2
var f = path.basename(fileName);
var source = fs.createReadStream(file);
var dest = fs.createWriteStream(path.resolve(dir2, f));
@prakashsvmx
prakashsvmx / upload-minio.html
Created December 18, 2020 03:57 — forked from harshavardhana/upload-minio.html
Upload to play.minio.io:9000 from browser using minio-js
<!DOCTYPE html>
<html>
<head>
<title>Minio SDK for JavaScript - Sample Application</title>