Skip to content

Instantly share code, notes, and snippets.

@azmeuk
azmeuk / populate_gtg.py
Created June 14, 2023 10:58
Populate Getting Things Gnome
import faker
import uuid
import random
fake = faker.Faker()
DATASET = "random"
NB_TAGS = 0
NB_TASKS = 206
@azmeuk
azmeuk / rspamd-whitelisting.md
Created February 3, 2023 10:57 — forked from ThomasLeister/rspamd-whitelisting.md
How to whitelist IP addresses or domains in Rspamd

Whitelist IP addresses based on pre-filter policy

/etc/rspamd/local.d/multimap.conf:

  IP_WHITELIST {
      type = "ip";
      prefilter = true;
      map = "/${LOCAL_CONFDIR}/local.d/ip_whitelist.map";
 action = "accept";
@azmeuk
azmeuk / aioxmpp.log
Created January 2, 2017 16:39
Firebase Cloud Messaging and aioxmpp
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 January 2, 2017 15:54
Firebase Cloud Messaging and aioxmpp
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 September 1, 2016 08:50
Firebase Cloud Messaging aioxmpp output
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 September 1, 2016 08:48
Firebase Cloud Messaging aioxmpp script
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
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
#
# 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 August 29, 2015 14:07
General output parser
#!/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 September 30, 2014 13:08
Python wait and print
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time, sys
if __name__ == "__main__":
for i in range(0,4):
print i
time.sleep(1)