This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM archlinux | |
# Temporary patch for support old docker versions (like the default one in ubunutu 18.04) | |
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && \ | |
curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && \ | |
bsdtar -C / -xvf "$patched_glibc" | |
RUN pacman -Syyu --noconfirm && pacman-db-upgrade && pacman -S --noconfirm --needed base-devel cmake curl mpfr libmpc gmp e2fsprogs ninja qemu qemu-arch-extra git pulseaudio-alsa | |
RUN git clone https://github.com/bestouff/genext2fs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import random | |
import os | |
class RedisServer(object): | |
def __init__(self, dockerimage=None): | |
while True: | |
self._proc = None | |
self._port = random.randint(1025, 65535) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Version 0.0.1 (works with python2.7 and python3) | |
# Does not work with non-local context (i.e. git, remote archives) | |
# You need the pathspec package installed (pip install pathspec) | |
# Pass any docker build arguments you want to use after -- argument (i.e., dockerignore.py . -- -t blah) | |
# This works with .gitignore syntax, not .dockerignore ( https://git-scm.com/docs/gitignore#_pattern_format ) | |
import tarfile | |
import subprocess | |
import argparse | |
import os | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redbaron | |
import re | |
logfunctions = ['info', 'warning', 'error', 'critical', 'exception'] | |
#If you dont use the logger.info('text',...) format, change this code | |
def should_handle(node): | |
parent = node.parent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# You can replace the python version to check | |
PYTHON=${PYTHON:-`which python`} | |
TMPFILE=tmp.py | |
[ -x "`which strace`" ] || { echo strace not found; exit 1; } | |
[ -x "${PYTHON}" ] || { echo python not found; exit 1; } | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Benchmark for https://github.com/requests/toolbelt/pull/222 | |
from requests_toolbelt import MultipartStreamDecoder, MultipartDecoder | |
def generate_data(bonudary, length, chunk_size): | |
yield b'\r\n--%s\r\n' % bonudary | |
yield b'Content-Disposition: form-data; name="metadata"; filename="metadata"\r\n' | |
yield b'Content-Type: text/plain\r\n' | |
yield b'\r\n' | |
yield str(length).encode('utf-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import new | |
class Empty(object): | |
pass | |
def patch_const(func, const_index, new_value, previous_value=Empty): | |
co = func.func_code | |
consts = list(co.co_consts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A port of https://github.com/phoboslab/jsmpeg-vnc/blob/master/source/grabber.c to python | |
# License information (GPLv3) is here https://github.com/phoboslab/jsmpeg-vnc/blob/master/README.md | |
from ctypes import Structure, c_int, POINTER, WINFUNCTYPE, windll, WinError, sizeof | |
from ctypes.wintypes import BOOL, HWND, RECT, HDC, HBITMAP, HGDIOBJ, DWORD, LONG, WORD, UINT, LPVOID | |
import numpy as np | |
SRCCOPY = 0x00CC0020 | |
DIB_RGB_COLORS = 0 | |
BI_RGB = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import sys | |
import os | |
import subprocess | |
import shutil | |
import tempfile | |
import time | |
import hashlib | |
import argparse | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import socket | |
import subprocess | |
import time | |
import sys | |
address = '0.0.0.0' | |
port = 8000 | |
kodi_path = r'C:\Program Files (x86)\Kodi\Kodi.exe' |
NewerOlder