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 python3 | |
import os, termios, collections, re | |
TermAttr = collections.namedtuple("TermAttr", | |
["iflag", "oflag", "cflag", "lflag", "ispeed", "ospeed", "cc"]) | |
old = TermAttr._make(termios.tcgetattr(0)) | |
new = old._replace( | |
lflag=old.lflag & ~(termios.ECHO | termios.ICANON) | |
) |
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 python3 | |
''' | |
Code by Alba Mendez, manually copied and pasted, had 8 revisions when copied. | |
https://gist.github.com/mildsunrise/ffd74730504e4dc44f47fc7528e7bf59 | |
Portable* ISO Base Media File Format dissector / parser. | |
Usage: ./mp4parser.py <file name> | |
(*) Needs Python 3.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
register_path() { | |
# Usage: | |
# register_path <env_var_name> <provided_path> [after] | |
# | |
# Registers a path in a PATH-like environment variable. | |
# The provided_path is prepended unless the "after" | |
# argument is provided, in which case it's appended. | |
# | |
# Example: | |
# register_path LD_LIBRARY_PATH /an/important/path |
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/python3 | |
# | |
# Generate crazy MP4 edit lists to be added to media files for testing. | |
# | |
# 1. Modify the timescales below with the actual values from the MP4 file. | |
# | |
# 2. Run the following commands to patch the file with Bento: | |
# | |
# # Remove previously existing edit list (optional, only if there is some) | |
# mp4edit --remove moov/trak/edts original.mp4 patched1.mp4 |
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 python | |
from __future__ import print_function | |
import sys | |
import os | |
import re | |
import ctypes | |
import argparse | |
ulseek = ctypes.cdll['libc.so.6'].lseek | |
ulseek.restype = ctypes.c_uint64 |
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/python3 | |
# Instructions: | |
# 1. Checkout: https://github.com/Ecosystem-Infra/wpt-results-analysis.git | |
# 2. cd compat-2021 | |
# 3. Edit main.js like this: | |
# const CATEGORIES = [ | |
# + 'media-source', | |
# + 'media', | |
# ]; | |
# ... |
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
// Quick and dirty ES6 promise testing (because I couldn't find any better) | |
// MIT License | |
function makeResolvedPromise(value) { | |
return new Promise(function(success) { | |
success(value); | |
}); | |
} | |
function makeRejectedPromise(errorValue) { |
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
[Unit] | |
Description=PHP FastCGI Server | |
After=syslog.target network.target remote-fs.target nss-lookup.target | |
[Service] | |
Type=forking | |
PIDFile=/run/php-fpm.pid | |
ExecStart=/usr/sbin/php-fpm --fpm-config /etc/php5/fpm/php-fpm.conf | |
ExecReload=/bin/kill -s HUP $MAINPID | |
ExecStop=/bin/kill -s QUIT $MAINPID |
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
#!/bin/bash | |
set -eu | |
found_not_mounted=0 | |
function check_not_empty() { | |
local path="$1" | |
if [ ! -d "$path" ]; then | |
found_not_mounted=1 | |
echo "ERROR: $path does not exist!" | |
elif [ ! "$(ls -A "$path")" ]; then |
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/python | |
# -*- coding: utf-8 -*- | |
# (c) 2014, Juan Luis Boya García <ntrrgc () gmail.com> | |
# (c) 2012, Jan-Piet Mens <jpmens () gmail.com> | |
# | |
# This file is part of Ansible | |
# | |
# Ansible is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
NewerOlder