Skip to content

Instantly share code, notes, and snippets.

Avatar

Éloi Rivard azmeuk

View GitHub Profile
@azmeuk
azmeuk / aioxmpp.log
Created Jan 2, 2017
Firebase Cloud Messaging and aioxmpp
View aioxmpp.log
2017-01-02 17:37:46,605 selector_events:53 DEBUG Using selector: EpollSelector
2017-01-02 17:37:46,606 callbacks:478 DEBUG connecting <bound method PresenceManagedClient._handle_stream_established of <aioxmpp.node.PresenceManagedClient object at 0x7f34ea043d30>> with mode <bound method AdHocSignal.STRONG of <class 'aioxmpp.callbacks.AdHocSignal'>>
2017-01-02 17:37:46,607 callbacks:478 DEBUG connecting <Future pending> with mode <bound method AdHocSignal.AUTO_FUTURE of <class 'aioxmpp.callbacks.AdHocSignal'>>
2017-01-02 17:37:46,607 callbacks:478 DEBUG connecting <Future pending> with mode <bound method AdHocSignal.AUTO_FUTURE of <class 'aioxmpp.callbacks.AdHocSignal'>>
2017-01-02 17:37:46,607 callbacks:478 DEBUG connecting <bound method AbstractClient._stream_failure of <aioxmpp.node.PresenceManagedClient object at 0x7f34ea043d30>> with mode <bound method AdHocSignal.STRONG of <class 'aioxmpp.callbacks.AdHocSignal'>>
2017-01-02 17:37:46,607 callbacks:478
@azmeuk
azmeuk / aioxmpp.log
Created Jan 2, 2017
Firebase Cloud Messaging and aioxmpp
View aioxmpp.log
2017-01-02 16:44:24,038 selector_events:53 DEBUG Using selector: EpollSelector
2017-01-02 16:44:24,040 callbacks:478 DEBUG connecting <bound method PresenceManagedClient._handle_stream_established of <aioxmpp.node.PresenceManagedClient object at 0x7f70e4ea7128>> with mode <bound method AdHocSignal.STRONG of <class 'aioxmpp.callbacks.AdHocSignal'>>
2017-01-02 16:44:24,040 callbacks:478 DEBUG connecting <Future pending> with mode <bound method AdHocSignal.AUTO_FUTURE of <class 'aioxmpp.callbacks.AdHocSignal'>>
2017-01-02 16:44:24,040 callbacks:478 DEBUG connecting <Future pending> with mode <bound method AdHocSignal.AUTO_FUTURE of <class 'aioxmpp.callbacks.AdHocSignal'>>
2017-01-02 16:44:24,041 callbacks:478 DEBUG connecting <bound method AbstractClient._stream_failure of <aioxmpp.node.PresenceManagedClient object at 0x7f70e4ea7128>> with mode <bound method AdHocSignal.STRONG of <class 'aioxmpp.callbacks.AdHocSignal'>>
2017-01-02 16:44:24,041 callbacks:478
@azmeuk
azmeuk / aioxmpp.log
Created Sep 1, 2016
Firebase Cloud Messaging aioxmpp output
View aioxmpp.log
2016-09-01 10:46:34,754 selector_events:53 DEBUG Using selector: EpollSelector
2016-09-01 10:46:34,760 callbacks:431 DEBUG connecting <bound method PresenceManagedClient._handle_stream_established of <aioxmpp.node.PresenceManagedClient object at 0x7f3b650ba518>> with mode <bound method AdHocSignal.STRONG of <class 'aioxmpp.callbacks.AdHocSignal'>>
2016-09-01 10:46:34,761 callbacks:431 DEBUG connecting <Future pending created at /home/eloi/dev/push-server/local.virtualenv/lib/python3.5/site-packages/aioxmpp/node.py:1019> with mode <bound method AdHocSignal.AUTO_FUTURE of <class 'aioxmpp.callbacks.AdHocSignal'>>
2016-09-01 10:46:34,761 callbacks:431 DEBUG connecting <Future pending created at /home/eloi/dev/push-server/local.virtualenv/lib/python3.5/site-packages/aioxmpp/node.py:1019> with mode <bound method AdHocSignal.AUTO_FUTURE of <class 'aioxmpp.callbacks.AdHocSignal'>>
2016-09-01 10:46:34,761 callbacks:431 DEBUG connecting <bound method AbstractClient._stream_f
@azmeuk
azmeuk / aioxmpp.py
Created Sep 1, 2016
Firebase Cloud Messaging aioxmpp script
View aioxmpp.py
import asyncio, datetime, uuid, json, aioxmpp.xso, aioxmpp.utils, aioxmpp.node, aioxmpp.security_layer, aioxmpp.structs, aioxmpp.stanza, colorlog
class FCMPayload(aioxmpp.xso.XSO):
TAG = ("google:mobile:data", "gcm")
text = aioxmpp.xso.Text(default=None)
async def main(jid, password, recipient):
@asyncio.coroutine
def get_password(client_jid, nattempt):
return None if nattempt > 1 else password
View aioxmpp fcm
DEBUG selector_events:53 Using selector: EpollSelector
DEBUG callbacks:431 connecting <bound method PresenceManagedClient._handle_stream_established of <aioxmpp.node.PresenceManagedClient object at 0x7f52a4c94ba8>> with mode <bound method AdHocSignal.STRONG of <class 'aioxmpp.callbacks.AdHocSignal'>>
DEBUG callbacks:431 connecting <Future pending> with mode <bound method AdHocSignal.AUTO_FUTURE of <class 'aioxmpp.callbacks.AdHocSignal'>>
DEBUG callbacks:431 connecting <Future pending> with mode <bound method AdHocSignal.AUTO_FUTURE of <class 'aioxmpp.callbacks.AdHocSignal'>>
DEBUG callbacks:431 connecting <bound method AbstractClient._stream_failure of <aioxmpp.node.PresenceManagedClient object at 0x7f52a4c94ba8>> with mode <bound method AdHocSignal.STRONG of <class 'aioxmpp.callbacks.AdHocSignal'>>
DEBUG callbacks:431 connecting <bound method AbstractClient._stream_destroyed of <aioxmpp.node.PresenceManagedClient object at 0x7f52a4c94ba8>> with mode <bound method AdHocSignal.STRONG of <cla
View .bashrc
#
# Finds the closest virtualenv root directory, starting from $1, and going up to the root.
# If the target directory is not specified as an argument, current directory is used.
# Prints the virtualenv path found, or nothing otherwise.
#
function venv_find () {
# The cycle is just for the case with broken root folder detection -- never do more than N iterations.
venv_root=${1:-"."}
venv_found=""
@azmeuk
azmeuk / parser.py
Last active Aug 29, 2015
General output parser
View parser.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing, subprocess, sys
class Parser(multiprocessing.Process):
process = None
def __init__(self, daemon, output):
super(Parser, self).__init__()
@azmeuk
azmeuk / foobar.py
Created Sep 30, 2014
Python wait and print
View foobar.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time, sys
if __name__ == "__main__":
for i in range(0,4):
print i
time.sleep(1)
@azmeuk
azmeuk / conquest-pacs.sh.patch
Last active Aug 29, 2015
conquest-pacs.sh.patch Patch
View conquest-pacs.sh.patch
--- conquest-pacs.sh 2013-10-13 22:34:39.000000000 +0200
+++ conquest-pacs.sh 2014-03-24 15:05:48.397034507 +0100
@@ -84,7 +84,7 @@
--exec $DAEMON -- $ARGS
sleep 1
start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --chuid conquest --chdir $HOME --exec $DAEMON -- $ARGS
+ --chuid $PACSUSER --chdir $HOME --exec $DAEMON -- $ARGS
echo "$NAME."
;;
@azmeuk
azmeuk / gist:8859316
Created Feb 7, 2014
Docker issue logs
View gist:8859316
$ sudo lxc-checkconfig
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: required
User namespace: missing
Network namespace: enabled
Multiple /dev/pts instances: missing