Skip to content

Instantly share code, notes, and snippets.

View alexalouit's full-sized avatar

Alexandre Alouit alexalouit

View GitHub Profile
@alexalouit
alexalouit / ISPConfig.filter
Last active February 5, 2016 15:06
Fail2ban: ISPConfig auth
[Definition]
failregex = Failed login for user .* from <HOST>
ignoreregex =
@alexalouit
alexalouit / survey-semaphore-getmail.sh
Last active February 19, 2018 10:21
Getmail survey lock file (semaphore)
#!/bin/bash
#
# cron ex: */30 * * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/survey-semaphore-getmail.sh >> /root/scripts/cron.log
email=""
# file exist and have invalid ttl?
if [ -f /tmp/.getmail_lock ]
then
# have a correct ttl?
@alexalouit
alexalouit / wrt54gsv4-watchguard.sh
Created April 9, 2016 12:48
Connection status on ddwrt wrt54gsv4 led
#!/bin/sh
# led is white if we have internet, turn orange if not.
while true ; do
if /bin/ping -qc 3 8.8.8.8 > /dev/null; then
/sbin/gpio disable 2
/sbin/gpio enable 3
else
/sbin/gpio disable 2
/sbin/gpio disable 3
fi
@alexalouit
alexalouit / _up.sh
Created April 22, 2016 10:26
Connection status checker with iptables-conditions for dynamic routing, load balancing and failover
#!/bin/sh
#
# cron ex: @reboot /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/100_up.sh >> /root/scripts/cron.log
while true ; do
# do ping with interface
if /bin/ping -qc 3 8.8.8.8 -I eth0.100 > /dev/null; then
if /bin/grep -q 0 /proc/net/nf_condition/100_up; then /bin/echo 1 > /proc/net/nf_condition/100_up; fi
else
# do ping with fwmark, and to another target
if /bin/ping -qc 3 8.8.4.4 -m 100 > /dev/null; then
@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 / 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 / README.md
Last active December 4, 2016 23:47
Metronome XMPP isolation by vhost/domain

Adaptation of Prosody module from Exa Networks for Metronome

Configuration

To isolate all hosts by default, add the module to your global modules_enabled:

modules_enabled = {
@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 / 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