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
阿里云镜像:http://mirrors.aliyun.com/ | |
网易开源镜像站:http://mirrors.163.com/ | |
搜狐开源镜像站:http://mirrors.sohu.com/ | |
北京交通大学开源镜像站:http://mirror.bjtu.edu.cn | |
兰州大学开源软件镜像站:http://mirror.lzu.edu.cn/ | |
厦门大学开源软件镜像站:http://mirrors.xmu.edu.cn/ | |
上海交通大学开源软件镜像站:http://ftp.sjtu.edu.cn/ | |
清华大学开源软件镜像站:http://mirrors.tuna.tsinghua.edu.cn/ | |
天津大学开源软件镜像站:http://mirror.tju.edu.cn/ | |
中国科学技术大学开源软件镜像站:http://mirrors.ustc.edu.cn/ |
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
var patt=/2\d{3}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[\s+](0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9])/; | |
$(document).ready(function(){ | |
$("#settings").submit(function(){ | |
var tk=true; | |
$("#settings input[type=text]").each(function(){ | |
result = patt.exec($(this).val()); | |
if(result==null){ | |
var txt=$(this).parent().prev("td").text(); | |
alert(txt+"格式不对"); | |
tk=false; |
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 | |
require "socket" | |
if Gem::Platform.local.os == "darwin" | |
CurrentPath = "/Users/zxy/current" | |
command_path = "/Users/zxy/command" | |
else | |
CurrentPath = "/root/current" | |
command_path = "/root" | |
end |
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 ruby | |
point = Time.now.strftime("%Y%m%d%H") | |
backpath="/backup/dbback/" | |
path="/tmp/"+point | |
fpath=backpath+point+".tar.gz" | |
`mkdir -p #{path}` | |
`mongodump --out #{path} --quiet` | |
`tar -C /tmp -czvf #{fpath} #{point}` | |
require 'mail' |
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
zip data.zip file.txt -rq9 | |
zip data.zip 2015* -rq9 | |
-r recusive directory | |
-q quit | |
-9 best compress |
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
add_source "https://ruby.taobao.org/" | |
gem 'slim-rails' | |
gem 'mongoid' | |
gem 'puma' | |
gem 'bootstrap-sass' | |
gem 'font-awesome-sass' | |
gem 'zbox' | |
app_name = ask("What is your app name ?") |
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
Drawable = Android::Graphics::Drawable::Drawable | |
BitmapFactory = Android::Graphics::BitmapFactory | |
Toast = Android::Widget::Toast | |
Url = Java::Net::URL | |
class MyAsyncTask < Android::Os::AsyncTask | |
attr :img | |
def doInBackground(params) | |
@img = params[1] | |
puts "doInBackground #{params}" |
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 | |
rsync -avz [email protected]:/data/run /data/ecbackup | |
sleep 1 | |
echo "Run is backup" | |
echo "------------------------------------------------------------" | |
rsync -avz [email protected]:/etc/init/{wx,ndc,tiku,bttrack,caddy,dljy,gnath,kpy,mongod,mongodb,qiku,tbcms}.conf /data/ecbackup/upstart | |
sleep 1 | |
echo "Upstart script is backup" | |
echo "------------------------------------------------------------" |
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 ruby | |
require 'socket' | |
def crooms | |
{ | |
'301' => ['192.168.7.1','192.168.7.54'], | |
'303' => ['192.168.5.1','192.168.5.51'], | |
'304' => ['192.168.6.1','192.168.6.48'], | |
'401' => ['192.168.1.1','192.168.1.51'], |
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 ruby | |
require 'socket' | |
room = ARGV[0] | |
hostname = 'localhost' | |
port = 2000 | |
TCPSocket.open(hostname,port) {|server| | |
server.puts room | |
result = server.gets |