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
# delete given files and found files | |
find . -name '*.pyc' -print0 | xargs -0 rm | |
# List of files in a commit | |
git diff-tree --no-commit-id --name-only -r bd61ad98 | |
# Mount a windows cifs mount on ubuntu | |
sudo apt-get install cifs-utils | |
sudo mount.cifs //10.1.192.14/lab/COS_Share lab-cosshare -o user=<username> |
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
export OS_USERNAME=swift | |
export OS_PASSWORD=SWIFT_PASS | |
export OS_TENANT_NAME=service | |
export OS_AUTH_URL=http://192.168.33.20:35357/v2.0 |
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
export OS_USERNAME=admin | |
export OS_SERVICE_TOKEN=ADMIN | |
export OS_SERVICE_ENDPOINT=http://192.168.33.20:35357/v2.0 |
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
export OS_SERVICE_TOKEN=ADMIN | |
export OS_SERVICE_ENDPOINT=http://192.168.33.20:35357/v2.0 | |
# get keystone auth token | |
# * Note: each time this is run, keystone generates a new token and this is the token that is considered valied for the user. | |
curl 'http://127.0.0.1:5000/v2.0/tokens' -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{"auth": {"tenantName": "service", "passwordCredentials": {"username": "swift", "password": "SWIFT_PASS"}}}' | python -mjson.tool | |
# get endpoint for service type 'object-store' | |
serviceCatalog": [ |
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
# Getting account based on tenant id | |
def _get_account_for_tenant(self, tenant_id): | |
return '%s%s' % (self.reseller_prefix, tenant_id) | |
def _reseller_check(self, account, tenant_id): | |
"""Check reseller prefix.""" | |
return account == self._get_account_for_tenant(tenant_id) | |
# authorizing account |
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
[[local|localrc]] | |
# Credentials | |
OS_PASSWORD=password | |
ADMIN_USER=stack | |
ADMIN_PASSWORD=$OS_PASSWORD | |
DATABASE_PASSWORD=$OS_PASSWORD | |
SERVICE_PASSWORD=$OS_PASSWORD | |
SERVICE_TOKEN=$OS_PASSWORD | |
RABBIT_PASSWORD=$OS_PASSWORD |
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
#create ring | |
swift-ring-builder object.builder create 10 3 1 | |
# 1 node and n disks | |
for n in {1..8}; do swift-ring-builder object.builder add z1-10.0.0.1:6000/sdb$n 100; done | |
#update rings | |
swift-ring-builder object.builder rebalance | |
# view placement |
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
swift/swift/obj/server.py | |
import cPickle as pickle | |
import os | |
import multiprocessing | |
import time | |
import traceback | |
import socket | |
import math | |
from swift import gettext_ as _ |
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
parted -s /dev/sdb mklabel gpt | |
parted -s /dev/sdb mkpart data xfs 0% 100% | |
mkfs.xfs -f -L sdb /dev/sdb1 | |
mount -t xfs -o noatime,nodiratime,logbufs=8 -L sdb /srv/node/sdb |
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
# ip addr add 172.32.0.169/24 dev eth3 | |
# iscsiadm -m discovery -t st -p 172.32.0.1 | |
172.32.0.1:3260,1 iqn.2003-10.com.lefthandnetworks:cloudos-storevirtual:1667:cloudos3-blade3-volume2 | |
172.32.0.1:3260,1 iqn.2003-10.com.lefthandnetworks:cloudos-storevirtual:360:cloudos3-blade3-volume1 | |
# iscsiadm -m node --login |
OlderNewer