Skip to content

Instantly share code, notes, and snippets.

Avatar

Dorian Harmans woohooyeah

View GitHub Profile
View setup-mongodb-amsterdamdata.sh
#!/bin/bash
mkdir -p Amsterdam
cd Amsterdam
rm -f {Activiteiten,EtenDrinken,Evenementen,Festivals,MuseaGalleries,Shoppen,Tentoonstellingen,Theater,UitInAmsterdam}.json
wget http://open.data.amsterdam.nl/Activiteiten.json
wget http://open.data.amsterdam.nl/EtenDrinken.json
wget http://open.data.amsterdam.nl/Evenementen.json
wget http://open.data.amsterdam.nl/Festivals.json
wget http://open.data.amsterdam.nl/MuseaGalleries.json
wget http://open.data.amsterdam.nl/Shoppen.json
@woohooyeah
woohooyeah / openvpn-002-libressl_fix.patch
Last active Mar 24, 2018
a patch for OpenVPN 2.4.5 to prevent errors when compiling with LibreSSL 2.7.0/2.7.1
View openvpn-002-libressl_fix.patch
--- src/openvpn/openssl_compat.h 2018-03-23 21:15:33.469068148 +0100
+++ src/openvpn/openssl_compat.h 2018-03-23 21:21:55.194909901 +0100
@@ -661,7 +661,7 @@
#define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT RSA_F_RSA_EAY_PRIVATE_ENCRYPT
#endif
-#if !HAVE_DECL_SSL_CTX_GET_MIN_PROTO_VERSION
+#if 0
/** Return the min SSL protocol version currently enabled in the context.
* If no valid version >= TLS1.0 is found, return 0. */
@woohooyeah
woohooyeah / openvpn-001-libressl_fix.patch
Last active Mar 24, 2018
a patch for OpenVPN 2.4.5 to prevent errors when compiling with LibreSSL 2.6.4
View openvpn-001-libressl_fix.patch
diff --git a/configure.ac b/configure.ac
index 88d1e09..7db5c79 100644
--- a/configure.ac
+++ b/configure.ac
@@ -935,6 +935,18 @@ if test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "openssl"; then
EC_GROUP_order_bits
]
)
+ AC_CHECK_DECL(
+ [
View dorian-antispam.crontab
*/10 * * * * ( /root/make-spammers-list.sh >/dev/null 2>&1 ) && /root/insert-spammers-into-iptables.sh
*/10 * * * * ( /root/make-spammers-list-ipv6.sh >/dev/null 2>&1 ) && /root/insert-spammers-into-ip6tables.sh
View copy-letsencrypt-cert-to-inspircd.sh
## Script to copy LetsEncrypt certificates to InspIRCd
## Run this after certbot renew !
## Dorian Harmans <contact@dorianharmans.nl>
## ---------------------------------------------------
#!/bin/bash
LETSENCRYPTDIR="/etc/letsencrypt/live"
IRCSERVERNAME="irc.domain.tld"
View copy-letsencrypt-cert-to-znc.sh
## Script to copy LetsEncrypt certificates to ZNC
## Run this after certbot renew !
## Dorian Harmans <contact@dorianharmans.nl>
## ---------------------------------------------------
#!/bin/bash
LETSENCRYPTDIR="/etc/letsencrypt/live"
ZNCSERVERNAME="znc.domain.tld"
View insert-spammers-into-ip6tables.sh
## insert-spammers-into-ip6tables.sh v0.1
## Dorian Harmans <contact@dorianharmans.nl>
##
#!/bin/bash
if [ -e /root/spammers-ipv6.txt ]; then
/sbin/ip6tables-save > /root/ip6tables.rules && cp /root/ip6tables.rules /root/ip6tables.rules-old
else
echo -e "Failed!\nReason: /root/spammers.txt not found"
View insert-spammers-into-iptables.sh
## insert-spammers-into-iptables.sh v0.1
## Dorian Harmans <contact@dorianharmans.nl>
##
#!/bin/bash
if [ -e /root/spammers.txt ]; then
/sbin/iptables-save > /root/iptables.rules && cp /root/iptables.rules /root/iptables.rules-old
else
echo -e "Failed!\nReason: /root/spammers.txt not found"
View make-spammers-list-ipv6.sh
## make-spammers-list-ipv6.sh v0.1
## Dorian Harmans <contact@dorianharmans.nl>
##
#!/bin/bash
if [ -e /var/log/mail.log ]; then
( cat /var/log/mail.log | grep "helo=1 auth=0/1 quit=1 commands=2/3" | egrep -o '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))' | sort | uniq ) > /root/spammers-new-ipv6.txt
else
echo -e "Failed!\nReason: /var/log/mail.log not found"
View make-spammers-list.sh
## make-spammers-list.sh v0.1
## Dorian Harmans <contact@dorianharmans.nl>
##
#!/bin/bash
if [ -e /var/log/mail.log ]; then
( cat /var/log/mail.log | grep "helo=1 auth=0/1 quit=1 commands=2/3" | \
egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | sort | uniq ) \
> /root/spammers-new.txt
You can’t perform that action at this time.