Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandre Alouit alexalouit

View GitHub Profile
@alexalouit
alexalouit / readme
Created Apr 23, 2021
mailparse 3.0.3 segfault
View readme
# install lastest version
$ pecl install mailparse
# compilation failed and return mbstring needed anyway
$ nano /usr/include/php/*/ext/mbstring/libmbfl/mbfl/mbfilter.h
# add to header:
#undef HAVE_MBSTRING
#define HAVE_MBSTRING 1
@alexalouit
alexalouit / dnsmasq.conf
Last active Mar 9, 2021
Netflix + IPv6 HE tunnel + Chromecast
View dnsmasq.conf
server=/netflix.com/#
address=/netflix.com/::
server=/netflix.net/#
address=/netflix.net/::
server=/nflxext.com/#
address=/nflxext.com/::
server=/nflximg.net/#
address=/nflximg.net/::
server=/nflxvideo.net/#
address=/nflxvideo.net/::
@alexalouit
alexalouit / fail2ban.conf
Created Aug 10, 2015
fail2ban logstash config & grok pattern
View fail2ban.conf
input {
file {
path => "/var/log/fail2ban.log"
type => "fail2ban"
}
}
filter {
if [type] == "fail2ban" {
grok {
View gist:aec7b74341d00d75236f42fadb3f6b26
$ opkg update
$ opkg install stubby
$ /etc/init.d/stubby enable
$ nano /etc/config/dhcp
# add to dnsmasq section:
option noresolv '1'
list server '127.0.0.1#5453'
$ /etc/init.d/stubby start
@alexalouit
alexalouit / fix.sh
Last active Feb 12, 2021
fix Logstash error "logstash load error: ffi/ffi -- java.lang.NullPointerException: null" on Raspbian
View fix.sh
#!/bin/bash
# based on https://github.com/mew2057/CAST/blob/6c7f7d514b7af3c512635ec145aa829c535467dc/csm_big_data/config-scripts/logstashFixupScript.sh
# see: https://github.com/elastic/logstash/issues/10755
apt-get update
apt-get install -f zip unzip
STARTDIR=$(pwd)
JARDIR="/usr/share/logstash/logstash-core/lib/jars"
View goofys.txt
# be careful, goofys does not support fsync, software performing check will return an error
$ wget https://github.com/kahing/goofys/releases/latest/download/goofys
$ chmod +x goofys
$ mv goofys /usr/bin/goofys
$ mkdir /root/.aws
$ echo -e "[default]\naws_access_key_id = $accesskey\naws_secret_access_key = $secretkey" > /root/.aws/credentials
$ echo 'goofys#bucket /mnt/bucket-name fuse _netdev,allow_other,--endpoint=https://s3.fr-par.scw.cloud/,--file-mode=0755,--dir-mode=0755,--uid=65534,--gid=65534 0 0' >> /etc/fstab
@alexalouit
alexalouit / README
Last active Dec 14, 2020
run alpine linux as ramdisk/iso/usb with zfs modules (modloop)
View README
$ mkdir /tmp/a
$ cd /tmp/a
$ unsquashfs /media/sd**/boot/modloop-lts
$ mv squashfs-root/ lib
$ tar -xzvf /etc/apk/cache/zfs-lts-*.apk
$ depmod -b /tmp/a
$ mksquashfs lib/ modloop-lts -noappend -always-use-fragments
$ mount -o rw,remount /media/sd**
# do backup but not as /filename or /boot/filename, alpine will be use it)
$ mv /tmp/a/modloop-lts /media/sd**/boot/modloop-lts
@alexalouit
alexalouit / ModelUuid.php
Created Nov 13, 2019
Laravel/Lumen use uuid as id
View ModelUuid.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class ModelUuid extends Model
{
View 0099-atheros.patch
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index e25bfdf..ac42657 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -268,6 +268,8 @@ static void ath_force_clear_no_ir_chan(struct wiphy *wiphy,
{
const struct ieee80211_reg_rule *reg_rule;
+ return;
+
@alexalouit
alexalouit / 0099-noscan.patch
Last active Nov 11, 2020
alpine linux hostapd noscan compilation
View 0099-noscan.patch
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index e09e6e1..6251048 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3411,6 +3411,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->ieee80211w = 1;
#endif /* CONFIG_OCV */
#ifdef CONFIG_IEEE80211N
+ } else if (os_strcmp(buf, "noscan") == 0) {
+ conf->noscan = atoi(pos);