Skip to content

Instantly share code, notes, and snippets.

View alexalouit's full-sized avatar

Alexandre Alouit alexalouit

View GitHub Profile
@alexalouit
alexalouit / readme
Created July 1, 2021 11:54
update docker plugin env
docker stop $container
docker plugin disable -f $pluginid
docker plugin set $pluginid ENV=value
docker plugin enable $pluginid
docker start $container
@alexalouit
alexalouit / README
Created May 25, 2021 07:45
windows xp see all drivers
Press [Windows]+[Break] to bring up the System Properties dialog box.
Select the Advanced tab and click the Environment Variables button.
Click the New button below the System Variables panel.
In the New System Variable dialog box, type devmgr_show_nonpresent_devices in the Variable Name text box and 1 in the Variable Value text box.
Click OK to return to the System Properties dialog box and then click OK again.
Select the Hardware tab and click the Device Manager button.
In Device Manager, go to View | Show Hidden Devices.
Expand the various branches in the device tree and look for the washed out icons, which indicate unused device drivers.
To remove an unused device driver, right-click the icon and select Uninstall.
@alexalouit
alexalouit / readme
Created April 23, 2021 12:43
mailparse 3.0.3 segfault
# 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 / fail2ban.conf
Created August 10, 2015 13:30
fail2ban logstash config & grok pattern
input {
file {
path => "/var/log/fail2ban.log"
type => "fail2ban"
}
}
filter {
if [type] == "fail2ban" {
grok {
@alexalouit
alexalouit / fix.sh
Last active February 12, 2021 15:52
fix Logstash error "logstash load error: ffi/ffi -- java.lang.NullPointerException: null" on Raspbian
#!/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"
@alexalouit
alexalouit / ModelUuid.php
Created November 13, 2019 06:36
Laravel/Lumen use uuid as id
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class ModelUuid extends Model
{
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 November 11, 2020 15:05
alpine linux hostapd noscan compilation
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);
@alexalouit
alexalouit / gist:8aef6fcf599db47aa89eac59554354c5
Created October 21, 2020 08:55
redirect port (exemple tcp local 80 to 8080)
$ socat TCP-LISTEN:80,fork TCP:127.0.0.1:8080"
# crontab:
# 0 * * * * flock -n /var/run/tcp.80.8080.lock -c "socat TCP-LISTEN:80,fork TCP:127.0.0.1:8080"
@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`