Skip to content

Instantly share code, notes, and snippets.

# Copyright Andy Chu
class switch(object):
"""A ContextManager that translates to a C switch statement."""
def __init__(self, value):
# type: (int) -> None
self.value = value
def __enter__(self):
# type: () -> switch
@pr1ncess-emily
pr1ncess-emily / avkeys.js
Last active July 30, 2022 15:21
Deobfuscated exalphadev keygen
// Deobfuscated code for https://github.com/exalpha-dev/exalpha-dev.github.io
// Commit ae838c4
// useless func that does nothing
// (function (shiyu, jennielee) {
// var sherece = mohmmad, chumani = shiyu();
// while (true) {
// try {
// var lorette = parseInt('527166rkeZox') / 1 +
// parseInt(sherece(370)) / 2 * (-parseInt(sherece(371)) / 3) +
@ChatchaiJ
ChatchaiJ / build-python-deb-package.sh
Last active July 4, 2022 23:50
Create python 3.10.4 debian package from source
#!/bin/bash
# ----- work space config -----
WORKDIR="$(pwd)"
SRCDIR="${WORKDIR}/src"
BUILDDIR="${WORKDIR}/build"
LOGDIR="${WORKDIR}/log"
# ----- package config -----
NAME="python"
@ThinGuy
ThinGuy / mikrotik.beep.music.sh
Last active January 24, 2025 13:54
Add music to mikrotik routers
/system script add dont-require-permissions=no name="Super=Mario-Bros" owner=admin policy=read source=":beep frequency=660 length=100ms;\n:delay 150ms;\n:beep frequency=660 length=100ms;\n:delay 300ms;\n:beep frequency=660 length=100ms;\n:delay 300ms;\n:beep frequency=510 length=100ms;\n:delay 100ms;\n:beep frequency=660 length=100ms;\n:delay 300ms;\n:beep frequency=770 length=100ms;\n:delay 550ms;\n:beep frequency=380 length=100ms;"
/system script add dont-require-permissions=no name="Thunderstruck" owner=admin policy=read source=":local n11 63,66;\n:local n12 64,67;\n:local n21 71,69,68,69,68,66,68,64,66,63;\n:local n22 64,63;\n \n:local n11 (\$n11,\$n11);\n:local n12 (\$n12,\$n12);\n:local n1 (\$n11,\$n11,\$n12,\$n12);\n:local n2 (\$n21,\$n22,\$n22,\$n22);\n:local notes (\$n1,\$n1,\$n2,\$n2);\n \n:local ticks 2;\n:local speed 55ms;\n:local stacc 5ms;\n# Transposition \n:local transpose -48;\n# ============================== \n# Don't change this: \n:local frqtab 8372,8869,9397,9956,10548,11175,11839,12543
"""
Script to scrape FilmOn for all channels and returns as tvg m3u8.
Includes Channel Name, Logo, and Category.
URI is an example proxied stream from https://gist.github.com/rlaphoenix/e18170c950a917890823eb53777a15a0
as using the official URI will just expire, useless.
"""
import sys
import requests
from pathlib import Path
@rlaphoenix
rlaphoenix / iptv.py
Last active December 9, 2024 17:13
Various Python Flask API utilities for working with HLS/DASH/DRM streams.
from functools import wraps
import os
import re
import subprocess
from pathlib import Path
from typing import Literal
from urllib.parse import quote_plus, unquote_plus, urlencode, urljoin
from uuid import uuid4
import requests
@KuangyeChen
KuangyeChen / brew_install_all.bash
Last active July 3, 2022 00:56
Install all brew formulae and casks
#!/usr/bin/env bash
set -e
function log_section() {
printf "\033[0;32m==>\033[0m\033[1m ${*}\033[0m\n"
}
function log_warning() {
printf "\033[1mWARN\033[0m: ${*}\n"
@InfoTeddy
InfoTeddy / fix_steam_screensaver.c
Created May 22, 2022 06:58
Linux Steam client screensaver issue workaround LD_PRELOAD library, while letting games disable screensaver
/* SPDX-License-Identifier: MIT */
/*
* On Linux, Steam periodically calls SDL_DisableScreenSaver() so your
* screensaver doesn't work with the Steam client open even if you aren't
* playing a game, as described in
* https://github.com/ValveSoftware/steam-for-linux/issues/5607 .
*
* To fix this, LD_PRELOAD a library that replaces SDL_DisableScreenSaver()
* with a no-op if the executable calling it is Steam, but otherwise let it
@esseti
esseti / print_stk.lua
Last active November 20, 2024 20:27
Read sticky table of HA proxy from lua action
function dump_str(o)
-- transform a table into a string for the printing.
-- found it on google
-- better to use print_r from here http://www.arpalert.org/haproxy-scripts.html
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump_str(v) .. ','
@lachesis
lachesis / nws-forecast.py
Created May 18, 2022 21:14
NWS weather forecast, hourly for next 7 days
#!/usr/bin/python3
import datetime
import hashlib
import itertools
import os
import socket
from pprint import pprint
import dateutil.parser
import lxml.etree