This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
from boto3.s3.transfer import TransferConfig | |
import os | |
# MinIO configuration | |
minio_endpoint = "http://localhost:22000" # Change to your MinIO endpoint | |
access_key = "minio" | |
secret_key = "minio123" | |
bucket_name = "test-bucket" | |
object_name = "1GB.zip" # The path/key where the file will be stored in the bucket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"s3:CreateBucket", | |
"s3:DeleteBucket", | |
"s3:ForceDeleteBucket", | |
"s3:GetBucketLocation", | |
"s3:ListAllMyBuckets", | |
"s3:DeleteObject", | |
"s3:GetObject", | |
"s3:ListBucket", | |
"s3:PutObject", | |
"s3:PutObjectTagging", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"admin:*", | |
"admin:Heal", | |
"admin:StorageInfo", | |
"admin:DataUsageInfo", | |
"admin:TopLocksInfo", | |
"admin:Profiling", | |
"admin:ServerTrace", | |
"admin:ConsoleLog", | |
"admin:KMSCreateKey", | |
"admin:KMSKeyStatus", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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)); |
NewerOlder