Skip to content

Instantly share code, notes, and snippets.

$ curl -i https://cloud.swiftstack.com/v1/AUTH_hugo/c1/test.txt?multipart-manifest=get -X GET -H "X-Auth-Token: AUTH_tk123"
[{"hash": "e580d86519c941eaf0736e279859fa78", "last_modified": "2019-06-13T14:21:55.000000", "bytes": 1400, "name": "/c1_segments/test.txt/slo/1560435534.950524/1453/1400/00000000", "content_type": "application/swiftclient-segment"}, {"hash": "61b976105aadf19ba6117c3b5b13850b", "last_modified": "2019-06-13T14:21:55.000000", "bytes": 53, "name": "/c1_segments/test.txt/slo/1560435534.950524/1453/1400/00000001", "content_type": "application/swiftclient-segment"}]
$ curl -i https://cloud.swiftstack.com/v1/AUTH_hugo/c1/test.txt?multipart-manifest=get -I -H "X-Auth-Token: AUTH_tk123"
HTTP/1.1 200 OK
Content-Length: 464
Content-Type: application/json; charset=utf-8
Accept-Ranges: bytes
@HugoKuo
HugoKuo / 304-HEAD-match.py
Created June 4, 2019 03:37
if-none-match cases
(python-swiftclient) Hugos-2016-MacBook-Pro:swift-source-files hugo$ swift --debug stat match-test 2.txt -H "if-none-match: c5f8ea22debac96d25c4c105d2af1ff6"
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.22.92
DEBUG:requests.packages.urllib3.connectionpool:http://192.168.22.92:80 "GET /auth/v1.0 HTTP/1.1" 200 0
DEBUG:swiftclient:REQ: curl -i http://192.168.22.92/auth/v1.0 -X GET
DEBUG:swiftclient:RESP STATUS: 200 OK
DEBUG:swiftclient:RESP HEADERS: {u'Content-Length': u'0', u'Set-Cookie': u'X-Auth-Token=AUTH_tkb6c56e03bde5487993d83a6ba4a50727; Path=/', u'X-Trans-Id': u'tx420b14ff06a24416bca8f-005cf5e731', u'X-Auth-Token': u'AUTH_tkb6c56e03bde5487993d83a6ba4a50727', u'X-Storage-Token': u'AUTH_tkb6c56e03bde5487993d83a6ba4a50727', u'Date': u'Tue, 04 Jun 2019 03:36:17 GMT', u'X-Storage-Url': u'http://192.168.22.92/v1/AUTH_demo', u'Content-Type': u'text/plain; charset=UTF-8', u'X-Openstack-Request-Id': u'tx420b14ff06a24416bca8f-005cf5e731'}
DEBUG:requests.packages.urllib3.
@HugoKuo
HugoKuo / wrong_dev_info.md
Created May 16, 2019 04:55
device api response
[root@d-node1 lib]# fdisk -l | grep sdd -A 6
Disk /dev/sdd: 3221 MB, 3221225472 bytes, 6291456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@d-node1 lib]# df -h | grep srv
@HugoKuo
HugoKuo / failed-keystone.py
Last active January 7, 2019 10:10
keystone middleware
Jan 7 15:50:36 platform-ssnode2 keystoneauth.identity.v3.base: {"token": {"is_domain": false, "methods": ["password"], "roles": [{"id": "9fe2ff9ee4384b1894a90878d3e92bab", "name": "_member_"}, {"id": "5d6fec4a03734ea89c4c7b6e5860aac9", "name": "admin"}], "expires_at": "2019-01-07T08:50:36.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "41e9b677f7b74d2f874aa2b226603f97", "name": "service"}, "catalog": [{"endpoints": [{"url": "http://127.0.0.1:35357", "interface": "admin", "region": "RegionOne", "region_id": "RegionOne", "id": "88a554d433d54b2db3f495b957f15cd0"}, {"url": "http://127.0.0.1:5000", "interface": "internal", "region": "RegionOne", "region_id": "RegionOne", "id": "2691cf24505b4c5bb564c747e63e78d6"}, {"url": "http://127.0.0.1:5000", "interface": "public", "region": "RegionOne", "region_id": "RegionOne", "id": "17837d8b78634f4fa8ebca588dee264d"}], "type": "identity", "id": "ad88f33de0cc4394864e9609776f2578", "name": "keystone"}, {"endpoints": [{"url": "http://192.168.56.70
Hugos-2016-MacBook-Pro:~ root# netstat
Active Internet connections
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 192.168.10.91.64992 tsa01s08-in-f14..https ESTABLISHED
tcp4 0 0 192.168.10.91.64987 ec2-54-204-54-41.https ESTABLISHED
tcp4 0 0 192.168.10.91.64984 tsa03s02-in-f147.https ESTABLISHED
tcp4 0 0 192.168.10.91.64977 tsa01s09-in-f14..https ESTABLISHED
tcp4 0 0 192.168.10.91.64976 ec2-34-233-33-23.https ESTABLISHED
tcp4 0 0 192.168.10.91.64972 tsa03s02-in-f10..https ESTABLISHED
tcp4 0 0 192.168.10.91.64971 tsa03s01-in-f2.1.https ESTABLISHED
(swiftcli)HugotekiMacBook-Air:data hugo$ aws s3 mb s3://container
make_bucket: container
(swiftcli)HugotekiMacBook-Air:data hugo$ swift list -l
0 0 2018-09-27 08:32:22 awscli-container
0 0 2018-09-27 08:33:26 awscli-container2
0 0 2018-09-27 08:40:02 container
6 3405 2018-09-26 08:46:15 upload-via-swiftcli
4 10485760 2018-09-26 08:47:09 upload-via-swiftcli_segments
10 10489165
@HugoKuo
HugoKuo / keystone_v2-response.json
Created August 30, 2018 03:09
Keystone response JSON body
root@keystone:~/keystone_install# curl -d '{"auth":{"passwordCredentials":{"username": "swiftstack", "password": "password"},"tenantName":"SS"}}' -H "Content-type: application/json" http://localhost:5000/v2.0/tokens | python -mjson.tool
{
"access": {
"metadata": {
"is_admin": 0,
"roles": [
"9fe2ff9ee4384b1894a90878d3e92bab",
"d76174a6eb80428bba3227c9b0ff1da6"
]
[root@platform-ssnode1 ~]# netstat -antulp | grep python | grep 11211
tcp 0 0 192.168.56.70:62391 192.168.56.70:11211 ESTABLISHED 2604/python
tcp 0 0 192.168.56.70:61399 192.168.56.70:11211 ESTABLISHED 2600/python
tcp 0 0 192.168.56.70:21654 192.168.56.70:11211 ESTABLISHED 2604/python
tcp 0 0 192.168.56.70:20144 192.168.56.70:11211 ESTABLISHED 2604/python
tcp 0 0 192.168.56.70:23963 192.168.56.70:11211 ESTABLISHED 2604/python
tcp 0 0 192.168.56.70:63968 192.168.56.70:11211 ESTABLISHED 2604/python
tcp 0 0 192.168.56.70:18769 192.168.56.70:11211 ESTABLISHED 2604/python
tcp 0 0 192.168.56.70:25319 192.168.56.70:11211 ESTABLISHED 2602/python
tcp 0 0 192.168.56.70:64892 192.168.56.70:11211 ESTABLISHED 2604/python
@HugoKuo
HugoKuo / x.py
Created January 12, 2018 08:37
firewalld
-- Logs begin at Fri 2018-01-12 16:34:52 CST, end at Fri 2018-01-12 16:36:23 CST. --
Jan 12 16:35:01 ssnode1x-platform-centos7 systemd[1]: Starting firewalld - dynamic firewall daemon...
Jan 12 16:35:03 ssnode1x-platform-centos7 systemd[1]: Started firewalld - dynamic firewall daemon.
Jan 12 16:35:07 ssnode1x-platform-centos7 firewalld[680]: ERROR: NOT_ENABLED: rule '('-j', 'ssacct-in')' is not in 'ipv4:filter:INPUT'
Jan 12 16:35:08 ssnode1x-platform-centos7 firewalld[680]: ERROR: NOT_ENABLED: rule '('-j', 'ssacct-out')' is not in 'ipv4:filter:OUTPUT'
Jan 12 16:35:10 ssnode1x-platform-centos7 firewalld[680]: ERROR: NOT_ENABLED: chain 'ssacct-in' is not in 'ipv4:filter'
Jan 12 16:35:10 ssnode1x-platform-centos7 firewalld[680]: ERROR: NOT_ENABLED: chain 'ssacct-out' is not in 'ipv4:filter'
Jan 12 16:35:11 ssnode1x-platform-centos7 firewalld[680]: ERROR: NOT_ENABLED: rule '('-j', 'ssnode-in')' is not in 'ipv4:filter:INPUT'
Jan 12 16:35:12 ssnode1x-platform-centos7 firewalld[680]: ERROR: NOT_ENABLED: rule '('-j',
@HugoKuo
HugoKuo / expirer-check.py
Created January 8, 2018 05:23 — forked from clayg/expirer-queue-cleanup.py
Poke around at expired objects
#!/usr/bin/env python
#
# This looks at what's in the expiring objects queue, asks the object
# servers for the current real state of the objects, and then prints it all
# out.
import argparse
import sys
import itertools
import eventlet