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 re | |
| import sys | |
| import os | |
| def filerev(somefile, buffer=256): | |
| somefile.seek(0, os.SEEK_END) | |
| size = somefile.tell() |
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)) |
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
| 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
| 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 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
| # cat network-bridge-scripts.sh | |
| #!/bin/bash | |
| #ifcfg-eth0 | |
| sed -i 's/^BOOTPROTO=dhcp$/BOOTPROTO=none/g' /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| echo "BRIDGE=switch">>/etc/sysconfig/network-scripts/ifcfg-eth0 | |
| #ifcfg-br0 | |
| echo "DEVICE=switch | |
| BOOTPROTO=dhcp | |
| ONBOOT=yes | |
| TYPE=Bridge">>/etc/sysconfig/network-scripts/ifcfg-br0 |
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 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
| 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(): |
OlderNewer