Skip to content

Instantly share code, notes, and snippets.

View donatello's full-sized avatar

Aditya Manthramurthy donatello

  • Bay Area, California
  • 04:11 (UTC -07:00)
View GitHub Profile
@donatello
donatello / gothreads-experiment.go
Last active April 23, 2017 19:18
Go Threads experiment - write system calls block
package main
import (
"fmt"
"os"
"sync"
)
var (
dir = "/tmp/writetest"
@donatello
donatello / fogtest.rb
Created April 21, 2017 07:24
Test fog lib's streaming signature issue.
require 'fog'
s3 = Fog::Storage::AWS.new(
aws_access_key_id: 'minio',
aws_secret_access_key: 'minio123',
endpoint: 'http://localhost:9000',
path_style: true
)
dir = s3.directories.get('test', { max_keys: 1 })
#!/usr/bin/env stack
-- stack --resolver lts-6.27 runghc --package minio-hs --package optparse-applicative --package filepath
--
-- Mar. 3 2017 -- using github.com/minio/minio-hs (master) to test
-- copyobjectpart fix
{-# Language OverloadedStrings, ScopedTypeVariables, NoImplicitPrelude, RankNTypes #-}
import Protolude
@donatello
donatello / Dockerfile.dev.tmp
Created February 20, 2017 09:08
Run locally built minio in docker compose cluster.
FROM debian:jessie
COPY ./minio /usr/local/bin/app
EXPOSE 9000
# display version before starting
RUN /usr/local/bin/app version
ENTRYPOINT ["app"]
#!/bin/bash
set -x
for i in $(seq 10); do
sudo iptables -I INPUT -p tcp --dport 9000 -j REJECT --reject-with tcp-reset
mc ls myminio/bucket
sudo iptables -D INPUT -p tcp --dport 9000 -j REJECT --reject-with tcp-reset
echo
mc cp --quiet /tmp/config-err-qSJmsi myminio/bucket/$i
echo
@donatello
donatello / minio-kafka-notification-dev.org
Created December 13, 2016 13:40
How to develop/test Minio event notifications to Kafka

How to develop/test Minio event notifications to Kafka

It is most convenient to use Docker to do this.

A Kafka setup is required (and this requires a Zookeeper setup). A Kafka consumer is needed to check the events sent to Kafka. I used kafkacat.

Kafka Setup in Docker

@donatello
donatello / newgoenv.sh
Last active October 16, 2017 05:31
Create a new custom Go environment in a specified directory
#!/bin/bash
GODOWNLOAD=go1.9.1.linux-amd64.tar.gz
GOURL=https://storage.googleapis.com/golang/$GODOWNLOAD
INSTALL_ARG=$1
if [ -z $INSTALL_ARG ]; then
echo "Please specify an install location on the command line."
exit 1
@donatello
donatello / postgresql-inspect-table-sizes.txt
Created February 12, 2015 12:41
Postgresql - inspect DB table/index sizes
-- Display table and index sizes
SELECT
table_name,
pg_size_pretty(table_size) AS table_size,
pg_size_pretty(indexes_size) AS indexes_size,
pg_size_pretty(total_size) AS total_size
FROM (
SELECT
table_name,
pg_table_size(table_name) AS table_size,

Keybase proof

I hereby claim:

  • I am donatello on github.
  • I am donatello (https://keybase.io/donatello) on keybase.
  • I have a public key whose fingerprint is 8EC7 3E41 447A CC5B 4966 BC07 B24F 1635 C23D 9B5A

To claim this, I am signing this object: