development

Python Cheatsheet: Part III

Lists my_list = [1,42,3,54,3,56,2] Delete an element # If you know the index del my_list[0] # Or you want to delete a slice del my_list[2:4] # if you want to delete the first occurrence my_list.remove(3) Concatenation >>> list1 = [34, 65] >>> list1 = list1 + [44, 77] >>> print(list1) [34, 65, 44, 77] Add […]

Read more
development

Python Cheatsheet: Part II

Strings Since strings are immutable, each function creates a new string as output. – index(‘pat’) # return ValueError if pat not exist – find(‘pat’) # index or -1 x = “junkstringjunk” print(x.strip(“junk”)) # o/p = string String Slicing x = ‘mytestdata’ start = 0 end = 2 # One more than the needed index step […]

Read more
development

Python Cheatsheet: Part I

Math Functions import math n = math.floor(1.5) m = math.ceil(1.5) k = abs(-19) Input string_data = input(‘Enter your data: ‘) print(type(string_data)) # String Formatting # 0 & 1 are index of the parameters text = “My planet is {0} in the {1}” print(text.format(‘Earth’, ‘galaxy’)) String text = “hello world! It’s lovely 2019” freq = text.count(‘lo’) […]

Read more
development

Ceph RGW Internals: Cache Coherence & Bucket Life Cycles

RGW Cache Coherence Why RGW have a control pool? We will try to understand its use case and purpose in RGW for cache synchronization. RGWRados::init_watch() Creates watcher objects in RGW control pool $ sudo rados ls -p .in-abc-1.rgw.control notify.1 notify.6 notify.3 notify.7 notify.2 notify.4 notify.5 notify.0 The common assumption is that these objects are watched […]

Read more
internals, kernel, linux, memory management

Linux Memory Management: Slabs

Memory slabs are used by Linux kernel to manage memory for kernel objects. The objects are e.g dentry, inodes, and buffer heads Why to Know About Slabs If you don’t understand about missing usage info of cached memory objects. The system is low on memory and top & free are not enough. Design of Slab […]

Read more