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 August 23, 2022 12:01
Apple M1 + macOS 10.11: Xdebug for PHP
$ cd /usr/local/etc/php
$ git clone https://github.com/xdebug/xdebug.git
$ cd xdebug
$ arch -x86_64 phpize
$ arch -x86_64 ./configure --enable-xdebug
$ arch -x86_64 sudo make
$ arch -x86_64 sudo make install
$ echo 'zend_extension = "/usr/local/lib/php/pecl/20210902/xdebug.so"' >> /usr/local/etc/php/8.1/php.ini
@alexalouit
alexalouit / client.py
Created May 23, 2022 18:25
zut.io python simple client
#!/usr/bin/env python
import requests
endpoint = 'https://zut.io/api'
username = 'JohnDoe'
password = 'YWNlZGVjZDAwNjdiNjRkNjkyYWNkZTVmYjA4MGE3OTY'
payload = { 'url': 'http://www.yahoo.co.uk/' }
response = requests.post(endpoint, json=payload, auth=(username, password))
$ 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 / readme.txt
Created April 22, 2022 20:45
MacOS: move postgresql/timescaledb data directory
# move from /usr/local/var/postgres to ..
$ nano /usr/local/opt/postgres/homebrew.postgresql.service /usr/local/opt/postgres/homebrew.mxcl.postgresql.plist
@alexalouit
alexalouit / openwrt.squid.transparent
Last active April 11, 2022 21:25
OpenWRT Squid transparent configuration
Squid required:
Mount HD (15GB min) on /tmp/cache, chmod -R 777 /tmp/cache
Firewall section:
config redirect
option src 'lan'
option proto 'tcp'
option src_ip '!192.168.1.1'
option src_dport '80'
option dest_ip '192.168.1.1'
@alexalouit
alexalouit / readme.txt
Last active March 21, 2022 13:41
macos: docker as cli (not desktop)
$ brew install docker docker-compose kubectl kubectx
$ brew install colima
$ colima start --cpu 1 --memory 2 --disk 10
# colima stop
# colima start --cpu 4 --memory 8
@alexalouit
alexalouit / readme.txt
Created February 19, 2022 11:44
Mac OS X NFSd server
$ nfsd checkexports
sandbox_check failed. nfsd has no read access to "/dir"
# open System Preferences > Security & Privacy > Full Disk Access
# add /sbin/nfsd
@alexalouit
alexalouit / goofys.txt
Last active December 8, 2021 00:46
scaleway s3
# 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 / dnsmasq.conf
Last active August 11, 2021 21:04
Netflix + IPv6 HE tunnel + Chromecast
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 / 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