Skip to content

Instantly share code, notes, and snippets.

View unixfox's full-sized avatar

Émilien (perso) unixfox

View GitHub Profile
@unixfox
unixfox / README.md
Last active August 6, 2022 20:46
Dirty script for checking the hash of a youtube video stream in 320P
  1. install nodejs
  2. install the library got: npm install got
  3. launch the script with bash execute.sh

I replicated the issue on a Digitalocean droplet in UK location with IPv6 disabled and the DNS server set to 8.8.8.8 if one wants to have an environment to the one that I used.

@unixfox
unixfox / README.md
Last active November 11, 2022 07:41
Different ways to get json output from Google servers API
  • When async something is in the URL, add/modify async=_fmt:json.
  • You can try the query string alt=json for some APIs like the youtube one
  • You can also try the query string fmt=json
  • For some API, get the JSON result by modifying the client name used. Example:

    So, short version: curl "https://www.google.com/complete/search?client=qsb-android-asbl-pb&q=" -H "user-agent: Mozilla/5.0 AppleWebKit/537.36 GSA/10.77.9.21.x86" -output trend.proto It seems that it combines geoIP with the field &hl= in order to decide which trends to show, and perhaps also gl= It allows for three different clients in order to get json, ajax-json or protobuffer. Respectively, qsb-android, qsb-android-asbl and qsb-android-asbl-pb

@unixfox
unixfox / README.md
Last active August 24, 2022 19:05
Findings about youtube googlevideo.com IP restriction
  • you can load the same googlevideo.com URL without any redirect on the same /48 IPv6 subnet
  • as long as it's still the same ISP you can load the same googlevideo.com URL but you will get a strange redirect with content-type plain/text with the new URL to use
  • on youtube.com any change in the IP address that doesn't concern the two first points will trigger a request to the player endpoint for new video streams
@unixfox
unixfox / README.md
Created October 9, 2022 09:27
dnscrypt-proxy get sdns

dnscrypt-proxy -list-all -json -config /etc/dnscrypt-proxy/dnscrypt-proxy.toml

@unixfox
unixfox / loki-config.yaml
Created December 21, 2022 08:56
loki example config
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
common:
path_prefix: /data/loki
ingester:
@unixfox
unixfox / docker-compose.yml
Last active January 8, 2023 20:24
example mysql innodb cluster docker
version: '3'
services:
mysql-server-1:
hostname: mysql-server-1
env_file:
- mysql-server.env
image: mysql/mysql-server:8.0.31
volumes:
- ./data-server1:/var/lib/mysql
ports:
@unixfox
unixfox / README.md
Last active January 8, 2023 21:34
nats jetstream cluster

NATS JetStream Playground

Playground for a Secure, Highly Available NATS Cluster with message persistence (using JetStream).

This repo contains a cluster with 3 nodes and a Go client sending/receiving messages to it.

Pre-requisites

To use this repo, please install:

  • Docker
  • mkcert (zero-config tool for locally-trusted development certificates)
@unixfox
unixfox / mnt-sda.mount
Created March 24, 2023 13:38
systemd mount example
[Unit]
Description=Docker mount
[Mount]
What=/dev/sda1
Where=/mnt/sda
Type=ext4
Options=defaults
[Install]
@unixfox
unixfox / setipv6.sh
Last active June 4, 2023 21:19
start script alpine linux ipv6 scaleway
#!/bin/ash
# /opt/setipv6.sh
# apk add curl
# rc-update add local default
until $(curl --output /dev/null --silent --head --fail http://169.254.42.42/conf); do
sleep 5
done
export $(curl -s http://169.254.42.42/conf | grep IPV6_ADDRESS)
export $(curl -s http://169.254.42.42/conf | grep IPV6_GATEWAY)
ip -6 addr add "$IPV6_ADDRESS"/64 dev eth0
@unixfox
unixfox / haproxy.cfg
Created June 17, 2023 14:48
haproxy ja3 mode tcp
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon