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
from subprocess import call | |
import types | |
def sudo(cmd): | |
cmd = 'sudo %s' % cmd | |
return call(cmd, shell=True) | |
class SudoExecutor(type): | |
def __getattr__(self, name): |
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
FROM stackbrew/ubuntu:saucy | |
RUN apt-get update | |
RUN apt-get install -y --force-yes \ | |
software-properties-common \ | |
pciutils \ | |
debconf-utils | |
RUN add-apt-repository -y ppa:saltstack/salt | |
RUN apt-get update |
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
(function(c,a,b,i,r){ | |
r='#'; | |
c=c.replace(r,''); | |
b=b.replace(r,''); | |
for(i=0;i<6;i+=2) | |
r+=Math.round(a*parseInt(c[i]+c[i+1],16)+(1-a)*parseInt(b[i]+b[i+1],16)).toString(16); | |
return r | |
})('#f4f3f0', 0.3, '#ffffff') | |
/* color, alpha, background */ |
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 | |
import os | |
import subprocess | |
import shutil | |
import hashlib | |
import time | |
from string import Template | |
STREAMS = [ |
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 | |
import os | |
from subprocess import call | |
import hashlib | |
me = os.path.dirname(os.path.realpath(__file__)) | |
tmp = "%s/tmp" % me |
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
curl -I http://corpix.ru 2>/dev/null | grep Last-Modified | sed 's/.\+: //' | xargs node -e 'd=new Date(process.argv.slice(1).join(" "));e=new Date(Date.now()-10*1000);process.exit(d.getTime()>e.getTime()?0: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
#!/bin/bash | |
# Helpers for current branch tagging | |
function get_filetered_branch_repr {echo `git rev-parse --abbrev-ref HEAD` | sed 's/\//-/g'}; | |
function get_last_tag {git tag | grep `get_filetered_branch_repr` | sort -r | head -n 1}; | |
function get_incremented_tag { | |
get_last_tag | \ | |
python -c "for line in __import__('sys').stdin: l=line.split('-');v=l[-1].rstrip().split('.');v[-1]=str(int(v[-1])+1);print '-'.join(l[:-1]+['.'.join(v)])" | |
} |
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
var s = '';for(var i = 0; i < nodes.length; i = i + 4) {s+="group {\n host " + nodes[i+1].value + " {\n hardware ethernet " + nodes[i].value + ";\n fixed-address " + nodes[i+2].value + ";\n }\n}\n"} |
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 os | |
import re | |
import http.client | |
connection = http.client.HTTPConnection('pgl.yoyo.org') | |
connection.request('GET', '/as/serverlist.php?hostformat=one-line&mimetype=plaintext') | |
response = connection.getresponse() | |
res_lines = response.read().decode().split(os.linesep) |
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
{EventEmitter} = require('events') | |
_emit = EventEmitter::emit | |
EventEmitter::emit = (type) -> | |
args = Array::slice.call(arguments) | |
res = _emit.apply(@, args) | |
if @_delegates and @_delegates[type] | |
for delegate in @_delegates[type] | |
if delegate.emit.apply(delegate, args) |
OlderNewer