Skip to content

Instantly share code, notes, and snippets.

View Scorfly's full-sized avatar
🎲
Working from home

Louis Marie Scorfly

🎲
Working from home
View GitHub Profile
@Scorfly
Scorfly / candles.go
Created July 11, 2025 19:36
TnS calculation
package eventconsumer
import (
"context"
"fmt"
"math"
"os"
"time"
appconfig "github.com/custom/config"
@Scorfly
Scorfly / app.py
Last active February 23, 2025 15:21
demo-kick-auth.py
from flask import Flask, request, redirect, jsonify
import os
import secrets
import hashlib
import base64
import requests
app = Flask(__name__)
# Requirement:
@Scorfly
Scorfly / mac_to_ipv6.pl
Last active April 19, 2017 13:39
[PERL] Function to convert MAC address to IPv6 link-local address
#!/usr/bin/perl
# source of how to process : http://stackoverflow.com/questions/27693120/convert-from-mac-to-ipv6
# take the mac address: 52:74:f2:b1:a8:7f
# throw ff:fe in the middle: 52:74:f2:ff:fe:b1:a8:7f
# reformat to IPv6 notation 5274:f2ff:feb1:a87f
# convert the first octet from hexadecimal to binary: 52 -> 01010010
# invert the bit at index 6 (counting from 0): 01010010 -> 01010000
# convert octet back to hexadecimal: 01010000 -> 50
# replace first octet with newly calculated one: 5074:f2ff:feb1:a87f