Skip to content

Instantly share code, notes, and snippets.

λ.eranga erangaeb

Block or report user

Report or block erangaeb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@erangaeb
erangaeb / SwiftOps.scala
Last active Mar 20, 2020
openstack swift scala client
View SwiftOps.scala
package com.rahasak.buckets
import java.io.ByteArrayInputStream
import org.javaswift.joss.client.factory.{AccountFactory, AuthenticationMethod}
import sun.misc.BASE64Decoder
object SwiftOps extends App {
// create account in TestAuth mode with default username and password
// TestAuth use basic authentication
@erangaeb
erangaeb / build.sbt
Created Mar 20, 2020
swift sbt dependency
View build.sbt
name := "buckets"
version := "1.0"
scalaVersion := "2.11.7"
libraryDependencies ++= {
lazy val commonsioVersion = "2.5"
lazy val jossVersion = "0.10.2"
@erangaeb
erangaeb / swift-client
Created Mar 20, 2020
swift command-line client
View swift-client
# connect to siwft docker container
# swift command available inside swift container
docker exec -it swift bash
# swift command structure
swift [-A *Auth URL*] [-U *username*] [-K *password*] command_name
# view stat of the connection
# http://127.0.0.1:8080/auth/v1.0 - auth api in TestAuth mode, it use basic authentication
# test:tester - default username in TestAuth mode
@erangaeb
erangaeb / swift-docker
Created Mar 20, 2020
opnestack swift with docker
View swift-docker
docker run -d --name swift \
-p 8080:8080 \
morrisjobke/docker-swift-onlyone
@erangaeb
erangaeb / MinioOps.scala
Last active Mar 20, 2020
minio scala client application
View MinioOps.scala
package com.rahasak.buckets
import java.io.ByteArrayInputStream
import io.minio.MinioClient
import org.apache.commons.io.IOUtils
import sun.misc.BASE64Decoder
object MinioOps extends App {
@erangaeb
erangaeb / build.sbt
Last active Mar 20, 2020
minio sbt dependency
View build.sbt
name := "buckets"
version := "1.0"
scalaVersion := "2.11.7"
libraryDependencies ++= {
lazy val minioVersion = "6.0.13"
lazy val commonsioVersion = "2.5"
@erangaeb
erangaeb / minio-mc
Last active Mar 20, 2020
minioc command line client
View minio-mc
# connect to minio docker container
# mc command available inside minio container
docker exec -it minio bash
# configure minio storage
mc config host add <storage name> <host> <access key> <secret key>
mc config host add rahasak http://127.0.0.1:9000 rahasakkey rahasaksecret
# make bucket
mc mb <storage name>/<bucket name>
@erangaeb
erangaeb / minio-docker
Last active Mar 20, 2020
run minio with docker
View minio-docker
# run minio
# MINIO_ACCESS_KEY/MINIO_SECRET_KEY defines the Minio admin credentials
docker run -d --name minio \
-p 9000:9000 \
--env MINIO_ACCESS_KEY="rahasakkey" \
--env MINIO_SECRET_KEY="rahasaksecret" \
bitnami/minio
@erangaeb
erangaeb / start-reaper.sh
Created Mar 18, 2020
start cassandra-reaper
View start-reaper.sh
#!/bin/bash
# exit on error
set -e
# start cassandra-reaper
sudo service cassandra-reaper start
@erangaeb
erangaeb / configure-reaper.sh
Last active Mar 18, 2020
configure cassandra-reaper
View configure-reaper.sh
#!/bin/bash
# exit on error
set -e
# configure /etc/cassandra-reaper/cassandra-reaper.yaml
REAPER_CONFIG_FILE="/etc/cassandra-reaper/cassandra-reaper.yaml"
echo "start configuring ${REAPER_CONFIG_FILE}"
# set storageType cassandra
You can’t perform that action at this time.