Skip to content

Instantly share code, notes, and snippets.

View tuxuser's full-sized avatar
🎯
Focusing

tuxuser tuxuser

🎯
Focusing
View GitHub Profile
@tuxuser
tuxuser / fiddler_gen.sh
Last active February 24, 2024 17:29
Fiddler - MITMProxy Key / Root CA generation
#!/bin/sh
## Some device only accept a Fiddler certificate.
## What if you don't like Fiddler and want to use mitmproxy instead?
## -> Generate your own Fiddler key/root ca!
# Usage:
# - Start mitmproxy / mitmweb once, to populate the `.mitmproxy` dir
# - Execute this script
# - Copy the mitmproxy certs into `C:\Users\<username>\.mitmproxy` aka. `/home/<username/.mitmproxy`, overwriting existing files
# - Start mitmproxy / mitmweb
@tuxuser
tuxuser / sunshine-0.14.0.ebuild
Created July 24, 2022 17:52
Sunshine gamestreaming host - Gentoo ebuild
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake-utils git-r3
DESCRIPTION="Sunshine is a gamestream host for Moonlight"
HOMEPAGE="https://github.com/SunshineStream/Sunshine"
EGIT_REPO_URI="https://github.com/SunshineStream/Sunshine.git"
@tuxuser
tuxuser / adalight_neopixel.ino
Last active August 25, 2023 02:20
Adalight Neopixel implementation (SK6812 RGBW works)
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
/**************************************
S E T U P
set following values to your needs
**************************************/
@tuxuser
tuxuser / adalight_sk2812_rgbw_hack.ino
Created January 21, 2022 03:10
Adalight hack, to kinda support SK6812 RGBW LED strips
/*
* Uses hack from https://www.partsnotincluded.com/fastled-rgbw-neopixels-sk6812/
* At least the LED Count is correct now....
*
*/
#include "FastLED.h"
#include "FastLED_RGBW.h"
#define ANALOG_MODE_AVERAGE 0
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# This ebuild requires globally installed npm package: typescript
EAPI=7
inherit gnome2-utils
if [[ ${PV} == "9999" ]]; then
EGIT_REPO_URI="https://github.com/pop-os/shell.git"
@tuxuser
tuxuser / xbl_oauth2.py
Created September 2, 2020 09:15
Sign in to Xbox Live with OAUTH2
"""
Sign in to Xbox Live with OAUTH2
1. Go to https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade
2. Register new app ("+ New registration")
2.1. Enter a name for your app
2.2. Set "Supported account types" to "Personal Microsoft accounts only"
2.3. Click register
2.4. Choose "Redirect URIs" -> "Add a Redirect URI"
2.5. Click "Add a platform" -> "Mobile and desktop applications"
@tuxuser
tuxuser / argparse_subcommands.py
Created March 6, 2020 08:43
ArgumentParser with subcommands, common arguments and logging setup
import logging
import argparse
from logging.handlers import RotatingFileHandler
"""
argparse_subcommands.py
# Argparse with subcommands
@tuxuser
tuxuser / bootp.lds.m4
Last active December 8, 2019 13:15
Convert broadcom CFE vmlinux.lz to ELF executable
OUTPUT_FORMAT(elf32-littlearm)
OUTPUT_ARCH(arm)
ENTRY(code_start)
PHDRS
{
code PT_LOAD AT(M4_CODE_ADDR);
}
SECTIONS
@tuxuser
tuxuser / keybase.md
Created October 19, 2019 07:20
Proof of identity

Keybase proof

I hereby claim:

  • I am tuxuser on github.
  • I am tuxuser (https://keybase.io/tuxuser) on keybase.
  • I have a public key ASAVCSEflT-wFmJwlRUeccYBImM1WXyOhVSCBSJg-6rv2go

To claim this, I am signing this object:

#include <stdio.h>
#include <windows.h>
#include <bcrypt.h>
#define NT_SUCCESS(x) (x == 0)
#define STATUS_SUCCESS ((NTSTATUS)0)
#define STATUS_ERROR ((NTSTATUS)1)
NTSTATUS SaveFile(PUCHAR dataBlob, ULONG dataSz, LPCWSTR filePath)
{