Skip to content

Instantly share code, notes, and snippets.

View cpina's full-sized avatar

Carles Pina Estany cpina

View GitHub Profile
# Errors for [email protected]
2024-01-16 03:20:15 (13) from: [email protected]
2024-01-16 02:10:46 (02) from: [email protected]
2024-01-15 08:41:28 (01) from: [email protected]
2024-01-15 09:07:29 (01) from: [email protected]
2024-01-15 23:09:03 (01) from: [email protected]
2024-01-16 02:44:39 (01) from: [email protected]
Number of different errors for [email protected] 6
# Errors for [email protected]
@cpina
cpina / check-rejected-mail-all.sh
Created January 17, 2024 23:19
Report rejected emails: for all users
#!/bin/bash
for recipient in email1€xample.com [email protected] [email protected]
do
~/git/personal-server/bin/check-rejected-mail.py "$recipient" ~/mail-logs/mail.log ~/mail-logs/mail.log.1 --hours 24
echo
done
@cpina
cpina / gist:ff5feff11803b5e74cc073386fadecd9
Created October 24, 2023 21:41
ping3 fix two unit tests
diff --git a/tests/test_command_line.py b/tests/test_command_line.py
index 6d056f3..152db76 100644
--- a/tests/test_command_line.py
+++ b/tests/test_command_line.py
@@ -24,7 +24,7 @@ class test_ping3(unittest.TestCase):
def test_dest_addr_0(self):
with patch("sys.stdout", new=io.StringIO()) as fake_out:
- command_line.main()
+ command_line.main([])
@cpina
cpina / streaming_example.py
Last active December 15, 2022 10:14
Django single-file example for https://github.com/django/daphne/issues/170 (generates async data, streams over HTTP)
"""
To test this save this file in streaming_example.py and then:
python3 -m venv venv
. venv/bin/activate
pip3 install -e git+https://github.com/carltongibson/django.git@ea94a8ff95093d2c6925e41ac6b98a00c220d89f#egg=Django
pip3 install daphne==4.0.0
python3 streaming_example.py runserver
curl --no-buffer http://localhost:8000 # Expect memory usage to increase,
# depending on asyncio.sleep() time
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFR6/hUBCADBy0fYnM4tzRLEHR1yVoj7fMhKlcMAEL4GeBXKxgaCbg/oBP39
4fAv8nIziOKN2P9Ilknz8oKMZcyPom1Rw+VJ79k7QPh2TXdcPmpoVTxYKQ3KoE9M
tETscB8LxW1uD044bcaGRznsk/1WlL6yAi4SHXC+b8cl6uDB7rO66KAFt3I1beAy
gaY1Oq0eNIvEzQ3sqrgFPznUQ+3sGDRO91N1dMkCPwrUCWzRoLy14hGyVYuYL0Ch
xn1meFLHlq0wTnKYSlzZVWd1NmtzypYOt0uffXGRR9CiiCUlE5Xmg/j+/hw7qCZb
G2GOmopX9lc9a4QmH0uCeXdOPlPIcG1xgRDtABEBAAG0JkNhcmxlcyBQaW5hIGkg
RXN0YW55IDxjYXJsZXNAcGluYS5jYXQ+iQE+BBMBAgAoBQJUev4VAhsDBQkNKGiA
### Keybase proof
I hereby claim:
* I am cpina on github.
* I am carles_pina (https://keybase.io/carles_pina) on keybase.
* I have a public key whose fingerprint is F357 D4C2 FFD1 F6D3 44DA 2E3D 3E90 377E 3093 4E72
To claim this, I am signing this object: