Skip to content

Instantly share code, notes, and snippets.

### after run proxy container###
$ apt install -y git curl
$ curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
$ python get-pip.py
$ pip install boto3
$ git clone https://github.com/swiftstack/swift-redirector.git
@chianingwang
chianingwang / comparison.py
Last active January 10, 2018 22:42
find out source and destination cluster account - container conflict or account - container - object confliction
#!/usr/bin/python
import swiftclient
import pprint
import Queue
import threading
import time
import timeit
import keystoneclient
import ConfigParser
===proxy.conf===
pipeline = healthcheck proxy-logging cache swift3 bulk tempurl tempauth cloud_sync_shunt authtoken keystoneauth slo dlo proxy-logging proxy-server
[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = admin, swiftoperator
reseller_prefix = KEY_
reseller_admin_role = ResellerAdmin
@chianingwang
chianingwang / GIF-Screencast-OSX.md
Created December 11, 2017 20:40 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

(venv) root@developer:~/swift-s3-sync# ./venv/bin/nosetests ./test/integration
....EEEE
======================================================================
ERROR: test_swift_archive (test_s3_sync.TestCloudSync)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/swift-s3-sync/test/integration/test_s3_sync.py", line 331, in test_swift_archive
expected_location)
File "/root/swift-s3-sync/test/integration/test_s3_sync.py", line 237, in _test_archive
swift_hdrs, listing = wait_for_condition(5, _check_expired)
# Code Example - PySwiftClientKeyStoneAuth.py
import swiftclient.client as swiftclient
# reference: # https://docs.openstack.org/python-swiftclient/latest/client-api.html
# v3
#_authurl = 'http://172.28.128.43:35357/v3/'
#_auth_version = '3'
#_user = 'admin'
sync_swift.py
==============
...
def _get_client_factory(self):
# TODO: support LDAP auth
# TODO: support v2 auth
username = self.settings['aws_identity']
key = self.settings['aws_secret']
code I modified ( not sure it's correct or not )
===s3_sync/provider_factory.py===
from .sync_s3 import SyncS3
from .sync_swift import SyncSwift
def create_provider(sync_settings, max_conns, per_account=False):
provider_type = sync_settings.get('protocol', None)
if not provider_type or provider_type == 's3':
package tcp
import (
"io"
"log"
"net"
"os"
)
// Progress indicates transfer status
# demo outline - bbb_sunflower_1080_2min.mp4
# 1. DLO upload to container demo to get Segments
# 2. Server Side Copy Segments
# 3. upload SLO json for copied Segments
# leverage DLO to get
$ swift -A https://cloud.swiftstack.com/auth/v1.0 -U xxx -K xxx upload demo -S 10485760 bbb_sunflower_1080_2min.mp4
bbb_sunflower_1080_2min.mp4 segment 0
bbb_sunflower_1080_2min.mp4 segment 2
bbb_sunflower_1080_2min.mp4 segment 1