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
(function () { | |
/* | |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function | |
createElement(tagName) | |
createElement(tagName, options) | |
https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement | |
*/ | |
console.log("monkey patch start"); | |
var old_CreateElement = Document.prototype.createElement | |
function new_CreateElement() { |
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
class FunctionMeta(type): | |
class RpcWrapper(object): | |
def __init__(self,name): | |
self.name = name | |
def __call__(self): | |
print(self.name) | |
def __new__(cls, clsname, superclasses,attributedict): | |
print("clsname: ", clsname) | |
print("superclasses: ", superclasses) |
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
# Enable compression, to make data link quicker. | |
# Put or append this file in /system/etc/ppp directory | |
# http://forum.xda-developers.com/showthread.php?t=1800351 | |
# Mohammad Bahathir Hashim ([email protected]) | |
# GPL | |
# 2013 | |
crtscts | |
vj | |
bsdcomp |
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
from plumbum import SshMachine | |
from plumbum import local | |
from plumbum.cmd import sudo | |
from plumbum.cmd import grep, wc, cat, head | |
import os,subprocess,digitalocean,shutil,glob,os.path,plumbum | |
import servers.secret as secret | |
from servers.common import sshDir,create_ssh_dir | |
#http://www.robotgoblin.co.uk/blog/2012/07/24/managing-multiple-ssh-keys/ | |
def read_hosts(): |
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
import os,subprocess,plumbum | |
import servers.secret as secret | |
sshDir = "%s/.ssh" % os.environ['HOME'] | |
def create_ssh_dir(): | |
if not os.path.exists(sshDir): | |
os.mkdir(sshDir) | |
def install_pip2(ssh): |
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 dicts_to_html(dicts,keys = None): | |
from IPython.display import HTML | |
if not keys : | |
keys = dicts[0].keys() | |
rows = ["<table>"] | |
header = ["<tr>"] | |
for key in keys : | |
header.append("<th>"+key+"</th>") | |
header.append("</tr>") | |
rows.append("".join(header)) |
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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ |
NewerOlder