- Note: wait for some time before it finishes
for x in $(qdbus | sed '/^:/d'); do
for y in $(qdbus $x); do
qdbus $x $y | sed "s~^~$x $y ~"
done
QUERY PLAN | |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0) (actual time=176101.644..176102.085 rows=25 loops=1) | |
Task Count: 1 | |
Tuple data received from nodes: 34 kB | |
Tasks Shown: All | |
-> Task | |
Tuple data received from node: 34 kB | |
Node: host=localhost port=5432 dbname=parkpow_distributed | |
-> Limit (cost=1.31..110.89 rows=25 width=1864) (actual time=176034.509..176054.118 rows=25 loops=1) |
import asyncio | |
import sys | |
import time | |
def EXITED(): | |
# Did app terminate | |
pass | |
class PatchableStderrStream(object): | |
def __init__(self): |
I use this following directory structure to install and use xonsh with ease. It enables adding new xontribs easily and keep the user packages in single place in a maintainable way.
My xonsh config folder - ~/.config/xonsh
looks like this
~/.config/xonsh 🤖noor🖥firefist 🕰️ 12:36:51P
🐍xonsh $ tree -L 1 -a
.
import importlib.resources as ires | |
import xonsh | |
def xontrib_metadata_json(): | |
"""Loads and returns the xontribs.json file.""" | |
import json | |
with ires.open_text("xonsh", "xontribs.json") as f: | |
md = json.load(f) |
class ModelBulkCreator: | |
def __init__(self, cap=100): | |
self.Model: Model = None | |
self.cap = cap | |
self._objects = [] | |
def add(self, obj): | |
if not self.Model: | |
self.Model = type(obj) | |
self._objects.append(obj) |
from anom import Model, Key, transactional, delete_multi | |
from models.exceptions import IntegrityError | |
class Unique(Model): | |
"""A model to store unique values. | |
The only purpose of this model is to "reserve" values that must be unique | |
within a given scope, as a workaround because datastore doesn't support | |
the concept of uniqueness for entity properties. |
from collections import namedtuple | |
import enum | |
from django.db import connection, transaction | |
from django.db.models import Model, Subquery, IntegerField, Sum, Func | |
from django.db.models.sql import InsertQuery | |
from typing import List, Type, Dict, Any, Union, NamedTuple, Tuple | |
from . import signals |
# check for updates | |
sudo apt-get update | |
sudo apt-get upgrade | |
# for installation doc https://github.com/twilio/OpenVBX/blob/master/INSTALL.markdown | |
# step1 download OpenVBX | |
wget -O openvbx.tgz https://github.com/twilio/OpenVBX/tarball/master | |
tar xf openvbx.tgz | |
sudo cp -r twilio-OpenVBX-bc9b3d6/* /var/www/html/ |