Skip to content

Instantly share code, notes, and snippets.

View pinkeen's full-sized avatar
☢️
Feeling radiant 😎

Filip Sobalski pinkeen

☢️
Feeling radiant 😎
View GitHub Profile
@pinkeen
pinkeen / streams-websockets.Caddyfile
Last active September 10, 2020 18:13
streamsnproxies caddy
###
# Vhost that terminates HTTPS and also proxies raw TLS connection
# for certain endpoints.
###
https://a-site.example.com {
# Get a certificate and decrypt the traffic as usual.
tls auto
handle /naked {
# Proxy the decrypted traffic to an HTTP backend effectively terminating the HTTPS
@cmdrkotori
cmdrkotori / qemu-mac
Last active March 1, 2023 07:52
QEMU script for macOS
#!/usr/bin/env python3
from subprocess import Popen, call
from time import sleep
threads = 8
mem = 8
eth0mac = '52:54:00:12:34:56'
bootSplash = '/home/tux/vms/splash/boot.jpg'
ovmfCode = '/home/tux/src/1git/macos-kvm-pci-passthrough/OVMF_CODE.fd'
ovmfVars = '/home/tux/src/1git/macos-kvm-pci-passthrough/OVMF_VARS.fd'
@vandarin
vandarin / ColorTempRGBWLight.h
Last active August 21, 2023 22:45 — forked from triphoppingman/ColorTempRGBWLight.h
ESPHOME custom light that provides color temperature support to RGBW lights. This differs from the original (see link in the code) by mapping the RGBW from the
#include "esphome.h"
enum mode {RGB, White};
// Constants
const float maxMired = 500;
const float minMired = 153;
/**
* Map a RGBW Light into a tunable color / RGB Light

Hardware specs

Chinese Brand "ITworks" , Model TW891, distributed in France and Belgium by Darty

  • CPU: Intel(R) Atom(TM) CPU Z3735F @ 1.33GHz
  • Video: Intel® HD Graphics for Intel Atom® Processor Z3700 Series
  • Screen: 1280x800
  • WiFi + BT: Realtek RTL8723BS_BT
  • Disks: mmcblk1: mmc1:0001 DF4032 29.1 GiB
  • RAM: 2GB DDR3 @ 1333 MHz
@triphoppingman
triphoppingman / ColorTempRGBWLight.h
Created November 22, 2019 05:17
ESPHOME custom light that provides color temperature support to RGBW lights. This differs from the original (see link in the code) by mapping the RGBW from the
#include "esphome.h"
// Constants
const float maxMired = 500;
const float minMired = 153;
const float scale1 = 1.25f;
const float red_offset = 0.4f;
const float green_offset = 0.8f;
/**
@berkus
berkus / xbox-one-wireless-protocol.md
Created April 4, 2019 13:21 — forked from alfredkrohmer/xbox-one-wireless-protocol.md
XBox One Wireless Controller Protocol

Physical layer

The dongle itself is sending out data using 802.11a (5 GHz WiFi) with OFDM and 6 Mbit/s data rate:

Radiotap Header v0, Length 38
    Header revision: 0
    Header pad: 0
    Header length: 38
    Present flags
@tom-tan
tom-tan / gist:b5669b6dc1f1b897a39dd4eedecfbb9b
Last active January 19, 2021 14:27
podman を Alpine 内で動かそうとしたメモ
@insdavm
insdavm / WireGuard-site-to-site.md
Last active May 3, 2024 21:19
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@mxey
mxey / Vagrantfile
Created December 5, 2018 11:39
Vagrantfile disable audio
machine.vm.provider "virtualbox" do |v|
# Prevent VirtualBox from interfering with host audio stack
v.customize ["modifyvm", :id, "--audio", "none"]
end
@iwanders
iwanders / compile_time_crc.hpp
Created June 26, 2018 01:09
C++ Compile Time CRC32
/*
The MIT License (MIT)
Copyright (c) 2018 Ivor Wanders
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is