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 re | |
import sys | |
import os | |
def filerev(somefile, buffer=256): | |
somefile.seek(0, os.SEEK_END) | |
size = somefile.tell() | |
lines = [''] | |
rem = size % buffer | |
pos = max(0, (size // buffer - 1) * buffer) |
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
{ | |
graphitePort: 2003 | |
, graphiteHost: "localhost" | |
, port: 8125 | |
, backends: [ "./backends/graphite" ] | |
} |
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 fabric.api import * | |
env.user = 'vagrant' | |
env.password = 'vagrant' | |
env.hosts = ['127.0.0.1',] | |
#env.roledefs = { | |
# 'web':['localhost'], | |
# 'db':['127.0.0.1'], | |
#} | |
def host_type(): |
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 random | |
import string | |
smailar_chars = '01oilLIOpP' | |
upper = "".join(set(string.uppercase) - set(smailar_chars)) | |
lower = "".join(set(string.lowercase) - set(smailar_chars)) | |
chars = upper + lower | |
numbers = '23456789' | |
symbols = '#$%&+,-./:;_~?=@!' |
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
target=/var/www/html/deploy/package/wordpress-$WP_VERSION.tgz | |
md5file=$target.md5 | |
tar zcvf $target wordpress-$WP_VERSION | |
md5sum $target | cut -d\ -f 1 > $md5file | |
echo $WP_VERSION > /var/www/html/deploy/lastver |
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 logging | |
from logging.handlers import * | |
import sys | |
logger = logging.getLogger(name='error') | |
logger.setLevel(logging.NOTSET) | |
handle = logging.FileHandler('/tmp/aaa.log') |
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
input { | |
file { | |
path => "/var/log/messages" | |
type => "syslog" | |
} | |
file { | |
path => "/var/log/php_errors.log" | |
type => "phperror" | |
} | |
file { |
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 sys | |
import os | |
import urllib | |
import urllib2 | |
import tarfile | |
import shutil | |
APP_NAME="wordpress" |
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 | |
#coding:utf-8 | |
def readfilerev(fd): | |
buff = 256 | |
fd.seek(0,2) | |
size = fd.tell() | |
rem = size % buff | |
#pos = max(0, (size / buff -1) * buff) | |
line = '' |
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 | |
#coding:utf-8 | |
import sys | |
def readfilerev(fd): | |
buff = 256 | |
fd.seek(0,2) | |
size = fd.tell() | |
rem = size % buff | |
pos = max(0, size - (buff + rem)) |
NewerOlder