Skip to content

Instantly share code, notes, and snippets.

View alexalouit's full-sized avatar

Alexandre Alouit alexalouit

View GitHub Profile
@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 / README
Created September 2, 2017 12:31
freebox nas default uid/gid
Freebox use 4242 as default uid and gid.
@alexalouit
alexalouit / README
Last active June 12, 2020 14:36
compile atheros noregulatory
$ apt-get install linux-headers-`uname -r`
$ apt-get install linux-source
$ mkdir -p ~/build/ath; cd ~/build/ath
$ tar -xvf /usr/src/linux-source-`uname -r`.tar.xz
# patch linux-source-`uname -r`/drivers/net/wireless/ath/regd.c
$ cp /boot/config-`uname -r` ~/build/ath/.config
$ cp /usr/src/linux-headers-`uname -r`/Module.symvers ~/build/ath/linux-source-`uname -r`/
$ cd linux-source-`uname -r`
#!/usr/bin/python
import fileinput
import json
if __name__ == "__main__":
jsonStr = ''
for a_line in fileinput.input():
jsonStr = jsonStr + ' ' + a_line.strip()
jsonObj = json.loads(jsonStr)
print json.dumps(jsonObj, sort_keys=True, indent=2)
@alexalouit
alexalouit / adblock.sh
Created November 7, 2017 10:28
Dnsmasq based ads blacklist (use @StevenBlack/hosts)
#!/bin/bash
# cron ex: @daily /root/scripts/adblock.sh >> /dev/null
# be sure dnsmasq load /etc/dnsmasq.d/*.conf
wget -O- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | awk '$1 == "0.0.0.0" { print "address=/"$2"/0.0.0.0/"}' > /etc/dnsmasq.d/ad_hosts.conf
#/etc/init.d/dnsmasq restart
systemctl restart dnsmasq.service
@alexalouit
alexalouit / Chromecast.xml.patch
Last active February 16, 2018 00:34
Fix direct play on Chromecast with Plex
--- /root/Chromecast.xml.orig 2018-02-15 17:52:59.952340896 +0100
+++ /usr/lib/plexmediaserver/Resources/Profiles/Chromecast.xml 2018-02-15 18:01:48.763665177 +0100
@@ -7,6 +7,14 @@
<PhotoProfile container="jpeg" />
<SubtitleProfile container="ass" codec="ass" />
</TranscodeTargets>
+ <DirectPlayProfiles>
+ <VideoProfile container="mp4,mkv" codec="h264" audioCodec="aac,mp3,ac3,pcm,flac,alac" />
+ <MusicProfile container="mp4" codec="aac,alac" />
+ <MusicProfile container="mp3" codec="mp3" />
@alexalouit
alexalouit / cron-errors.sh
Created April 17, 2018 06:38
ISPConfig crons regular email report
#!/bin/bash
#
# cron ex: 1 0 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/cron-errors.sh >> /root/scripts/cron.log
email=""
dir="/tmp/"
file="/var/www/clients/client*/web*/private/cron*.log"
cd $dir