Skip to content

Instantly share code, notes, and snippets.

@mayli
mayli / am3u8-dl.py
Created August 23, 2021 21:50
another m3u8 downloader
#!/usr/bin/env python3
import sys
import os
import aiohttp
import asyncio
from tqdm.asyncio import tqdm
from urllib.parse import urljoin
async def verify_noop(filename):
return True
@mayli
mayli / zone.txt
Last active May 27, 2021 19:31
zonefile
$ORIGIN n.dn42.
$TTL 7200
; SOA
@ IN SOA ns2.androw.dn42. noc.androw.eu. (
2021050901 ; Serial
7200 ; Refresh
1800 ; Retry
1209600 ; Expire
@mayli
mayli / Dockerfile
Created January 20, 2020 07:03
docker build exodus qbittorrent-nox
FROM alpine
RUN apk update && apk add python git automake libtool git boost-dev openssl-dev qt5-qtbase-dev qt5-qttools-dev autoconf build-base py2-pip
RUN pip install exodus-bundler
RUN cd && git clone https://github.com/arvidn/libtorrent.git && \
cd libtorrent/ && \
git checkout RC_1_2 && \
./autotool.sh && \
./configure --disable-debug --enable-encryption CXXFLAGS="-std=c++14" && \
make -j$(nproc) && \
make install
@mayli
mayli / README.md
Last active November 6, 2019 02:53

usage

ban.py

`kubectl logs --all-containers=true --tail=20 -f -l workload.user.cattle.io/workloadselector=web | python2 ./ban.py`

ratecounter.py

`kubectl logs --all-containers=true --tail=20 -f -l workload.user.cattle.io/workloadselector=web | python2 ratecounter.py web`

kubectl logs --all-containers=true --tail=20 -f -l workload.user.cattle.io/workloadselector=tracker | python2 ratecounter.py tracker

@mayli
mayli / opengrok.user.js
Last active October 17, 2019 00:10
opengrok jump to line
// ==UserScript==
// @name Opengrok jump to line
// @namespace http://tampermonkey.net/
// @version 0.1
// @description does it work?
// @author You
// @include /^https?://opengrok.*$/
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @updateUrl https://gist.github.com/mayli/d349360df3a5c738ee0ebcccb980cf03/raw/351ada4d06837c1ee2218894e57587961eecc5b3/opengrok.user.js
@mayli
mayli / unbalancer.py
Created July 3, 2019 22:47
the unbalancer.py for mergerfs
#!/usr/bin/env python2
import argparse
import os
import shutil
@mayli
mayli / Dockerfile
Created May 6, 2019 20:37
mosh static alpine docker
FROM alpine:latest
MAINTAINER Brett Randall <javabrett@gmail.com>
# NOTE: openssh is only required for testing connection to built docker using the built mosh-server
RUN apk update \
&& apk add alpine-sdk autoconf automake protobuf-dev ncurses ncurses-dev ncurses-static openssl-dev openssh
RUN apk add perl-doc
RUN git clone https://github.com/mobile-shell/mosh.git \
&& cd mosh \
@mayli
mayli / zfs -S
Created January 29, 2019 19:59
dedupe?
Simulated DDT histogram:
bucket allocated referenced
______ ______________________________ ______________________________
refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
------ ------ ----- ----- ----- ------ ----- ----- -----
1 13.6M 6.60T 6.34T 6.34T 13.6M 6.60T 6.34T 6.34T
2 980K 156G 144G 145G 1.99M 327G 302G 304G
4 74.1K 6.75G 5.26G 5.40G 339K 31.7G 24.7G 25.4G
8 13.0K 1.70G 1.39G 1.42G 131K 20.0G 16.9G 17.2G
import threading
import Queue
import shelve
from multiprocessing.pool import ThreadPool
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s:[%(threadName)s] %('
'levelname)s - %(message)s')
logger = logging.getLogger(__name__)