Skip to content

Instantly share code, notes, and snippets.

View alexalouit's full-sized avatar

Alexandre Alouit alexalouit

View GitHub Profile
@alexalouit
alexalouit / collectd-fail2ban
Created September 9, 2014 13:58
Collectd: Fail2ban
LoadPlugin tail
<Plugin "tail">
<File "/var/log/fail2ban.log">
Instance "fail2ban"
<Match>
Regex "Ban"
DSType "CounterInc"
Type "counter"
Instance "fail2ban-ban"
</Match>
@alexalouit
alexalouit / gist:62019c74c0ff13460c1d876cfbbd362b
Last active December 30, 2023 12:59
UTM + Windows: WebDAV sharing size limit error
$ regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\FileSizeLimitInBytes
0xFFFFFFFF (4294967295)
@alexalouit
alexalouit / readme.txt
Created December 27, 2023 10:16
Windows: flush virtual memory at shutdown
$ regedit
HKey_Local_Machine/System/Current Control Set/Control/Session Manager/Memory Management/ClearPageFile
value to 1
@alexalouit
alexalouit / readme.txt
Created April 4, 2022 10:23
macOS: reduce ram usage
- disable SIP
# boot in recovery mode (Command + R)
# open utilities / terminal
$ csrutil disable
- disable Spotlight indexing
$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
- change swapper default mode
vm_pageout.h:
@alexalouit
alexalouit / install.txt
Created December 13, 2023 15:48
yubikey digital signature
$ brew install yubico-piv-tool
Go to yubico manager, generate a PIV Digital Signature certificates
- RSA2048
- Self-signed certificate
- Expiration to 2029-12-31
- Management key (default)
- PIN (default 123456)
Generate a certificate
@alexalouit
alexalouit / itebooks.py
Created October 24, 2023 08:27 — forked from lyubenov/itebooks.py
Removes it-ebooks.info links from book's footers. Run python itebooks.py -f /sourcepath/books/thebook.pdf to cleanup your thebook.pdf file.
#!/usr/bin/env python3
import sys
import re
import shutil
import argparse
import binascii
pattern = b'''0a2f54797065202f416e6e6f740a2f53756274797065202f4c696e6b0a2f52656
374205b20.*?205d0a2f426f7264657220.*?\n0a2f41203c3c0a2f54797065202f416374696f6e
@alexalouit
alexalouit / pbs.txt
Created August 16, 2023 09:52
QEMU + macOS
$ brew install qemu
$ qemu-img create -f qcow2 pbs-os.qcow2 15G
$ qemu-img create -f qcow2 pbs-data.qcow2 2000G
# installation
# 2GB RAM
# -cdrom /Users/user/Downloads/proxmox-backup-server_3.0-1.iso
@alexalouit
alexalouit / readme.txt
Last active April 7, 2023 22:07
OpenWRT as reliable and secure SFTP server
$ opkg update
$ opkg install openssh-server openssh-sftp-server
# disable built-in dropbear
$ /etc/init.d/dropbear disable
$ /etc/init.d/dropbear stop
# enable full openssh server
$ /etc/init.d/sshd enable
$ /etc/init.d/sshd start
@alexalouit
alexalouit / lessfs-debian.txt
Last active November 1, 2022 06:18
LessFS Debian
$ mkdir ~/build; cd ~/build
$ wget https://datapacket.dl.sourceforge.net/project/lessfs/lessfs/lessfs-1.7.0/lessfs-1.7.0.tar.gz
$ tar xzvf ./lessfs-1.7.0.tar.gz
$ cd lessfs-1.7.0/
$ apt-get install libmhash-dev libfuse-dev libtokyocabinet-dev
$ ./configure
$ make
$ make install
$ cp etc/lessfs.cfg /etc/
# adjust datastore in /etc/lessfs.cfg (/data by default)
@alexalouit
alexalouit / README
Last active September 19, 2022 07:17
run alpine linux as ramdisk/iso/usb with zfs modules (modloop)
$ 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