This is a demo on how to handle remote process execution in asyncio
Obviously don't use in production as there's no auth.
- Supports starting processes and killing them
- Streams stdin/out/err
- Optional PTY mode with resizing support
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import subprocess | |
__all__ = ["transform"] | |
__version__ = '0.3' | |
__author__ = 'Christoph Burgmer <cburgmer@ira.uka.de>' | |
__url__ = 'http://github.com/cburgmer/upsidedown' |
OpenCV's VideoCapture is broken and hasn't been fixed for the last 5 years: opencv/opencv#9053
This is a PyAV based replacement. Unlike other implementations it can seek at any time.
How to use:
reader = VideoReader('video.mp4')
reader.seek(reader.total_frames - 100) # frame number
while True:
drop table if exists test; | |
set character_set_client = utf8mb4; | |
create table test (x varchar(1024) character set utf8mb4 COLLATE utf8mb4_general_ci) character set utf8mb4 COLLATE utf8mb4_general_ci; | |
insert into test values ("👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍 |
// ----------- | |
// Challenge 0 | |
// ----------- | |
// function F<T> (f: ???): Promise<T> { | |
// return new Promise(f) | |
// } | |
// ----------- | |
// Challenge 1 |
memuse measures unique physical total memory taken by a process and its children, ignoring duplicate copy-on-write pages and shared memory.
This is a solution for http://serverfault.com/questions/676335/how-measure-memory-without-copy-on-write-pages
It's a quick and dirty utility, but feel free to fork & improve.
Example:
~ » sudo ./memuse.py 15897 eugene@eugene-thinkpad
PID Commandline Frames (+unique) VMEM
diff --git a/apps/cloud/serializers.py b/apps/cloud/serializers.py | |
index 15e6dd28a..433de2006 100644 | |
--- a/apps/cloud/serializers.py | |
+++ b/apps/cloud/serializers.py | |
@@ -19,7 +19,7 @@ class CloudConnectionSerializer(ModelSerializer): | |
class ClickGallerySerializer(Serializer): | |
- id = fields.IntegerField() | |
+ id = fields.IntegerField(read_only=True) |
diff --git a/apps/cloud/serializers.py b/apps/cloud/serializers.py | |
index 15e6dd28a..433de2006 100644 | |
--- a/apps/cloud/serializers.py | |
+++ b/apps/cloud/serializers.py | |
@@ -19,7 +19,7 @@ class CloudConnectionSerializer(ModelSerializer): | |
class ClickGallerySerializer(Serializer): | |
- id = fields.IntegerField() | |
+ id = fields.IntegerField(read_only=True) |