ubuntu on the deployment operations python Gadgets

2010-09-13  来源:本站原创  分类:Python  人气:154 

Help a friend wrote a small tool to record:

linux command:

Shield pemission deny:

find /-name apache 2> / dev / null

File copy:
Local to the server: scp-p / tmp / New \ Project \ 20100912 \ 0015.sql [email protected]: / home / mike /
server to the local: scp-p [email protected]: / home / mike / loopSearch .* / tmp /

ubuntu install MySQLdb: sudo apt-get install python-mysqldb

Paste the code in the restart process:

#!/usr/bin/env bash

import time
import threading
import os

def getMem():
    memInfo = os.popen("free").read()
    infos = memInfo.split()
    print infos
    return int(infos[9])

def startSearch():
    os.popen("python XXX.py")

if __name__ == "__main__":
    print getMem()
    ttime = 0
    pt = 360
    t = threading.Thread(target=startSearch)
    t.start()
    while(True):
        if getMem() < 10000 or ttime > 36000:
            break
        time.sleep(pt)
        ttime += pt
getMem Gets the currently available memory
 If the memory is less than 10M or programs running  10 Hours, then exit  .
 If you want to restart, but in the outer sleeve  shell Script  .
相关文章
  • ubuntu on the deployment operations python Gadgets 2010-09-13

    Help a friend wrote a small tool to record: linux command: Shield pemission deny: find /-name apache 2> / dev / null File copy: Local to the server: scp-p / tmp / New \ Project \ 20100912 \ 0015.sql [email protected]: / home / mike / server to the l

  • Simple comparison of data persistence operations Python (2) 2010-06-01

    Python relational database to operate the most direct is to use DB-API, and general process is: to connect, do the SQL statement, submission, disconnect. To MySQL, for example, the following sample code in various steps: The first is to connect: % py

  • Ubuntu下如何搭建完美Python开发环境? 2013-01-20

    在Windows下成功地搭好了一个Python开发环境,这次转战Ubuntu,在Ubuntu下搭建Python开发环境.有了前面的经验,这次相对来说轻松多了.还发现Ubuntu下的操作反而比Windows方便些. 安装环境 IntelCore7250(双核),操作系统Ubuntu10.04.1 1.安装OpenJDK6 sudoapt-getinstallopenjdk-6-jdk 选用OpenJDK的原因是他已经通过测试,完美兼容JDK,并在Linux更新源中已经取代了sun-java6-jd

  • Translated using the Google API for Python Gadgets 2010-07-10

    Because of the timely completion of this gadget, thanks to the Internet to find some code to use, it also put things yourself back to the network. :) Preceded by such a small demand, It is necessary to translate some unrelated sentences, and do not c

  • Python Gadgets - multi-file search string fs 2010-10-18

    A few days ago, looking at Android in the makefile, in order to facilitate their search string in the make file, using perl to write a small tool to achieve the function is in the directory multiple text files in the search string. The tool with the

  • [Server Deployment Tools] Python Deploy Tool Fabric 2011-05-14

    Server in the management of many, many times, and sometimes there is such a demand: Some servers from the local to upload, download data from the server to the local, access to some server on a command execution results. Python is a small tool to add

  • Solve the Ubuntu delete / upgrade Python and the console can not access the desktop garbage problem 2010-10-30

    Since Python there are some problems, leading to reinstall Python. Then sudo apt-get remove python drop down, Ubuntu immediately to a problem, the terminal can not enter. Supposed to reload the same as in Windows, Python on the bin, later discovered

  • 使用virtualenv在ubuntu上搭建python 3开发环境 2013-05-11

    ubuntu 13.04默认的python版本是2.7的,想在其上做python3的开发会遇到问题.比如要使用pip安装软件包时,默认安装的就是python2的包.如果想安装python3的包,就需要用到virtualenv了. virtualenv的官网在http://www.virtualenv.org/en/latest/.如其官方所说,virtualenv 是一个创建独立python环境的工具.其要解决的最基本问题就是库的依赖和版本,以及间接权限(indirectly permision

  • ubuntu 13.04 安装 gitlab 5.3 版 2013-07-15

    英文原版 Debian 下安装教程: https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/doc/install/installation.md ubuntu 与 Debian 还是有点区别的,因为 ubuntu 默认安装了 sudo/python,并且 gedit 编辑器用着比 vim 容易上手...所以就没有安装 sudo/python 和 vim 的的代码了... 现在开始... 一. 软件源安装所需的软件包 sudo apt-get

  • IBM WebSphere WebSphere Extended Deployment 2010-04-06

    Welcome to the WebSphere Extended Deployment, Version 6.1Information Center http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r1/index.jsp?topic=/com.ibm.websphere.gridmgr.doc/info/scheduler/ccgtws.html WebSphere Extended Deployment Version 6.1 Welc

  • jboss deployment architecture 2010-06-30

    JBoss Application Server deployment architecture JBoss deployment architecture can be divided into three parts: hot deployment mechanism, the deployment of common processes, the deployment process. Hot deployment mechanism, so we do not need to resta

  • WebLogic deployment data source 2010-10-22

    http://www.cstc.org.cn/tabid/88/InfoID/84778/Default.aspx III. Configuration data source: Database applications in the remote deployment, but also in the process of its preparation of the deployment data source. Below to the A machine has been packag

  • WebSphere Message Broker development and deployment of best practices 2010-10-23

    Description: In this paper, several client companies based on the experience, given the use of WebSphere Message Broker to develop and deploy reliable and scalable ESB solution for some of the best practices. Introduction IBM ® WebSphere ® Message Br

  • Enterprise Platform (business basic platform) design and application of 2009-08-14

    First, why the need for enterprise platforms Although the rapid development of IT industry technology, but information management system for the domestic pattern of development, is still the basis of the underlying technology platform to build busine

  • Transfer: os.path things to note 2010-03-05

    Python's standard library includes general operating system os module functions. If you want your program to work with platform-independent, then this module is particularly important. That it allows a program to be written without any changes, they

  • Apache_python Installation 2010-03-30

    Apache_python Installation Installation Environment: ubuntu server 1. Apache, mod_python, python, installation sudo apt-get install apache2 libapache2-mod-python python-mysqldb a) Publisher Handler mode configuration edit the apache virtual host, in

  • Gaming grand AMD cloud computing Cloud Computing Joint Lab 2010-04-20

    April 19 news, AMD today with Shanda joint press conference held in Shanghai, the official for the grand opening of AMD Joint Laboratory of cloud computing. The two sides said in a joint news conference, a grand joint laboratory cloud computing AMD A

  • Detailed tutorial ant - javac, java, jar, war, delete, copy, mkdir ... (reproduced) 2011-09-11

    Ant is an Apache Foundation, under the cross-platform widget set, it can automatically build and deploy the project and other functions. In this article, mainly for readers familiar with how to apply to the Java Ant project, it simplifies the build a

  • django开发环境部署(一)--pip.virtualenv.virtualenvwrapper 2014-04-23

    Django 开发环境部署(一) 之所以写这篇文章的原因在于django环境的确轻松搭建,之前Ubuntu上安装了,的确很轻松,但是后期我才知道随便做个环境出来很容易到了后面很麻烦,污染了系统里的python版本,导致系统python环境异常崩溃,系统重装的Ubuntu的亲们你们是有感触吧,所以好多人采用virtualenv吧,但是期初用virtualenv的时候的确不需要系统的依赖包了,但是后来折腾来折腾去还是很麻烦,最后我不得已我又各种删,所以最后看到了一个哥们的文章,我才觉得找到了自己自己

  • Nginx学习之五:Nginx第三方模块 2014-07-04

    第三方模块 这些模块不被官方所支持,亦未必能跨越Nginx的版本兼容.不过其中有些模块证明是对多数用户是有用的.只在于个人的风险问题. 编译第三方模块 第三方模块和 Nginx资源是一起被编译过的.在资源目录键入: ./configure --add-module=/path/to/module1/source \ --add-module=/path/to/module2/source 所需参数可以尽可能多地使用--add-module 来设置.请注意,某些模块可能需要额外的系统安装库支持.