Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import sys
import os
from optparse import OptionParser
def main():
parser = OptionParser('%prog')
parser.add_option('-n', type="int", dest="num_files", default=1,
@thiagodasilva
thiagodasilva / gist:fd6a1c0e85224f5c18d7e0069b847bc2
Created July 8, 2020 12:07
TKP - True Relative Movement on TOS
# ©TKPTrader on StockTwits and on Twitter- RolandoSantos
input rsiLength = 5;
input rsiBuy = 50;
input rsiSell = 50;
input tsiLong = 25;
input tsiShort = 5;
input tsiSignal = 14;
def TSI_value = TrueStrengthIndex("long length" = tsiLong, "short length" = tsiShort, "signal length" = tsiSignal);
def RSI_value = RSI("length" = rsiLength);

Setup environment

  • create container on Swiftstack client: qbr_migration, qbr_sync
  • mount NFS shares locally: fc_migration, fc_sync

Run file connector docker containers:

  • visit ssmanel page, show file connector doc
FROM alpine:latest
RUN apk update && apk add \
zlib-dev \
g++ \
gcc \
autoconf \
automake \
libtool \
valgrind \
@thiagodasilva
thiagodasilva / test_mpu.py
Created October 11, 2018 15:53
Upload an S3 MPU object and download just one part
[thiago@localhost source]$ cat test_mpu.py
import os
import boto3
class S3MultipartUpload(object):
# AWS throws EntityTooSmall error for parts smaller than 5 MB
PART_MINIMUM = int(6e6)
@thiagodasilva
thiagodasilva / gist:80d363da4bedbe48fcd97f27a58d5475
Last active April 3, 2018 21:23
HOWTO install gluster-swift
-- setup memcache
systemctl start memcached
systemctl enable memcached
-- setup gluster-swift
32 yum install openstack-swift
33 yum install openstack-swift-*
34 git clone https://github.com/gluster/gluster-swift.git
35 easy_install pip
36 cd gluster-swift/
Short-term v1.0 Status (no changes):
- standalone stateful Cinder with database and message-queue
- authentication with oauth-proxy (Adam's CNV Storage team)
- attaching problematic but it could be OK for now (we know we can solve it with flexvolumes, but we'll have to evaluate if it's worth doing it)
- chickend and egg: no solution for short term !!! (Paul thinking if possibly assigning someone full-time on this)
- productization of images/APBs from triple-o (OpenStack Storage)
- needs more discussion on ownership and delivery schedule
- CNV Storage to consume downstream images (when available) for feedback

S3/Swift REST API Comparison Matrix

General compatibility statement

S3 is a product from Amazon, and as such, it includes "features" that are outside the scope of swift itself. For example, swift doesn't have anything to do with billing, whereas S3 buckets can be tied to Amazon's billing system. Similarly, log delivery is a service outside of swift. It's entirely possible

@thiagodasilva
thiagodasilva / gist:aaf798a5fb7d7dea9e7577055a6ba5bf
Last active January 29, 2018 21:15
This gist contains the latest info on how to deploy tripleo-quickstart (at least this is what works for me - tdasilva)
good instructions here:
http://tripleo.org/install/containers_deployment/overcloud.html
** Minimal containers configuration **
0) run tripleo-quickstart:
./quickstart.sh --playbook quickstart-extras.yml \
--config ~/.quickstart/config/general_config/containers_minimal.yml --teardown all \
@thiagodasilva
thiagodasilva / vimrc
Last active August 14, 2018 15:16
vimrc geared towards python development
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required