Skip to content

Instantly share code, notes, and snippets.

@patter001
patter001 / size_test.py
Last active May 5, 2016 00:27
lmdb size test
import lmdb
def test():
env = lmdb.open("test.lmdb", max_dbs=1, map_size=15*1024*1024)
try:
value = bytearray(" "*9*1024*1024)
with env.begin(write=True, buffers=True) as txn:
txn.put("big", value, dupdata=False, overwrite=True)
@patter001
patter001 / ibc_manager.py
Last active December 16, 2020 05:02
Python method for synchronizing the startup of IBC
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
To use, import in to your file, and the main thing you want is run the *safe_launch_ibc* function
pass in your path to your start script (code assumes LOG directory is in the same directory), pass