Skip to content

Instantly share code, notes, and snippets.

@robotadam
robotadam / gunicorn_config.py
Created December 5, 2022 18:13
Gunicorn saturation monitoring
"""gunicorn configuration file to export server metrics
To launch add `-c webapp/gunicorn_config.py` to the gunicorn command line.
Requires statsd to be configured for gunicorn as well, e.g.
`ENV STATSD_HOST=statsd-exporter:9125`
"""
# Python imports
import ctypes

Keybase proof

I hereby claim:

  • I am robotadam on github.
  • I am robotadam (https://keybase.io/robotadam) on keybase.
  • I have a public key ASDrAhEQO2IPP5h3mp7Y7SD1mKNbFlh28faMj41T0dvKOAo

To claim this, I am signing this object:

{
"ios": {
"aps": {"alert": "what"},
"foo": "bar"
},
"tags": ["asdf"]
}
Version 2 proposal
==================
Structure of version 2 mmstat's mmaps:
+-------------------+-----------+
| version number | fields... |
+===================+===========+
| ``byte`` = ``02`` | ... |
+-------------------+-----------+
diff --git a/docs/dev/format.rst b/docs/dev/format.rst
index 0c46984..25d663f 100644
--- a/docs/dev/format.rst
+++ b/docs/dev/format.rst
@@ -49,3 +49,72 @@ Unbuffered
+------------+------------+------------+------------+-------------------+---------+
The value field length = sizeof(type).
+
+Version 2 proposal
@robotadam
robotadam / custom-android.json
Created August 9, 2011 19:20
Sending custom push data
{
"android": {
"alert": "hi android",
"extra" : {
"a_key" : "a value",
"another_key" : "another value"
}
}
}
@robotadam
robotadam / gist:1112830
Created July 28, 2011 23:39
iOS push notification without an alert
{
"aps": {
"badge": "+1",
"sound": "cat.caf"
},
"device_tokens": ["734C3AE803B8A9E2E2AD...7BF300CE"]
}
import os
import socket
import sys
import threading
import traceback
class SocketDumper(threading.Thread):
daemon = True