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/env python | |
# encoding: utf-8 | |
# Author: [email protected] | |
from __future__ import with_statement | |
from optparse import OptionParser | |
import os | |
parser = OptionParser(version="new9 command v1.0 -- by [email protected]") | |
parser.add_option("-p", "--install", |
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
try: | |
from django.core.management import setup_environ | |
import settings | |
setup_environ(settings) | |
print 'imported django settings' | |
try: | |
exec_strs = ["from %s.models import *"%apps for apps in settings.INSTALLED_APPS ] | |
for x in exec_strs: | |
try: | |
exec(x) |
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/expect | |
spawn ssh yanxu@IP | |
expect "*password:" | |
send "xxxx\n" | |
interact |
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
#!/bin/sh | |
cat ntfs.rts | xargs python -c $1 "import sys;print int(sys.argv[1])/1000000" | xargs date -r |
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
# encoding: utf-8 | |
import urllib2 | |
import cookielib | |
import re | |
import xml.dom as dom | |
import xml.dom.minidom as minidom | |
from BeautifulSoup import BeautifulSoup, Tag, Comment, NavigableString |
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/local/bin/python | |
from optparse import OptionParser | |
from datetime import date | |
import time | |
import os | |
parser = OptionParser() | |
parser.add_option("-c", action="store_false", help="Check Expired Data", dest="is_check") | |
parser.add_option("-d", action="store_true", help="Delete Expired Data", dest="is_check") |
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
#!/bin/sh | |
/usr/local/bin/curl -F "data=xxx.xxx.xx_ja;0;PING OK" http://<IP>:8888/ | |
/usr/local/bin/curl -F "data=xxx.xxx.xx_ja;PING;0;PING OK" http://<IP>:8888/ |
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 __future__ import with_statement | |
import os,sys | |
def find_condition(filename,condition): | |
with open(filename) as f: | |
for i in f: | |
i = i.strip() | |
data = i.split('|') | |
if condition == data[2]: | |
yield i |
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
#encoding: utf-8 | |
from django.contrib import admin | |
from django import forms | |
from app1.models import * | |
from django.contrib.auth.models import User | |
class CustomForm(forms.ModelForm): | |
class Meta: | |
model = Data |
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 django.db import models | |
class People(models.Model): | |
""" | |
>>> p = People() | |
>>> p.save() | |
>>> p.name | |
'123' | |
""" | |
name = models.CharField(blank=True, max_length=100) |