Skip to content

Instantly share code, notes, and snippets.

@aviafelix
Last active May 4, 2018 17:09
Show Gist options
  • Save aviafelix/4e5bacfd5895ce4f0b18c9a1c98cb2e5 to your computer and use it in GitHub Desktop.
Save aviafelix/4e5bacfd5895ce4f0b18c9a1c98cb2e5 to your computer and use it in GitHub Desktop.
history files
sudo -i
su root
sudo -i
sudo shutdown -s
sudo shutdown -t 0
ip addr show
sudo yum install kbd
loadkeys sk
sudo loadkeys sk
localectl list=kezmaps
localectl list=keymaps
localectl list-keymaps
localectl set-keymap ru
sudo localectl set-keymap ru
sudo shutdown -t 5
hostname -s
hostname -f
hostnamectl set-hostname ceph
sudo hostnamectl set-hostname ceph
mount
ls /opt
ls /media/
ls /mnt
mc
mount /dev/sr0
gcc --version
python3 --version
sudo mount -a /dev/cdrom /mnt
ls /mnt
ls -la /mnt
mount
sudo umount /mnt
sudo mount -a /dev/sr0 /mnt
ls /mnt
sudo umount /mnt
sudo mount /dev/sr0 /mnt
ls /mnt
ls ~/Downloads
ls ~/
mkdir ~/Downloads
cp -R /mnt/* ~/Downloads/
cd ~/Downloads/
ls
tar xzvf VMwareTools-10.1.6-5214329.tar.gz
ls
ls vmware-tools-distrib/
./vmware-tools-upgrader-64
sudo ./vmware-tools-upgrader-64
cd vmware-tools-distrib/
ls
./vmware-install.pl
sudo ./vmware-install.pl
sudo shutdown -r -t 5
ls -la
sudo yum remove
sudo yum remove open-vm-tools
sudo shutdown -r -t 1
ip addr show
ssh aviafelix@192.168.0.32
cd Downloads/
ls
cd vmware-tools-distrib/
ls
sudo ./vmware-install.pl
sudo shutdown -t 0
ssh aviafelix@192.168.0.32
sudo shutdown -t now
shutdown -r -t
shutdown -r -t 2
sudo shutdown -r -t 2
sudo hostnamectl set-hostname ceph1
hostname
sudo shutdown -t0
mount
lsblk
sudo shutdown -r -t 2
sudo shutdown -r -t now
sudo -i visudo
sudo -i
sudo crontab -e
sudo vi /etc/yum.repos.d/ceph.repo
mc
sudo shutdown -t now
sudo -i visudo
sudo -i
sudo crontab -e
sudo vi /etc/yum.repos.d/ceph.repo
mc
sudo shutdown -r -t now
du -sh
df -h
mount
lsblk
cat /etc/networks
cat /etc/network/interfaces
ls ~/.ssh
cat ~/.ssh/authorized_keys
rm ~/.ssh/authorized_keys
cat ~/.ssh/authorized_keys
rm ~/.ssh/authorized_keys
ls ~/.ssh/
ls -la ~/.ssh
ssh ceph1
ssh-add /home/aviafelix/.ssh/id_rsa_aviafelix
sudo -i
yum find ceph
yum search ceph
yum search all ceph
sudo -i
sudo -i
\cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime
sudo crontab -e
sudo vi /etc/yum.repos.d/ceph.repo
mc
mc
ssh ceph1
ls
pwd
mkdir ceph-admin
cd ceph-admin/
ceph-deploy new ceph ceph1 ceph2
cd ceph-admin/
ceph-deploy mon create-initial
ceph-deploy --version
cat /etc/yum.repos.d/ceph-deploy.repo
ls
ls la
ls -la
mcedit ceph.conf
ceph-deploy mon create-initial
ceph-deploy install ceph ceph1 ceph2
ceph-deploy --version
cd ceph-admin/
ceph-deploy mon create-initial
ceph-deploy disk list ceph
ceph-deploy disk list ceph1
ceph-deploy disk list ceph2
ceph-deploy osd prepare ceph:sdb ceph1:sdb ceph2:sdb
ceph-deploy osd activate ceph:sdb1 ceph1:sdb1 ceph2:sdb1
sudo chmod +r /etc/ceph/ceph.client.admin.keyring
ceph osd tree
ceph -s
cd ceph-admin/
ceph-deploy mds create ceph
ceph status
touch file1 file1
touch file1 file2
ceph osd pool set rbd pg_num 256
ceph osd pool set rbd pg_num 16
ceph osd pool set rbd pg_num 64
ceph osd pool set rbd pgp_num 64
ceph status
ceph status
ceph status
ceph osd pool set rbd pg_num 128
ceph osd pool set rbd pgp_num 128
ceph status
ceph osd pool set rbd pg_num 256
ceph osd pool set rbd pg_num 128
sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --permanent --add-port=2003/tcp
sudo firewall-cmd --permanent --add-port=4505-4506/tcp
sudo firewall-cmd --reload
cd ceph-admin/
#ceph-deploy msd prepare ceph:
ceph-deploy disk list ceph
ceph-deploy msd prepare ceph:sdc
ceph-deploy mds create ceph
ceph status
ceph-deploy mds prepare ceph:sdc
ceph mds stat
ceph mds dump
mount
ceph mds dump
ceph mds stat
ceph status
mcedit ceph.conf
ceph-deploy --overwrite-conf admin ceph
ceph mds stat
ceph status
mcedit ceph.conf
ceph -s
ls /etc/ceph/
sudo chmod +r /etc/ceph/ceph.client.admin.keyring
ceph -s
ceph status
ceph mds stat
ceph-deploy disk zap ceph:sdc
ceph mds stat
ceph-deploy msd prepare ceph:sdc
ceph-deploy mds prepare ceph:sdc
ceph-deploy mds create ceph
ceph mds stat
ceph -s
ceph-deploy mds activate ceph:sdc1
ceph-deploy mds purge ceph
ceph-deploy mds -h
ceph-deploy mds create ceph ceph1 ceph2
ceph-deploy mds create ceph ceph1 ceph2 --overwrite-conf
ceph-deploy --overwrite-conf admin ceph ceph1 ceph2
ceph-deploy mds create ceph ceph1 ceph2
ceph -s
sudo chmod +r /etc/ceph/ceph.client.admin.keyring
ceph -s
ceph mds stat
ceph osd pool create cephfs_data 128
ceph osd pool create cephfs_metadata 128
ceph fs new cephfs cephfs_metadata cephfs_data
sudo yum install ceph-fuse
ls /opt
sudo mkdir /opt/storage
#sudo ceph-fuse -k /etc/ceph/ceph.client.admin.keyring -m
nslookup ceph
nslookup
sudo ceph-fuse -k /etc/ceph/ceph.client.admin.keyring -m 192.168.0.74:6789 /opt/storage
df -h
cd /opt
ls
cd storage/
ls
cd /
mc
ceph osd tree
ceph mds dump
ceph -s
cd ~/ceph-admin/
ls
cat ceph.conf
mc
ls
cd ceph-admin/
ls
ls -la
cd ..
ls
mc
ls -ls
ls -la
pwd
sudo -i
su root
sudo -i
sudo shutdown -s
sudo shutdown -t 0
ip addr show
sudo yum install kbd
loadkeys sk
sudo loadkeys sk
localectl list=kezmaps
localectl list=keymaps
localectl list-keymaps
localectl set-keymap ru
sudo localectl set-keymap ru
sudo shutdown -t 5
ip addr show
ssh aviafelix@192.168.0.74
sudo mount /dev/sdr0 /mnt
sudo mount /dev/sr0 /mnt
cd /mnt
ls
ls ~
mkdir ~/Downloads
cp -R * ~/Downloads/
cd ~/Downloads/
l
ls
tar xzvf VMwareTools-10.1.6-5214329.tar.gz
sudo yum remove openvm-tools
sudo yum show | grep vm
sudo yum list | grep vm
sudo yum remove open-vm-tools
cd vmware-tools-distrib/
sudo ./vmware-install.pl
ls /mnt
cd /
sudo shutdown -t 0
ssh aviafelix@192.168.0.74
sudo shutdown -t now
sudo visudo
sudo -i
# firewall-cmd --zone=public --permanent --add-port=3301/tcp
# firewall-cmd --reload
pwd
cd tarantool-sandbox
mkdir tarantool-sandbox
cd tarantool-sandbox
/usr/bin/tarantool
ls
pwd
ls -la
cat 00000000000000000000.snap
cat 00000000000000000000.xlog
cd tarantool-sandbox/
tarantoolctl connect '3301'
mcedit app.lua
tarantool app.lua
tarantool app.lua &
tarantoolctl connect '3301'
jobs
bg
fg
tarantoolctl connect '3301'
pwd
cd /opt
ls
cd ~
pwd
ls
cd tarantool-sandbox/
ls
tarantool --version
mcedit app.lua
tarantool app.lua &
mcedit app.lua
tarantool app.lua &
mcedit app.lua
tarantool app.lua &
ls ..
tarantoolctl connect '../tarantool.sock'
tarantoolctl connect ../tarantool.sock
tarantoolctl connect '/home/aviafelix/tarantool.sock'
jobs
fg
cd tarantool
cd tarantool-sandbox/
mcedit app.lua
tarantool app.lua &
tarantoolctl connect '/home/aviafelix/tarantool.sock'
cat app.lua
tarantoolctl connect '/home/aviafelix/tarantool.sock'
jobs
nohup 1
disown 1
jobs
jobs -l
disown
jobs
ps aux | grep tarantool
tarantoolctl connect '/home/aviafelix/tarantool.sock'
pkill tarantool
ps aux | grep [t]arantool
cd tarantool-sandbox/
mcedit app.lua
nohup tarantool app.lua
jobs
ls
cat nohup.out
nohup tarantool app.lua &
jobs
fg
tarantool app.lua & && disown
jobs
tarantool app.lua &
disown
jobs
jobs
ps aux | grep [t]arantool
pkill tarantool
ps aux | grep [t]arantool
tarantoolctl start app
cat /etc/tarantool/instances.available/example.lua
less /etc/tarantool/instances.available/example.lua
tarantoolctl start example
tarantoolctl connect 0:3311
tarantoolctl connect 0:3301
tarantoolctl stop example
ps aux | grep [t]arantool
tarantoolctl start example
ps aux | grep [t]arantool
tarantoolctl stop example
less /etc/tarantool/instances.available/example.lua
ls
mc
sudo -i
mc
tarantoolctl start app
ps aux | grep [t]arantool
systemctl status tarantool@app.service
journalctl -xe
sudo tarantoolctl start app
sudo ps aux | grep [t]arantool
sudo tarantoolctl start app
sudo ps aux | grep [t]arantool
tarantool app.lua &
jobs
disown
pkill tarantool
sudo ps aux | grep [t]arantool
tarantool app.lua &
pkill tarantool
tarantool app.lua &
pkill tarantool
tarantool app.lua &
pkill tarantool
mc\
mc
sudo shutdown -h -t 0
import mpld3
import json5 as j5
j5.version.VERSION
j5.loads(-5.5)
j5.loads('-5.5')
j5.loads('5.5')
j5.loads('+5.5')
j5.loads('+0.0')
j5.loads('-0.0')
j5.loads('[-0.0]')
j5.loads('[-0.0, +0.0]')
j5.loads('{-0.0, +0.0}')
j5.loads('{-0.0:1.0, +0.0:-1.0}')
j5.loads('{'-0.0':1.0, '+0.0':-1.0}')
j5.loads('{'-0.0\':1.0, \'+0.0\':-1.0}')
j5.loads("{'-0.0':1.0, '+0.0':-1.0}")
import json5 as j5
j5.loads('+0')
j5.loads('-0')
j5.loads('-1')
j5.loads('-100500')
j5.loads('-100500100500100500100500')
j5.loads('-1005001005001005001005000000000000000000000000000')
j5.loads('-1005001005001005001005000000000000000000000000000.100500')
len('1005001005001005001005000000000000000000000000000')
arr = [2, 8, 12]
g = (x for x in arr if arr.count(x) > 0)
arr = [1, 8, 25]
list(g)
with open('.id3d628ab4455118cc3b65ef5a031bbdf8d7d29a890', 'r') as f:
s = f.read()
s
import base64 as b64
b64.b64decode(s+'==', validate=False)
b64.b64decode(s+'==', validate=False).decode('utf-8')
b64.b64decode(s+'==', validate=False).decode('windows-1251')
b64.b64decode(s+'==', validate=False).decode('cp866')
def my_filter(pred, seq):
result = []
def my_filter(pred, seq):
result = []
for x in seq:
if pred(x):
result.append(x)
return result
above_zero = my_filter(bool, seq)
above_zero = lambda seq: my_filter(bool, seq)
above_zero([-1, 0, 1, 5, -5])
bool(0)
bool(-5)
v = memoryview(b'')
v
len(v)
bytes(v)
bytearray((v)
)
v.tobytes()
v.tolist(()
)
v.tolist()
memoryview(b'').tolist()
memoryview(b'012').tolist()
memoryview(b'абв').tolist()
memoryview(b'\x00\xff\xa0').tolist()
memoryview(b'\x00\xff\xa0').tobytes()
memoryview(b'\x00\xff\xa0')
b'{}'.format('a')
bytesarray(memoryview(b'\x00\xff\xa0'))
bytearray(memoryview(b'\x00\xff\xa0'))
"{}".format(b'q')
"{}".format(b'\xff\xae')
"\xff"
b"\xff"
"\xff".encode()
"\xff".encode('utf-8')
"\xff".encode('cp866')
"\xff".encode('cp-866')
"\xff".encode('windows-866')
"\xff".encode('windows-1251')
b"%a" % ('а')
b"%a" % ('абв')
v =b"%a" % ('абв')
v
bytearray(v)
len(v)
v.decode()
'абв'.encode()
'\u0430\u0431\u0432'.encode()
id(b'Hello World')
id(b'Hello World!')
id(b'Hello World!'.upper())
id(b'Hello World!')
id(bytearray(b'Hello World!'))
id(bytearray(b'Hello World!').upper())
bytearray.fromhex('aabb cc dd')
bytearray.fromhex('aabb cc dd vv')
0xbb in bytearray.fromhex('aabb cc dd')
0xbc in bytearray.fromhex('aabb cc dd')
memoryview(bytearray.fromhex('aabb cc dd'))
memoryview(bytearray.fromhex('aabb cc dd'))[0]
memoryview(bytearray.fromhex('aabb cc dd'))[0:]
memoryview(bytearray.fromhex('aabb cc dd'))[:]
memoryview(bytearray.fromhex('aabb cc dd'))[0:3]
memoryview(bytearray.fromhex('aabb cc dd'))[0:2]
memoryview(bytearray.fromhex('aabb cc dd'))[1]
memoryview(bytearray.fromhex('aabb cc dd'))[2]
memoryview(bytearray.fromhex('aabb cc dd'))[3]
memoryview(bytearray.fromhex('aabb cc dd'))[4]
bytearray.fromhex('aabb cc dd')[4]
bytearray.fromhex('aabb cc dd')[-1]
bytearray.fromhex('aabb cc dd').tobytes()
memoryview(bytearray.fromhex('aabb cc dd')).tobytes()
memoryview(id).tobytes()
memoryview(v).tobytes()
memoryview(dict()).tobytes()
dict()
h = dict()
memoryview(h).tobytes()
memoryview('abc').tobytes()
memoryview(bytearray.fromhex('aabb cc dd')) is memoryview(b'\xaa\xbb\xcc\xdd')
bytes.fromhex('aabb cc dd') is b'\xaa\xbb\xcc\xdd'
import array
array.array()
array.array('b')
array.array('Q')
v = array.array('Q')
v
v[0]
v.append(123)
v
v[0]
class Dict(dict)
class Dict(dict): pass
d = Dict(red=1, green=2, blue=3)
d
d['h' : v]
d['h'] = v
d
del h
d
reload
def f(v):
def g(x):
return (f, x)
return g(f)
f(f)
f(1)
def f(v):
s = 'tmp'
def g(x):
return (f, s, x)
return (g(f), g(v))
f(1)
def f(v):
s = v
def g(x):
print(s, x)
return g
f('dfvedfrbf')
u = f('dfvedfrbf')
u('abc')
u('abcd')
1.to_bytes()
(1).to_bytes()
(1).to_bytes(1)
(1).to_bytes(1, 1)
(1).to_bytes(1, 'BIG')
(1).to_bytes(1, 'big')
(1).to_bytes(1, 'little')
1.to_bytes(1, 'little')
(1).to_bytes(1, 'little')
(256).to_bytes(1, 'little')
(256).to_bytes(2, 'little')
(256).to_bytes(2, 'big')
True.imag
True.to_bytes(
)
True.to_bytes()
True.to_bytes(1, 'big')
395629876591629546941085923958692650.to_bytes()
395629876591629546941085923958692650.to_bytes(1, 'big')
(395629876591629546941085923958692650).to_bytes(1, 'big')
(395629876591629546941085923958692650).to_bytes(8, 'big')
(395629876591629546941085923958692650).to_bytes(16, 'big')
(395629876591629546941085923958692650).to_bytes(32, 'big')
(395629876591629546941085923958692650).to_bytes(32, 'little')
0x123
0xfafafa010203040506070809bacdfe.to_bytes()
0xfafafa010203040506070809bacdfe.to_bytes(1)
0xfafafa010203040506070809bacdfe.to_bytes(1, 'big')
0xfafafa010203040506070809bacdfe.to_bytes(32, 'big')
0xfafafa010203040506070809bacdfe.to_bytes(32, 'little')
0xfafafa010203040506070809bacdfe.to_bytes(16, 'little')
0xfafafa010203040506070809bacdfe.to_bytes(16, 'big')
1024 * 30
import time
from testtest import test
test()
import tarantool
tnt = tarantool.connect('tarantool', 3301)
tnt.schema()
tnt.schema
tnt.schema.con
tnt.schema.schema
tnt.space()
tnt.user
tnt.version_id
tnt.select()
tnt.select('tester')
tnt.space()
tnt.space('tester')
t = tnt.space('tester')
t.select()
t.space_no
t.call()
tnt.schema.fetch_space_all()
tnt.schema.fetch_space_from()
tnt.schema.fetch_space_from('tester')
tnt.schema.fetch_index()
tnt.schema.schema
tnt.schema.schema.keys()
tnt.schema.schema['tweedledum']
s = tnt.schema.schema['tweedledum']
d
s.name
s.schema
s.sid
s.arity
s.indexes
tnt.space('tweedledum')
tnt.space('tweedledum').fetch
t = tnt.space('tweedledum')
t.select()
t.space_no
for it in range(100000):
r = tnt.insert('tester', (it, data[it % 256]))
import string
mod_len = len(string.printable)
mod_len
data = [string.printable[it] * 1536 for it in range(mod_len)]
data
len(data)
for it in range(100000):
r = tnt.insert('tester', (it, data[it % 256]))
for it in range(5, 100000):
r = tnt.insert('tester', (it, data[it % 256]))
for it in range(5, 100000):
r = tnt.insert('tester', (it, data[it % mod_len]))
tnt.space('tester').select()
tnt.space('tester').clear()
t = tnt.space('tester')
t.delete()
t.delete(key=1)
t.delete(key=2)
t.delete(key=3)
t.delete(key=4)
t.delete(key=5)
t.delete(key=100)
t.delete(key=101)
for key in range(100): t.delete(key=key)
for it in range(100000):
r = tnt.insert('tester', (it, data[it % mod_len]))
for key in range(100): t.delete(key=key)
for key in range(100): g = t.delete(key=key)
for it in range(100000):
r = tnt.insert('tester', (it, data[it % mod_len]))
print(it)
s = tnt.space('tester')
tnt.schema('tester')
tnt.schema.get_index
tnt.schema.get_index()
tnt.schema.get_index('tester')
tnt.schema.fetch_index('tester')
tnt.schema.index_from('tester')
tnt.schema.fetch_index_from('tester')
tnt.schema.schema
for it in range(100000):
r = tnt.insert('tester', (it, it, data[it % mod_len]))
for key in range(100000): t.delete(key=key)
for it in range(100000):
r = tnt.insert('tester', (it, it.to_bytes().decode('utf-8'), data[it % mod_len]))
for it in range(100000):
r = tnt.insert('tester', (it, it.to_bytes(8).decode('utf-8'), data[it % mod_len]))
r = tnt.insert('tester', (it, it.to_bytes(8, 'big').decode('utf-8'), data[it % mod_len]))
for it in range(100000):
r = tnt.insert('tester', (it, it.to_bytes(8, 'big').decode('utf-8'), data[it % mod_len]))
for it in range(100000):
r = tnt.insert('tester', (it, it.to_bytes(8, 'big'), data[it % mod_len]))
for key in range(100000): t.delete(key=key)
for key in range(100000): g = t.delete(key=key)
for it in range(100000):
r = tnt.insert('tester', (it, it.to_bytes(8, 'big'), data[it % mod_len]))
for key in range(1000): g = t.delete(key=key)
for it in range(100000):
r = tnt.insert('tester', (it, it.to_bytes(8, 'big').decode('ascii'), data[it % mod_len]))
for key in range(256): g = t.delete(key=key)
for it in range(100000):
r = tnt.insert('tester', (it, it.to_bytes(8, 'big').decode('hex+codec'), data[it % mod_len]))
for it in range(100000):
r = tnt.insert('tester', (it, it.to_bytes(8, 'big').decode('hex_codec'), data[it % mod_len]))
for it in range(100000):
str(b'fbdfb')
for it in range(100000):
r = tnt.insert('tester', str((it, it.to_bytes(8, 'big')), data[it % mod_len]))
for it in range(100000):
r = tnt.insert('tester', (it, str(it.to_bytes(8, 'big')), data[it % mod_len]))
tnt.host
tnt.encoding
tnt.uuid
tnt.error
tnt.flush_schema('tester')
tnt.flush_schema()
s = tnt.space('tester')
s.insert()
s.connection
for key in range(100000): g = t.delete(key=key)
tnt = tarantool.connect('tarantool', 3301)
s = tnt.space('tester')
s = tnt.space('example')
tnt.schema
tnt.schema.schema
tnt.schema.schema.keys()
tnt.schema.
tnt.schema.schema.keys()
tnt.schema.schema[289]
tnt.schema.schema[297]
a = list(tnt.schema.schema.keys())
a.sort()
a
for g in a:
if isinstance(g, str):
a.remove(g)
a
type(a[1])
a.remove('_vuser')
a.remove('_truncate')
a
a.sort()
a
b = (tnt.schema.schema[g] for g in a)
b
b = list(b)
b
len(b)
a = b[0]
a
a.name
a.schema
tnt.space('example')
tnt = tarantool.connect('good:secret@tarantool', 3301)
tnt = tarantool.connect('tarantool', 3301)
tnt.authenticate('good', 'secret')
tnt.authenticate()
tnt.authenticate('', '')
tnt.authenticate('guest', '')
tnt = tarantool.connect('tarantool', 3301)
tnt.schema.schema.keys()
tnt.space('example')
tnt = tarantool.connect('tarantool', 3301)
tnt.space('example')
example = tnt.space('example')
example.insert((0, 5, {'a': 'b'}))
example.select()
example.select(0)
example.select(1)
example.insert((-1, 5, {'a': 'b', 'c': {1: 'd'}}))
example.insert((1, 5, {'a': 'b', 'c': {1: 'd'}}))
example.insert(('o', 5, {'a': 'b', 'c': {1: 'd'}, 'v': [1, 2, 's']}))
example.insert((6, 5, {'a': 'b', 'c': {1: 'd'}, 'v': [1, 2, 's']}))
example.select()
example.select(6)
example.select(5)
example.select(0)
import cradox as rados
cluster = rados.Rados(conffile='ceph.conf')
cluster.version(
)
str(cluster.version())
v = cluster.version()
v.extra
cluster.conf_get('mon initial members')
cluster.connect()
cluster = rados.Rados(conffile='ceph.conf', conf=dict(keyring='/home/aviafelix/Downloads/_rados/ceph.bootstrap-osd.keyring'))
cluster.connect()
cluster = rados.Rados(conffile='ceph.conf', conf=dict(keyring='/home/aviafelix/Downloads/_rados/ceph.client.admin.keyring'))
cluster.connect()
cluster.get_fsid()
cluster.get_cluster_stats()
cluster.list_pools()
cluster.create_pool('test')
cluster.list_pools()
cluster.delete_pool('test')
cluster.list_pools()
ioctx = cluster.open_ioctx('data')
ioctx = cluster.open_ioctx('test')
cluster.list_pools()
cluster.create_pool('test')
ioctx = cluster.open_ioctx('test')
ioctx.close()
ioctx = cluster.open_ioctx('test')
ioctx.write_full("hw", "Hello World!")
ioctx.write_full("hw", b"Hello World!")
ioctx.read("hw")
ioctx.remove_object('hw')
ioctx.list_objects()
obj_it = ioctx.list_objects()
obj_it.next()
ioctx.write_full("hw", b"Hello World!")
obj_it.next()
obj_it = ioctx.list_objects()
obj_it.next()
next(obj_it)
obj_it = ioctx.list_objects()
obj = next(obj_it)
obj.key
obj.state
obj.read()
cluster = rados.Rados(conffile='ceph.conf', conf=dict(keyring='/home/aviafelix/Downloads/_rados/ceph.client.admin.keyring'))
import cradox as rados
cluster = rados.Rados(conffile='ceph.conf', conf=dict(keyring='/home/aviafelix/Downloads/_rados/ceph.client.admin.keyring'))
cluster.connect()
cluster.list_pools()
pools = cluster.list_pools()
ioctx = cluster.open_ioctx(rbd)
ioctx = cluster.open_ioctx('rbd')
obj_it = ioctx.list_objects()
obj = next(obj_it)
ioctx = cluster.open_ioctx('cephs_data')
ioctx = cluster.open_ioctx('cephfs_data')
obj_it = ioctx.list_objects()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
ioctx = cluster.open_ioctx('cephfs_metadata')
obj_it = ioctx.list_objects()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
obj.key
obj.read()
obj = next(obj_it)
obj.key
while True:
obj = next(obj_it)
print(obj.key)
print(obj.read())
box.cfg{listen=3301}
s = box.schema.space.create('tester')
s:create_index('primary', {
type = 'hash',
parts = {1, 'unsigned'}
})
t = s:insert({1, 'Roxette'})
t = s:insert({2, 'Scorpions', 2015})
t = s:insert({3, 'Ace of Base', 1993})
t = s:insert({1, 'Roxette-1'})
s:select{3}
s:select(3)
s = box.schema.space.create('tester')
s:create_index('secondary', {
type = 'hash',
parts = {2, 'string'}
})
box.schema.user.grant('guest', 'read,write,execute', 'universe')
box.space.tweedledum:select(1)
s:select{3}
print("Hi!")
print{"Hi!"}
print{"Hi!", "Hi!", "Hi!"}
print({"Hi!", "Hi!", "Hi!"})
print("Hi!", "Hi!", "Hi!")
print("Hi!" .. "Hi!" .. "Hi!")
s = box.space.tester.get(3)
box.space.tester.get(3)
box.space.tester.select(3)
box.space.tester:select(3)
box.space.tester:select()
#!/bin/sh
export PID_FILE=_jupyter.pid
if [ -f $PID_FILE ]; then
echo "Jupyter already running"
exit 1
fi
echo "[ Juyter Started ]"
jupyter-notebook --no-browser >> _jupyter-server.log 2>&1 &
echo $! > $PID_FILE
#!/bin/sh
JUPYTER_PID_FILE=_jupyter.pid
[ -f ${JUPYTER_PID_FILE} ] && pkill -F ${JUPYTER_PID_FILE} && rm ${JUPYTER_PID_FILE} && echo "Jupyter killed" || echo "Can't stop Jupyter"
[ -f ${JUPYTER_PID_FILE} ] && rm ${JUPYTER_PID_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment