Protip: If you ever want to control the permission of the Unix domain socket file generated after bind()
, call fchmod()
before bind()
ing. This is blatant Linuxism anyway, and file permission on UDS file has no effect on BSD systems.
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
diff --git a/checkimpcont.py b/checkimpcont.py | |
index 3ca2d3f..46066b2 100755 | |
--- a/checkimpcont.py | |
+++ b/checkimpcont.py | |
@@ -140,7 +140,7 @@ ST_CHECK = State("check") | |
ST_INIT.add_rule(IS_STR, ST_SEEK_NL, push_stack) | |
ST_INIT.set_default(ST_INIT) | |
-ST_SEEK_NL.add_rule(IS_STR, ST_SEEK_NL, compose(pop_stack, push_stack)) | |
+ST_SEEK_NL.add_rule(IS_STR, ST_SEEK_NL, compose(use_stack, push_stack)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 python | |
"""Dump CPU affinity information as a tree.""" | |
import sys | |
import collections | |
import re | |
import json | |
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
from rlyeh import cthulhu | |
cthulhu.fhtagn() |
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
def human_enum(list_): | |
cleantxtlist = [] | |
for item in list_: | |
word = str(item).strip() | |
if word: | |
cleantxtlist.append(word) | |
head = cleantxtlist[:-1] | |
tail = cleantxtlist[-1:] | |
hs = ", ".join(head) | |
return " and ".join([hs] + tail if hs else tail) |
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
for f in `pcregrep -o '(?<=^def )(.+)(?=\s*\(.*\):)' PYTHONFILE`; do echo -n "$f: "; pcregrep -c `printf "%s%s%s" '(?<!def)(\s+\b' $f ')(?=\()'` PYTHONFILE; done | sort -n -t: -k2 |
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/python | |
import sys | |
import itertools | |
for linepair in itertools.izip_longest(*[sys.stdin]*2): | |
if int(linepair[0].split()[1]) >= 200: | |
for line in linepair: | |
sys.stdout.write(line) |