Skip to content

Instantly share code, notes, and snippets.

@XavM
XavM / gist:eeff855a2c16ae101a17c10c2f53a97f
Created June 27, 2023 16:03
Listen on port using powershell - Useful to test connectivity
$Listener = [System.Net.Sockets.TcpListener]9999;
$Listener.Start();
#wait, try connect from another PC etc.
$Listener.Stop();
@XavM
XavM / disable_dg_cg.md
Last active June 4, 2023 08:26
Windows 10 / WMWare Workstation / Nested Virtualisation fails : "Can't use VT-x/EPT" / Disable DeviceGuard - Hyper-V

Notes to myself and to the community :

Can't run Nested Virtualisation on Windows when DeviceGuard is on

WMWare Workstation requires to have access to Intel VT-x and VT-x/EPT for Nested Virtualisation

(The same must be true for other type 2 hypervisors ; Ex: VirtualBox, QEMU, etc ...)

Use case :

@XavM
XavM / README.md
Last active December 31, 2022 15:17
clusterhat/docker swarm
@XavM
XavM / getCertInfo.sh
Last active July 29, 2022 14:00
Get Serveur Chain Certs info - subject fingerprint issuer startdate enddate
# DON'T !
# Never ever execute command you do not have control on
# The returned cert could contain ";some malicious commands;" that would be executed by the awk:system
SERVER="google.com"
PORT=443
openssl s_client \
-showcerts \
-connect ${SERVER}:${PORT} \
@XavM
XavM / ssh_vpn.md
Last active March 29, 2021 07:43
Poor man's VPN using SSH (tcp in tcp is not a good idea, but ... can be handy)

Poor man's VPN using SSH (tcp in tcp is not a good idea, but ... can be handy)

Client :

WiFi connected using wlan0 on address range 172.20.10.0/28

sudo su 
apk install autossh
modprobe tun
@XavM
XavM / alpine_dqlite.md
Last active December 9, 2020 14:13
Build and Run dqlite on Alpine Linux

Build and Run dqlite on Alpine Linux

Node 1 (172.17.0.2)

Build

apk add raft-dev dqlite dqlite-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
apk add sqlite-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
apk add musl-dev go git jq curl

cd /root

@XavM
XavM / gist:723b74479735b48e24cbacd97d4f70ff
Last active December 4, 2020 13:21
git push deployment using git hooks

git push deployment using git hooks

Run sshd in Docker container (Test only)

From Mac

docker run -itp 2222:22 alpine /bin/sh

From container

alias ll="ls -larth"

apk add --no-cache --update-cache openrc openssh git npm

@XavM
XavM / admin1_FR_USFeatures.geojson
Last active April 10, 2020 16:08
admin1_FR_USFeatures
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[1.70256,43.26674],[1.71361,43.18971],[1.77491,43.1522],[1.95272,43.09574],[1.94358,43.05127],[1.97737,43.01511],[1.98952,42.96053],[1.96902,42.9196],[1.97724,42.86374],[1.88693,42.84429],[1.86549,42.81589],[1.91268,42.75662],[1.99185,42.73139],[2.05561,42.74426],[2.15772,42.69145],[2.16607,42.66384],[2.00565,42.65613],[1.9383,42.5718],[1.87282,42.57898],[1.76111,42.56764],[1.72199,42.60986],[1.59735,42.62192],[1.54309,42.64936],[1.46681,42.64146],[1.45141,42.60205],[1.4293,42.59539],[1.36108,42.68672],[1.31912,42.71336],[1.13433,42.71597],[1.06818,42.77612],[0.92111,42.78437],[0.8561,42.81276],[0.83248,42.88415],[0.8866,42.95899],[0.99225,42.99031],[0.9966,43.09469],[1.05443,43.13695],[1.13703,43.15403],[1.24269,43.08878],[1.29011,43.12345],[1.22467,43.15731],[1.23658,43.1848],[1.34939,43.2043],[1.38231,43.23132],[1.31551,43.25984],[1.30567,43.29905],[1.37378,43.29647],[1.41984,43.2614],[1.44093,43.21297],[
@XavM
XavM / gist:78bac54fd17a1870016342df7894ed64
Created April 25, 2019 10:03
[Safari only] "transceiverRequest" sent in a loop when the non initiator ".addStream"
<!DOCTYPE html>
<html lang="en" >
<head>
<script src="https://cdn.jsdelivr.net/gh/feross/simple-peer@c5f8a8ded50ef354d5a0f8a3700f8817565ed032/simplepeer.min.js"></script>
</head>
<body>
<button id="startVideoPeer1">Start Video Chat Peer1</button>