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
def cdSame(profile=None): | |
import os | |
from IPython.parallel import Client | |
if profile: | |
rc = Client(profile=profile) | |
else: | |
rc = Client() | |
dview = rc[:] |
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
HC_KAISER = { | |
1: 1.24, | |
2: 2.94, | |
3: 4.53, | |
4: 6.31, | |
5: 7.91, | |
6: 9.42, | |
7: 10.95, | |
8: 12.53, | |
9: 14.09, |
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
Licensed under GNU Lesser General Public License | |
Originally part of 'pygeo' (also by Brendan Smithyman). | |
https://www.gnu.org/licenses/lgpl.html |
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 | |
cat << END | |
<html> | |
<body> | |
<pre style="font-family: consolas,monospace;font-size:8pt"> | |
END | |
cat - |
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
0 7 1 * * (vnstati -m -i eth1 -o /tmp/vnstati.png && uuencode /tmp/vnstati.png /tmp/vnstati.png && vnstati -d -i eth1 -o /tmp/vnstati.png && uuencode /tmp/vnstati.png /tmp/vnstati.png) | mailx -s "Network Usage" brendan@bitsmithy.net |
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
def GB(tag = None): | |
import sys | |
if not hasattr(GB, 'badgercount'): | |
GB.badgercount = 0 | |
sys.stdout.write('Guard badger: %03d is named %s'%(GB.badgercount, 'Stanley' if not tag else tag)) | |
sys.stdout.flush() | |
GB.badgercount += 1 |
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
# | |
# Automatically generated file; DO NOT EDIT. | |
# Linux/arm 4.2.0 Kernel Configuration | |
# | |
CONFIG_ARM=y | |
CONFIG_ARM_HAS_SG_CHAIN=y | |
CONFIG_MIGHT_HAVE_PCI=y | |
CONFIG_SYS_SUPPORTS_APM_EMULATION=y | |
CONFIG_HAVE_PROC_CPU=y | |
CONFIG_STACKTRACE_SUPPORT=y |
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
class Blorgle(object): | |
@property | |
def incompatible(self): | |
import inspect | |
frame = inspect.currentframe() | |
print('Current') | |
print(frame.f_locals.get('self', None)) | |
print('Previous') | |
print(frame.f_back.f_locals.get('self', None)) | |
print('2Prev') |
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
body | |
{ | |
background-color: #3f3f3f; | |
margin: 8px; | |
padding: 0; | |
} | |
#content | |
{ | |
width: 898px; |
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 contextlib | |
import os.path | |
from pycallgraph import PyCallGraph | |
from pycallgraph.output import GraphvizOutput | |
@contextlib.contextmanager | |
def graph_stack(filename): | |
'Generate a call graph for the enclosed context' | |
go = GraphvizOutput(output_file=filename) | |
go.output_type = os.path.splitext(filename)[-1][1:] |