Skip to content

Instantly share code, notes, and snippets.

View alexalouit's full-sized avatar

Alexandre Alouit alexalouit

View GitHub Profile
@alexalouit
alexalouit / mod_muc.lua
Created December 5, 2016 23:35
Metronome XMPP XEP-0045 (mod_muc): allow anonymous to create chat room
diff -ruN mod_muc.lua.orig mod_muc.lua
--- mod_muc.lua.orig 2016-12-06 00:33:20.276048023 +0100
+++ mod_muc.lua 2016-12-05 23:33:31.013246048 +0100
@@ -201,7 +201,8 @@
return true;
end
local from_host = jid_section(stanza.attr.from, "host");
- if not origin.is_anonymous and
+-- if not origin.is_anonymous and
+ if
@alexalouit
alexalouit / metronome-letsencrypt.sh
Last active December 28, 2016 15:26
Metronome XMPP sync Let's Encrypt files
#!/bin/bash
#
# add to section `[renewalparams]` of the file /etc/letsencrypt/renewal/$DOMAIN.conf
#post-hook = /root/scripts/metronome-letsencrypt.sh
cp -f /etc/letsencrypt/live/$DOMAIN/fullchain.pem /etc/metronome/certs/localhost.cert
chown metronome:root /etc/metronome/certs/localhost.cert
cp -f /etc/letsencrypt/live/$DOMAIN/privkey.pem /etc/metronome/certs/localhost.key
chown metronome:root /etc/metronome/certs/localhost.key
/usr/bin/metronomectl reload
@alexalouit
alexalouit / metronome.jail
Last active December 28, 2016 19:23
Fail2ban: Metronome auth
[metronome]
enabled = true
port = 5290,5291,5292,5280
filter = metronome-auth
logpath = /var/log/metronome/metronome.log
@alexalouit
alexalouit / terratec-cinergy-t2.conf
Created March 29, 2017 20:15
LIRC Terratec Cinergy t2
#
# this config file was generated
# using lirc-0.7.1pre2(serial) kantonix VDR
#
# contributed by Stefan Bernshausen
#
# brand: Terratec
# model no. of remote control: Cinergy T2
# devices being controlled by this remote:
#
@alexalouit
alexalouit / HOWTO_handle_composed_and_decomposed_dir_and_file_in_OSX_with_Samba.txt
Last active April 18, 2017 14:16
Handle composed and decomposed directory/file in OSX with Samba
apt-get install samba-vfs-modules
# more info at https://www.mankier.com/8/vfs_fruit
# add to share point:
ea support = yes
vfs objects = catia fruit streams_xattr
fruit:resource = file
fruit:metadata = netatalk
fruit:locking = netatalk
@alexalouit
alexalouit / readme.txt
Created April 18, 2017 21:03
Unicode decompose/compose
$ apt-get install convmv
# more at https://linux.die.net/man/1/convmv
# compose (can be use as --nfd to decompose):
convmv -r -f utf-8 -t utf-8 --nfc --preserve-mtimes --nosmart --notest .
@alexalouit
alexalouit / kibana.conf
Created May 30, 2017 11:33
kibana apache reverse proxy and auth
# /etc/apache2/sites-available/kibana.conf
# create
<VirtualHost *:5601>
<Proxy *>
AuthUserFile /etc/kibana/kibana.htpasswd
AuthType basic
AuthName "Kibana"
require valid-user
</Proxy>
@alexalouit
alexalouit / jail.local
Created June 5, 2017 20:48
Fail2ban phpmyadmin (< 4.7)
[phpmyadmin]
enabled = true
port = 443
filter = phpmyadmin
logpath = /var/log/auth.log
bantime = 3600
findtime = 60
maxretry = 7
@alexalouit
alexalouit / http-ddos.conf
Created June 30, 2017 14:51
Fail2ban: http ddos (apache/nginx/varnish)
# Fail2Ban filter to catch all http request
#
# Author: Alex Alouit <alexandre.alouit@gmail.com>
[Definition]
failregex = ^<HOST> -.*"(GET|HEAD|POST|PUT|DELETE|TRACE|CONNECT).*
ignoreregex =
@alexalouit
alexalouit / mail-purge.sh
Last active August 28, 2017 08:35
Automatic purge of spam emails and trash that are aged 14 days over
#!/bin/bash
#
# cron ex: 1 0 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/mail-purge.sh >> /root/scripts/cron.log
# Search messages more than 14 days in the appropriate directories and removes
find /var/vmail/ -regex '.*/\.\(Trash\|Junk\|Deleted\ Messages\)\(/.*\)?\/\(cur\|new\)/.*' -type f -ctime +14 -delete
# Dovecot is restarted to refresh quota (to update the .quotausage file)
/etc/init.d/dovecot restart
# since version ~2.2 (need userdb iterate):