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
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);
@alexalouit
alexalouit / gist:8aef6fcf599db47aa89eac59554354c5
Created Oct 21, 2020
redirect port (exemple tcp local 80 to 8080)
View gist:8aef6fcf599db47aa89eac59554354c5
$ 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 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
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 / .com.apple.TimeMachine.quota.plist
Created Apr 15, 2020
limit time machine quota usage (250GB exemple) (10.9+ required)
View .com.apple.TimeMachine.quota.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GlobalQuota</key>
<integer>250000000000</integer>
</dict>
View readme.txt
@see https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/resource_management_guide/sec-modifying_control_groups
2.3. MODIFYING CONTROL GROUPS
Each persistent unit supervised by systemd has a unit configuration file in the /usr/lib/systemd/system/ directory. To change parameters of a service unit, modify this configuration file. This can be done either manually or from the command-line interface by using the systemctl set-property command.
2.3.1. Setting Parameters from the Command-Line Interface
The systemctl set-property command allows you to persistently change resource control settings during the application runtime. To do so, use the following syntax as root:
~]# systemctl set-property name parameter=value
Replace name with the name of the systemd unit you wish to modify, parameter with a name of the parameter to be changed, and value with a new value you want to assign to this parameter.
Not all unit parameters can be changed at runtime, but most of those related to resource co
@alexalouit
alexalouit / README.md
Created Apr 12, 2020
BackupPC + nginx
View README.md

$ pecl install SCGI

$ nano /etc/nginx/sites-available/default

location /backuppc {
 alias /usr/share/backuppc;
}

location /BackupPC_Admin {
 include /etc/nginx/scgi_params;
@alexalouit
alexalouit / README.md
Last active Apr 12, 2020
Marvell 88E8053 - sky2 driver
View README.md

symptoms under loads:

[84579.236440] sky2 0000:01:00.0: error interrupt status=0x40000008
[84579.268416] sky2 0000:01:00.0 enp1s0: rx error, status 0x7ffc0001 length 132

$ iptables -A FORWARD -o enp1s0 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1492

$ nano /etc/network/interfaces