This file contains hidden or 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 python2.7 | |
import math | |
import sys | |
import hashlib | |
__b32chars = "qpzry9x8gf2tvdw0s3jn54khce6mua7l" | |
__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' | |
def b58encode(v): |
This file contains hidden or 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
/* | |
Designed for makemkvcon running inside a Docker container writing MKV files to /output. | |
The problem: | |
makemkvcon creates MKV files with the maximum of 0644 file mode. The current umask limits the maximum file mode, but | |
does not itself increase permissions (only decreases). This means when a user has a umask of 0002 and touches a new | |
file, it will have permissions of 664. However when makemkvcon runs MKV files will have permissions of 644. | |
The solution: | |
This code compiles into a shared object which is loaded at the beginning of makemkvcon's execution. This will |
This file contains hidden or 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
ctrl-z | |
bg | |
touch /tmp/stdout | |
touch /tmp/stderr | |
gdb -p $! | |
# In GDB | |
p dup2(open("/tmp/stdout", 1), 1) | |
p dup2(open("/tmp/stderr", 1), 2) |
This file contains hidden or 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
class Strategy s where | |
storeOutput :: s -> Ports -> IO () | |
nextInput :: s -> IO Ports | |
isDone :: s -> Bool | |
failed :: s -> Bool | |
run :: Strategy s => s -> IO [Ports] | |
run world = let loop = do w' = next world | |
if isDone w' | |
then fetch w' |